jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792142 [30/35] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/ jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrab...
Date Wed, 08 Jul 2009 13:57:46 GMT
Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/RepositoryServiceLogger.java Wed Jul  8 13:57:13 2009
@@ -49,6 +49,9 @@
 import org.apache.jackrabbit.spi.SessionInfo;
 import org.apache.jackrabbit.spi.Subscription;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
+import org.apache.jackrabbit.spi.QValue;
+import org.apache.jackrabbit.spi.ChildInfo;
+import org.apache.jackrabbit.spi.ItemInfo;
 
 /**
  * Log wrapper for a {@link RepositoryService}.
@@ -106,8 +109,8 @@
         }, "getQValueFactory()", new Object[]{});
     }
 
-    public Map getRepositoryDescriptors() throws RepositoryException {
-        return (Map) execute(new Callable() {
+    public Map<String, String> getRepositoryDescriptors() throws RepositoryException {
+        return (Map<String, String>) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.getRepositoryDescriptors();
             }
@@ -164,12 +167,11 @@
     public boolean isGranted(final SessionInfo sessionInfo, final ItemId itemId, final String[] actions)
             throws RepositoryException {
 
-        return ((Boolean) execute(new Callable() {
+        return (Boolean) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return Boolean.valueOf(service.isGranted(unwrap(sessionInfo), itemId, actions));
             }
-        }, "isGranted(SessionInfo, ItemId, String[])", new Object[] { unwrap(sessionInfo), itemId, actions }))
-                .booleanValue();
+        }, "isGranted(SessionInfo, ItemId, String[])", new Object[] { unwrap(sessionInfo), itemId, actions });
     }
 
     public QNodeDefinition getNodeDefinition(final SessionInfo sessionInfo, final NodeId nodeId)
@@ -202,26 +204,34 @@
         }, "getNodeInfo(SessionInfo, NodeId)", new Object[]{unwrap(sessionInfo), nodeId});
     }
 
-    public Iterator getItemInfos(final SessionInfo sessionInfo, final NodeId nodeId)
+    public Iterator<? extends ItemInfo> getItemInfos(final SessionInfo sessionInfo, final NodeId nodeId)
             throws RepositoryException {
 
-        return (Iterator) execute(new Callable() {
+        return (Iterator<? extends ItemInfo>) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.getItemInfos(unwrap(sessionInfo), nodeId);
             }
         }, "getItemInfos(SessionInfo, NodeId)", new Object[]{unwrap(sessionInfo), nodeId});
     }
 
-    public Iterator getChildInfos(final SessionInfo sessionInfo, final NodeId parentId)
+    public Iterator<ChildInfo> getChildInfos(final SessionInfo sessionInfo, final NodeId parentId)
             throws RepositoryException {
 
-        return (Iterator) execute(new Callable() {
+        return (Iterator<ChildInfo>) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.getChildInfos(unwrap(sessionInfo), parentId);
             }
         }, "getChildInfos(SessionInfo, NodeId)", new Object[]{unwrap(sessionInfo), parentId});
     }
 
+    public Iterator<PropertyId> getReferences(final SessionInfo sessionInfo, final NodeId nodeId, final Name propertyName, final boolean weakReferences) throws RepositoryException {
+        return (Iterator<PropertyId>) execute(new Callable() {
+            public Object call() throws RepositoryException {
+                return service.getReferences(unwrap(sessionInfo), nodeId, propertyName, weakReferences);
+            }
+        }, "getReferences(SessionInfo, NodeId, Name, boolean)", new Object[]{unwrap(sessionInfo), nodeId, propertyName, weakReferences});
+    }
+
     public PropertyInfo getPropertyInfo(final SessionInfo sessionInfo, final PropertyId propertyId)
             throws RepositoryException {
 
@@ -259,7 +269,7 @@
                 return null;
             }
         }, "importXml(SessionInfo, NodeId, InputStream, int)",
-                new Object[]{unwrap(sessionInfo), parentId, xmlStream, new Integer(uuidBehaviour)});
+                new Object[]{unwrap(sessionInfo), parentId, xmlStream, uuidBehaviour});
     }
 
     public void move(final SessionInfo sessionInfo, final NodeId srcNodeId, final NodeId destParentNodeId,
@@ -308,8 +318,7 @@
                 return null;
             }
         }, "clone(SessionInfo, String, NodeId, NodeId, Name, boolean)",
-                new Object[] { unwrap(sessionInfo), srcWorkspaceName, srcNodeId, destParentNodeId, destName,
-                Boolean.valueOf(removeExisting) });
+                new Object[] { unwrap(sessionInfo), srcWorkspaceName, srcNodeId, destParentNodeId, destName, removeExisting});
     }
 
     public LockInfo getLockInfo(final SessionInfo sessionInfo, final NodeId nodeId)
@@ -330,7 +339,7 @@
                 return service.lock(unwrap(sessionInfo), nodeId, deep, sessionScoped);
             }
         }, "lock(SessionInfo, NodeId, boolean, boolean)",
-                new Object[]{unwrap(sessionInfo), nodeId, Boolean.valueOf(deep), Boolean.valueOf(sessionScoped)});
+                new Object[]{unwrap(sessionInfo), nodeId, deep, sessionScoped});
     }
 
     public LockInfo lock(final SessionInfo sessionInfo, final NodeId nodeId, final boolean deep,
@@ -343,7 +352,7 @@
             }
         }, "lock(SessionInfo, NodeId, boolean, boolean, long, String)",
                 new Object[] { unwrap(sessionInfo),
-                nodeId, Boolean.valueOf(deep), Boolean.valueOf(sessionScoped), new Long(timeoutHint),
+                nodeId, deep, sessionScoped, timeoutHint,
                 ownerHint });
     }
 
@@ -418,7 +427,7 @@
                 return null;
             }
         }, "restore(SessionInfo, NodeId, NodeId, boolean)",
-                new Object[]{unwrap(sessionInfo), nodeId, versionId, Boolean.valueOf(removeExisting)});
+                new Object[]{unwrap(sessionInfo), nodeId, versionId, removeExisting});
     }
 
     public void restore(final SessionInfo sessionInfo, final NodeId[] nodeIds, final boolean removeExisting)
@@ -430,29 +439,29 @@
                 return null;
             }
         }, "restore(SessionInfo, NodeId[], boolean)",
-                new Object[]{unwrap(sessionInfo), nodeIds, Boolean.valueOf(removeExisting)});
+                new Object[]{unwrap(sessionInfo), nodeIds, removeExisting});
     }
 
-    public Iterator merge(final SessionInfo sessionInfo, final NodeId nodeId, final String srcWorkspaceName,
+    public Iterator<NodeId> merge(final SessionInfo sessionInfo, final NodeId nodeId, final String srcWorkspaceName,
             final boolean bestEffort) throws RepositoryException {
 
-        return (Iterator) execute(new Callable() {
+        return (Iterator<NodeId>) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.merge(unwrap(sessionInfo), nodeId, srcWorkspaceName, bestEffort);
             }
         }, "merge(SessionInfo, NodeId, String, boolean)",
-                new Object[]{unwrap(sessionInfo), nodeId, srcWorkspaceName, Boolean.valueOf(bestEffort)});
+                new Object[]{unwrap(sessionInfo), nodeId, srcWorkspaceName, bestEffort});
     }
 
-    public Iterator merge(final SessionInfo sessionInfo, final NodeId nodeId, final String srcWorkspaceName,
+    public Iterator<NodeId> merge(final SessionInfo sessionInfo, final NodeId nodeId, final String srcWorkspaceName,
             final boolean bestEffort, final boolean isShallow) throws RepositoryException {
 
-        return (Iterator) execute(new Callable() {
+        return (Iterator<NodeId>) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.merge(unwrap(sessionInfo), nodeId, srcWorkspaceName, bestEffort, isShallow);
             }
         }, "merge(SessionInfo, NodeId, String, boolean, boolean)",
-                new Object[]{unwrap(sessionInfo), nodeId, srcWorkspaceName, Boolean.valueOf(bestEffort)});
+                new Object[]{unwrap(sessionInfo), nodeId, srcWorkspaceName, bestEffort});
     }
 
     public void resolveMergeConflict(final SessionInfo sessionInfo, final NodeId nodeId,
@@ -476,7 +485,7 @@
                 return null;
             }
         }, "addVersionLabel(SessionInfo, NodeId, NodeId, Name, boolean)",
-                new Object[]{unwrap(sessionInfo), versionHistoryId, versionId, label, Boolean.valueOf(moveLabel)});
+                new Object[]{unwrap(sessionInfo), versionHistoryId, versionId, label, moveLabel});
     }
 
     public void removeVersionLabel(final SessionInfo sessionInfo, final NodeId versionHistoryId,
@@ -491,6 +500,40 @@
                 new Object[]{unwrap(sessionInfo), versionHistoryId, versionId, label});
     }
 
+    public NodeId createActivity(final SessionInfo sessionInfo, final String title) throws UnsupportedRepositoryOperationException, RepositoryException {
+        return (NodeId) execute(new Callable() {
+            public Object call() throws RepositoryException {
+                return service.createActivity(unwrap(sessionInfo), title);
+            }
+        }, "createActivity(SessionInfo, String)", new Object[]{unwrap(sessionInfo), title});
+    }
+
+    public void removeActivity(final SessionInfo sessionInfo, final NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
+        execute(new Callable() {
+            public Object call() throws RepositoryException {
+                service.removeActivity(unwrap(sessionInfo), activityId);
+                return null;
+            }
+        }, "removeActivity(SessionInfo, NodeId)",
+                new Object[]{unwrap(sessionInfo), activityId});
+    }
+
+    public Iterator mergeActivity(final SessionInfo sessionInfo, final NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
+        return (Iterator) execute(new Callable() {
+            public Object call() throws RepositoryException {
+                return service.mergeActivity(unwrap(sessionInfo), activityId);
+            }
+        }, "mergeActivity(SessionInfo, NodeId)", new Object[]{unwrap(sessionInfo), activityId});
+    }
+
+    public NodeId createConfiguration(final SessionInfo sessionInfo, final NodeId nodeId, final NodeId baselineId) throws UnsupportedRepositoryOperationException, RepositoryException {
+        return (NodeId) execute(new Callable() {
+            public Object call() throws RepositoryException {
+                return service.createConfiguration(unwrap(sessionInfo), nodeId, baselineId);
+            }
+        }, "createConfiguration(SessionInfo, NodeId, NodeId)", new Object[]{unwrap(sessionInfo), nodeId, baselineId});
+    }
+
     public String[] getSupportedQueryLanguages(final SessionInfo sessionInfo) throws RepositoryException {
         return (String[]) execute(new Callable() {
             public Object call() throws RepositoryException {
@@ -499,27 +542,26 @@
         }, "getSupportedQueryLanguages(SessionInfo)", new Object[]{unwrap(sessionInfo)});
     }
 
-    public void checkQueryStatement(final SessionInfo sessionInfo, final String statement,
-            final String language, final Map namespaces) throws RepositoryException {
+    public String[] checkQueryStatement(final SessionInfo sessionInfo, final String statement,
+            final String language, final Map<String, String> namespaces) throws RepositoryException {
 
-        execute(new Callable() {
+        return (String[]) execute(new Callable() {
             public Object call() throws RepositoryException {
-                service.checkQueryStatement(unwrap(sessionInfo), statement, language, namespaces);
-                return null;
+                return service.checkQueryStatement(unwrap(sessionInfo), statement, language, namespaces);
             }
         }, "checkQueryStatement(SessionInfo, String, String, Map)",
                 new Object[]{unwrap(sessionInfo), statement, language, namespaces});
     }
 
     public QueryInfo executeQuery(final SessionInfo sessionInfo, final String statement,
-            final String language, final Map namespaces) throws RepositoryException {
+                                  final String language, final Map<String, String> namespaces, final long limit, final long offset, final Map<String, QValue> values) throws RepositoryException {
 
         return (QueryInfo) execute(new Callable() {
             public Object call() throws RepositoryException {
-                return service.executeQuery(unwrap(sessionInfo), statement, language, namespaces);
+                return service.executeQuery(unwrap(sessionInfo), statement, language, namespaces, limit, offset, values);
             }
-        }, "executeQuery(SessionInfo, String, String, Map)",
-                new Object[]{unwrap(sessionInfo), statement, language, namespaces});
+        }, "executeQuery(SessionInfo, String, String, Map, long, long, Map)",
+                new Object[]{unwrap(sessionInfo), statement, language, namespaces, limit, offset, values});
     }
 
     public EventFilter createEventFilter(final SessionInfo sessionInfo, final int eventTypes,
@@ -532,8 +574,8 @@
                        qnodeTypeName, noLocal);
             }
         }, "createEventFilter(SessionInfo, int, Path, boolean, String[], Name[], boolean)",
-                new Object[]{unwrap(sessionInfo), new Integer(eventTypes), absPath, Boolean.valueOf(isDeep), uuid,
-                qnodeTypeName, Boolean.valueOf(noLocal)});
+                new Object[]{unwrap(sessionInfo), eventTypes, absPath, isDeep, uuid,
+                qnodeTypeName, noLocal});
     }
 
     public Subscription createSubscription(final SessionInfo sessionInfo, final EventFilter[] filters)
@@ -551,7 +593,7 @@
             throws RepositoryException, InterruptedException {
 
         final String methodName = "getEvents(Subscription, long)";
-        final Object[] args = new Object[]{subscription, new Long(timeout)};
+        final Object[] args = new Object[]{subscription, timeout};
         final InterruptedException[] ex = new InterruptedException[1];
 
         EventBundle[] result = (EventBundle[]) execute(new Callable() {
@@ -573,6 +615,18 @@
         return result;
     }
 
+    public EventBundle getEvents(final SessionInfo sessionInfo,
+                                 final EventFilter filter,
+                                 final long after) throws RepositoryException,
+            UnsupportedRepositoryOperationException {
+        return (EventBundle) execute(new Callable() {
+            public Object call() throws RepositoryException {
+                return service.getEvents(sessionInfo, filter, after);
+            }
+        }, "getEvents(SessionInfo, EventFilter, long)",
+                new Object[]{unwrap(sessionInfo), filter, after});
+    }
+
     public void updateEventFilters(final Subscription subscription, final EventFilter[] eventFilters)
             throws RepositoryException {
 
@@ -594,8 +648,8 @@
         }, "dispose(Subscription)", new Object[]{});
     }
 
-    public Map getRegisteredNamespaces(final SessionInfo sessionInfo) throws RepositoryException {
-        return (Map) execute(new Callable() {
+    public Map<String, String> getRegisteredNamespaces(final SessionInfo sessionInfo) throws RepositoryException {
+        return (Map<String, String>) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.getRegisteredNamespaces(unwrap(sessionInfo));
             }
@@ -643,15 +697,15 @@
         }, "unregisterNamespace(SessionInfo, String)", new Object[]{unwrap(sessionInfo), uri});
     }
 
-    public Iterator getQNodeTypeDefinitions(final SessionInfo sessionInfo) throws RepositoryException {
-        return (Iterator) execute(new Callable() {
+    public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(final SessionInfo sessionInfo) throws RepositoryException {
+        return (Iterator<QNodeTypeDefinition>) execute(new Callable() {
             public Object call() throws RepositoryException {
                 return service.getQNodeTypeDefinitions(unwrap(sessionInfo));
             }
         }, "getQNodeTypeDefinitions(SessionInfo)", new Object[]{unwrap(sessionInfo)});
     }
 
-    public Iterator getQNodeTypeDefinitions(final SessionInfo sessionInfo, final Name[] nodetypeNames)
+    public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(final SessionInfo sessionInfo, final Name[] nodetypeNames)
             throws RepositoryException {
 
         return (Iterator) execute(new Callable() {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/logging/SessionInfoLogger.java Wed Jul  8 13:57:13 2009
@@ -18,6 +18,8 @@
 
 import org.apache.jackrabbit.spi.SessionInfo;
 
+import javax.jcr.RepositoryException;
+
 /**
  * Log wrapper for a {@link SessionInfo}.
  */
@@ -60,31 +62,40 @@
         }, "getWorkspaceName()", new Object[]{});
     }
 
-    public String[] getLockTokens() {
-        return (String[]) execute(new SafeCallable() {
-            public Object call() {
+    public String[] getLockTokens() throws RepositoryException {
+        return (String[]) execute(new Callable() {
+            public Object call() throws RepositoryException {
                 return sessionInfo.getLockTokens();
             }
         }, "getLockTokens()", new Object[]{});
     }
 
-    public void addLockToken(final String lockToken) {
-        execute(new SafeCallable() {
-            public Object call() {
+    public void addLockToken(final String lockToken) throws RepositoryException {
+        execute(new Callable() {
+            public Object call() throws RepositoryException {
                 sessionInfo.addLockToken(lockToken);
                 return null;
             }
         }, "addLockToken(String)", new Object[]{lockToken});
     }
 
-    public void removeLockToken(final String lockToken) {
-        execute(new SafeCallable() {
-            public Object call() {
+    public void removeLockToken(final String lockToken) throws RepositoryException {
+        execute(new Callable() {
+            public Object call() throws RepositoryException {
                 sessionInfo.removeLockToken(lockToken);
                 return null;
             }
         }, "removeLockToken(String)", new Object[]{lockToken});
     }
 
+    public void setUserData(final String userData) throws RepositoryException {
+        execute(new Callable() {
+            public Object call() throws RepositoryException {
+                sessionInfo.setUserData(userData);
+                return null;
+            }
+        }, "setUserData(String)", new Object[]{userData});
+    }
+
 
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameConstants.java Wed Jul  8 13:57:13 2009
@@ -62,11 +62,21 @@
     public static final Name JCR_CREATED = FACTORY.create(Name.NS_JCR_URI, "created");
 
     /**
+     * jcr:createdBy
+     */
+    public static final Name JCR_CREATEDBY = FACTORY.create(Name.NS_JCR_URI, "createdBy");
+
+    /**
      * jcr:lastModified
      */
     public static final Name JCR_LASTMODIFIED = FACTORY.create(Name.NS_JCR_URI, "lastModified");
 
     /**
+     * jcr:lastModifiedBy
+     */
+    public static final Name JCR_LASTMODIFIEDBY = FACTORY.create(Name.NS_JCR_URI, "lastModifiedBy");
+
+    /**
      * jcr:encoding
      */
     public static final Name JCR_ENCODING = FACTORY.create(Name.NS_JCR_URI, "encoding");
@@ -86,6 +96,41 @@
      */
     public static final Name JCR_CONTENT = FACTORY.create(Name.NS_JCR_URI, "content");
 
+    /**
+     * jcr:etag
+     */
+    public static final Name JCR_ETAG = FACTORY.create(Name.NS_JCR_URI, "etag");
+
+    /**
+     * jcr:protocol
+     */
+    public static final Name JCR_PROTOCOL = FACTORY.create(Name.NS_JCR_URI, "protocol");
+
+    /**
+     * jcr:host
+     */
+    public static final Name JCR_HOST = FACTORY.create(Name.NS_JCR_URI, "host");
+
+    /**
+     * jcr:port
+     */
+    public static final Name JCR_PORT = FACTORY.create(Name.NS_JCR_URI, "port");
+
+    /**
+     * jcr:repository
+     */
+    public static final Name JCR_REPOSITORY = FACTORY.create(Name.NS_JCR_URI, "repository");
+
+    /**
+     * jcr:workspace
+     */
+    public static final Name JCR_WORKSPACE = FACTORY.create(Name.NS_JCR_URI, "workspace");
+
+    /**
+     * jcr:id
+     */
+    public static final Name JCR_ID = FACTORY.create(Name.NS_JCR_URI, "id");
+
     //--------------------------------------< xml related item name constants >
 
     /**
@@ -214,6 +259,31 @@
      */
     public static final Name JCR_VERSIONABLEUUID = FACTORY.create(Name.NS_JCR_URI, "versionableUuid");
 
+    /**
+     * jcr:copiedFrom
+     * @since 2.0
+     */
+    public static final Name JCR_COPIEDFROM = FACTORY.create(Name.NS_JCR_URI, "copiedFrom");
+
+    /**
+     * jcr:activities
+     * @since 2.0
+     */
+    public static final Name JCR_ACTIVITIES = FACTORY.create(Name.NS_JCR_URI, "activities");
+
+    /**
+     * jcr:activity
+     * @since 2.0
+     */
+    public static final Name JCR_ACTIVITY = FACTORY.create(Name.NS_JCR_URI, "activity");
+
+    /**
+     * jcr:activityTitle
+     * @since 2.0
+     */
+    public static final Name JCR_ACTIVITY_TITLE = FACTORY.create(Name.NS_JCR_URI, "activityTitle");
+
+
     //--------------------------------< node type related item name constants >
 
     /**
@@ -362,6 +432,41 @@
     public static final Name NT_FOLDER = FACTORY.create(Name.NS_NT_URI, "folder");
 
     /**
+     * mix:created
+     */
+    public static final Name MIX_CREATED = FACTORY.create(Name.NS_MIX_URI, "created");
+
+    /**
+     * mix:lastModified
+     */
+    public static final Name MIX_LASTMODIFIED = FACTORY.create(Name.NS_MIX_URI, "lastModified");
+
+    /**
+     * mix:title
+     */
+    public static final Name MIX_TITLE = FACTORY.create(Name.NS_MIX_URI, "title");
+
+    /**
+     * mix:language
+     */
+    public static final Name MIX_LANGUAGE = FACTORY.create(Name.NS_MIX_URI, "language");
+
+    /**
+     * mix:mimeType
+     */
+    public static final Name MIX_MIMETYPE = FACTORY.create(Name.NS_MIX_URI, "mimeType");
+
+    /**
+     * mix:etag
+     */
+    public static final Name MIX_ETAG = FACTORY.create(Name.NS_MIX_URI, "etag");
+
+    /**
+     * nt:address
+     */
+    public static final Name NT_ADDRESS = FACTORY.create(Name.NS_NT_URI, "address");
+
+    /**
      * nt:query
      */
     public static final Name NT_QUERY = FACTORY.create(Name.NS_NT_URI, "query");
@@ -432,6 +537,12 @@
     public static final Name MIX_LIFECYCLE =
         FACTORY.create(Name.NS_MIX_URI, "lifecycle");
 
+    /**
+     * nt:activity
+     * @since 2.0
+     */
+    public static final Name NT_ACTIVITY = FACTORY.create(Name.NS_NT_URI, "activity");
+
     //--------------------------------------------------------------------------
     /**
      * rep:root
@@ -449,6 +560,21 @@
     public static final Name REP_VERSIONSTORAGE = FACTORY.create(Name.NS_REP_URI, "versionStorage");
 
     /**
+     * rep:activities
+     */
+    public static final Name REP_ACTIVITIES = FACTORY.create(Name.NS_REP_URI, "activities");
+
+    /**
+     * rep:versionReference
+     */
+    public static final Name REP_VERSION_REFERENCE = FACTORY.create(Name.NS_REP_URI, "VersionReference");
+
+    /**
+     * rep:versions
+     */
+    public static final Name REP_VERSIONS = FACTORY.create(Name.NS_REP_URI, "versions");
+    
+    /**
      * rep:nodeTypes
      */
     public static final Name REP_NODETYPES = FACTORY.create(Name.NS_REP_URI, "nodeTypes");

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameFactoryImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameFactoryImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NameFactoryImpl.java Wed Jul  8 13:57:13 2009
@@ -29,7 +29,7 @@
     /**
      * Cache of flyweight name instances.
      *
-     * @see https://issues.apache.org/jira/browse/JCR-1663
+     * @see <a href="https://issues.apache.org/jira/browse/JCR-1663">JCR-1663</a>
      */
     private final HashCache cache = new HashCache();
 
@@ -46,10 +46,10 @@
     public Name create(String namespaceURI, String localName) throws IllegalArgumentException {
         // NOTE: an empty localName and/or URI is valid (e.g. the root node name)
         if (namespaceURI == null) {
-            throw new IllegalArgumentException("invalid namespaceURI specified");
+            throw new IllegalArgumentException("No namespaceURI specified");
         }
         if (localName == null) {
-            throw new IllegalArgumentException("invalid localName specified");
+            throw new IllegalArgumentException("No localName specified");
         }
         return (Name) cache.get(new NameImpl(namespaceURI, localName));
     }
@@ -59,17 +59,20 @@
      */
     public Name create(String nameString) throws IllegalArgumentException {
         if (nameString == null || "".equals(nameString)) {
-            throw new IllegalArgumentException("Invalid Name literal.");
+            throw new IllegalArgumentException("No Name literal specified");
         }
         if (nameString.charAt(0) != '{') {
-            throw new IllegalArgumentException("Invalid Name literal");
+            throw new IllegalArgumentException(
+                    "Invalid Name literal: " + nameString);
         }
         int i = nameString.indexOf('}');
         if (i == -1) {
-            throw new IllegalArgumentException("Invalid Name literal");
+            throw new IllegalArgumentException(
+                    "Invalid Name literal: " + nameString);
         }
         if (i == nameString.length() - 1) {
-            throw new IllegalArgumentException("Invalid Name literal");
+            throw new IllegalArgumentException(
+                    "Invalid Name literal: " + nameString);
         }
         return (Name) cache.get(new NameImpl(
                 nameString.substring(1, i), nameString.substring(i + 1)));
@@ -81,16 +84,16 @@
      */
     private static class NameImpl implements Name {
 
-        /** The memorized hash code of this qualified name. */
+        /** The memorized hash code of this name. */
         private transient int hash;
 
-        /** The memorized string representation of this qualified name. */
+        /** The memorized string representation of this name. */
         private transient String string;
 
-        /** The internalized namespace URI of this qualified name. */
+        /** The internalized namespace URI of this name. */
         private final String namespaceURI;
 
-        /** The local part of this qualified name. */
+        /** The local part of this name. */
         private final String localName;
 
         private NameImpl(String namespaceURI, String localName) {
@@ -137,13 +140,13 @@
         }
 
         /**
-         * Compares two qualified names for equality. Returns <code>true</code>
-         * if the given object is a qualified name and has the same namespace URI
-         * and local part as this qualified name.
+         * Compares two names for equality. Returns <code>true</code>
+         * if the given object is a <code>Name</code> and has the same namespace
+         * URI and local part as this <code>Name</code>.
          *
-         * @param obj the object to compare this qualified name with
-         * @return <code>true</code> if the object is equal to this qualified name,
-         *         <code>false</code> otherwise
+         * @param obj the object to compare.
+         * @return <code>true</code> if the object is equal to this <code>Name</code>,
+         *         <code>false</code> otherwise.
          * @see Object#equals(Object)
          */
         public boolean equals(Object obj) {
@@ -164,8 +167,8 @@
         }
 
         /**
-         * Returns the hash code of this qualified name. The hash code is
-         * computed from the namespace URI and local part of the qualified
+         * Returns the hash code of this name. The hash code is
+         * computed from the namespace URI and local part of the
          * name and memorized for better performance.
          *
          * @return hash code
@@ -185,7 +188,7 @@
 
         //------------------------------------------------------< Cloneable >---
         /**
-         * Creates a clone of this qualified name.
+         * Creates a clone of this <code>Name</code>.
          * Overriden in order to make <code>clone()</code> public.
          *
          * @return a clone of this instance
@@ -199,11 +202,11 @@
 
         //-----------------------------------------------------< Comparable >---
         /**
-         * Compares two qualified names.
+         * Compares two <code>Name</code>s.
          *
-         * @param o the object to compare this qualified name with
+         * @param o the object to compare.
          * @return comparison result
-         * @throws ClassCastException if the given object is not a qualified name
+         * @throws ClassCastException if the given object is not a <code>Name</code>.
          * @see Comparable#compareTo(Object)
          */
         public int compareTo(Object o) {
@@ -228,4 +231,5 @@
             return new NameImpl(namespaceURI, localName);
         }
     }
-}
\ No newline at end of file
+
+}

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/PathFactoryImpl.java Wed Jul  8 13:57:13 2009
@@ -68,7 +68,8 @@
      */
     public Path create(Path parent, Path relPath, boolean normalize) throws IllegalArgumentException, RepositoryException {
         if (relPath.isAbsolute()) {
-            throw new IllegalArgumentException("relPath is not a relative path");
+            throw new IllegalArgumentException(
+                    "relPath is not a relative path: " + relPath);
         }
         List l = new ArrayList();
         l.addAll(Arrays.asList(parent.getElements()));
@@ -130,7 +131,8 @@
      */
     public Path create(Name name, int index) throws IllegalArgumentException {
         if (index < Path.INDEX_UNDEFINED) {
-            throw new IllegalArgumentException("Index must not be negative: " + index);
+            throw new IllegalArgumentException(
+                    "Index must not be negative: " + name + "[" + index + "]");
         }
         Path.Element elem = createElement(name, index);
         return new Builder(new Path.Element[]{elem}).getPath();
@@ -148,7 +150,7 @@
      */
     public Path create(String pathString) throws IllegalArgumentException {
         if (pathString == null || "".equals(pathString)) {
-            throw new IllegalArgumentException("Invalid Path literal");
+            throw new IllegalArgumentException("No Path literal specified");
         }
         // split into path elements
         int lastPos = 0;
@@ -191,14 +193,16 @@
      */
     public Path.Element createElement(Name name, int index) throws IllegalArgumentException {
         if (index < Path.INDEX_UNDEFINED) {
-            throw new IllegalArgumentException("The index may not be negative.");
+            throw new IllegalArgumentException(
+                    "The index may not be negative: " + name + "[" + index + "]");
         } else if (name == null) {
             throw new IllegalArgumentException("The name must not be null");
         } else if (name.equals(PARENT_NAME)
                 || name.equals(CURRENT_NAME)
                 || name.equals(ROOT_NAME)) {
             throw new IllegalArgumentException(
-                    "Special path elements (root, '.' and '..') can not have an explicit index.");
+                    "Special path elements (root, '.' and '..') can not have an explicit index: "
+                    + name + "[" + index + "]");
         } else {
             return new Element(name, index);
         }
@@ -358,7 +362,8 @@
                 return this;
             }
             if (denotesIdentifier()) {
-                throw new RepositoryException("Identifier-based path cannot be normalized.");                 
+                throw new RepositoryException(
+                        "Identifier-based path cannot be normalized: " + this);
             }
             LinkedList queue = new LinkedList();
             Path.Element last = PARENT_ELEMENT;
@@ -391,10 +396,12 @@
                 return this;
             }
             if (!isAbsolute()) {
-                throw new RepositoryException("Only an absolute path can be canonicalized.");
+                throw new RepositoryException(
+                        "Only an absolute path can be canonicalized: "  + this);
             }
             if (denotesIdentifier()) {
-                throw new RepositoryException("Identifier-based path cannot be canonicalized.");
+                throw new RepositoryException(
+                        "Identifier-based path cannot be canonicalized: " + this);
             }
             return getNormalizedPath();
         }
@@ -409,10 +416,14 @@
 
             // make sure both paths are absolute and not id-based
             if (!isAbsolute() || !other.isAbsolute()) {
-                throw new RepositoryException("Cannot compute relative path from relative paths");
+                throw new RepositoryException(
+                        "Cannot compute relative path from relative paths: "
+                        + this + " vs. " + other);
             }
             if (denotesIdentifier() || other.denotesIdentifier()) {
-                throw new RepositoryException("Cannot compute relative path from identifier-based paths");                
+                throw new RepositoryException(
+                        "Cannot compute relative path from identifier-based paths: "
+                        + this + " vs. " + other);
             }
 
             // make sure we're comparing canonical paths
@@ -458,7 +469,8 @@
          */
         public Path getAncestor(int degree) throws IllegalArgumentException, PathNotFoundException, RepositoryException {
             if (degree < 0) {
-                throw new IllegalArgumentException("degree must be >= 0");
+                throw new IllegalArgumentException(
+                        "degree must be >= 0: " + this);
             } else if (degree == 0) {
                 return getNormalizedPath();
             }
@@ -467,7 +479,8 @@
                 Path.Element[] normElems = getNormalizedPath().getElements();
                 int length = normElems.length - degree;
                 if (length < 1) {
-                    throw new PathNotFoundException("no such ancestor path of degree " + degree);
+                    throw new PathNotFoundException(
+                            "no ancestor at degree " + degree + ": " + this);
                 }
                 Path.Element[] ancestorElements = new Element[length];
                 System.arraycopy(normElems, 0, ancestorElements, 0, length);
@@ -507,7 +520,8 @@
          */
         public int getDepth() throws RepositoryException {
             if (denotesIdentifier()) {
-                throw new RepositoryException("Cannot determine depth of an identifier based path.");
+                throw new RepositoryException(
+                        "Cannot determine depth of an identifier based path: " + this);
             }
             int depth = ROOT_DEPTH;
             for (int i = 0; i < elements.length; i++) {
@@ -529,7 +543,9 @@
                 throw new IllegalArgumentException("null argument");
             }
             if (isAbsolute() != other.isAbsolute()) {
-                throw new IllegalArgumentException("Cannot compare a relative path with an absolute path");
+                throw new IllegalArgumentException(
+                        "Cannot compare a relative path with an absolute path: "
+                        + this + " vs. " + other);
             }
 
             if (getDepth() != other.getDepth()) {
@@ -558,7 +574,9 @@
             }
             // make sure both paths are either absolute or relative
             if (isAbsolute() != other.isAbsolute()) {
-                throw new IllegalArgumentException("Cannot compare a relative path with an absolute path");
+                throw new IllegalArgumentException(
+                        "Cannot compare a relative path with an absolute path: "
+                        + this + " vs. " + other);
             }
 
             int delta = other.getDepth() - getDepth();
@@ -586,7 +604,9 @@
                 throw new IllegalArgumentException();
             }
             if (!isNormalized()) {
-                throw new RepositoryException("Cannot extract sub-Path from a non-normalized Path.");
+                throw new RepositoryException(
+                        "Cannot extract sub-Path from a non-normalized Path: "
+                        + this);
             }
             Path.Element[] dest = new Path.Element[to-from];
             System.arraycopy(elements, from, dest, 0, dest.length);
@@ -702,7 +722,7 @@
     private static class Element implements Path.Element {
 
         /**
-         * Qualified name of the path element.
+         * Name of the path element.
          */
         private final Name name;
 
@@ -714,11 +734,11 @@
 
         /**
          * Private constructor for creating a path element with the given
-         * qualified name and index. Instead of using this constructor directly
+         * name and index. Instead of using this constructor directly
          * the factory methods {@link PathFactory#createElement(Name)} and
          * {@link PathFactory#create(Name, int)} should be used.
          *
-         * @param name  qualified name
+         * @param name A <code>Name</code> object.
          * @param index index
          */
         private Element(Name name, int index) {
@@ -1089,4 +1109,5 @@
             return new PathImpl(elements, isNormalized);
         }
     }
+
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/namespace/NamespaceMapping.java Wed Jul  8 13:57:13 2009
@@ -16,12 +16,10 @@
  */
 package org.apache.jackrabbit.spi.commons.namespace;
 
-import javax.jcr.NamespaceException;
-import java.util.Properties;
-import java.util.Map;
 import java.util.HashMap;
-import java.util.Set;
-import java.util.Iterator;
+import java.util.Map;
+
+import javax.jcr.NamespaceException;
 
 /**
  * A Simple Namespace Mapping table. Mappings can be added
@@ -31,10 +29,10 @@
 public class NamespaceMapping implements NamespaceResolver {
 
     /** local uris */
-    private final Properties prefixToURI = new Properties();
+    private final Map<String, String> prefixToURI = new HashMap<String, String>();
 
     /** local prefix */
-    private final Properties URIToPrefix = new Properties();
+    private final Map<String, String> URIToPrefix = new HashMap<String, String>();
 
     /** base */
     private final NamespaceResolver base;
@@ -45,6 +43,7 @@
 
     /**
      * Constructor
+     * @param base fallback resolver
      */
     public NamespaceMapping(NamespaceResolver base) {
         this.base = base;
@@ -56,7 +55,7 @@
      */
     public String getPrefix(String uri) throws NamespaceException {
         if (URIToPrefix.containsKey(uri)) {
-            return URIToPrefix.getProperty(uri);
+            return URIToPrefix.get(uri);
         } else if (base == null) {
             throw new NamespaceException("No prefix for URI '" + uri + "' declared.");
         } else {
@@ -69,7 +68,7 @@
      */
     public String getURI(String prefix) throws NamespaceException {
         if (prefixToURI.containsKey(prefix)) {
-            return prefixToURI.getProperty(prefix);
+            return prefixToURI.get(prefix);
         } else if (base == null) {
             throw new NamespaceException("No URI for prefix '" + prefix + "' declared.");
         } else {
@@ -79,6 +78,8 @@
 
     /**
      * Returns true if prefix is already mapped to some URI. Returns false otherwise.
+     * @param prefix prefix to check
+     * @return <code>true</code> if prefix is mapped
      */
     public boolean hasPrefix(String prefix) {
         return prefixToURI.containsKey(prefix);
@@ -87,9 +88,9 @@
     /**
      * Set a prefix == URI one-to-one mapping
      *
-     * @param prefix
-     * @param uri
-     * @throws NamespaceException
+     * @param prefix prefix to map
+     * @param uri uri to map
+     * @throws NamespaceException if an error occurs
      */
     public void setMapping(String prefix, String uri) throws NamespaceException {
         if (prefix == null) {
@@ -115,8 +116,8 @@
      * The returned Map is a copy of the internal Map.
      * @return Map
      */
-    public Map getPrefixToURIMapping() {
-        return new HashMap(prefixToURI);
+    public Map<String, String> getPrefixToURIMapping() {
+        return new HashMap<String, String>(prefixToURI);
     }
 
     /**
@@ -124,15 +125,12 @@
      * The returned Map is a copy of the internal Map.
      * @return Map
      */
-    public Map getURIToPrefixMapping() {
-        return new HashMap(URIToPrefix);
+    public Map<String, String> getURIToPrefixMapping() {
+        return new HashMap<String, String>(URIToPrefix);
     }
 
-     /**
-     * Override equals()
-      *
-     * @param obj
-     * @return boolean
+    /**
+     * {@inheritDoc}
      */
     public boolean equals(Object obj) {
         if (this == obj) {
@@ -153,11 +151,9 @@
      */
     public String toString() {
         String s = "";
-        Set mapping = prefixToURI.entrySet();
-        for (Iterator i = mapping.iterator(); i.hasNext();) {
-            Map.Entry entry = (Map.Entry) i.next();
-            String prefix = (String) entry.getKey();
-            String uri = (String) entry.getValue();
+        for (Map.Entry<String, String> entry: prefixToURI.entrySet()) {
+            String prefix = entry.getKey();
+            String uri = entry.getValue();
             s += "'" + prefix + "' == '" + uri + "'\n";
         }
         return s;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/ItemDefinitionImpl.java Wed Jul  8 13:57:13 2009
@@ -45,7 +45,7 @@
     protected static final String ANY_NAME = "*";
 
     /**
-     * The namespace resolver used to translate qualified names to JCR names.
+     * The namespace resolver used to translate <code>Name</code>s to JCR name strings.
      */
     protected final NamePathResolver resolver;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeDefDiff.java Wed Jul  8 13:57:13 2009
@@ -22,6 +22,8 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
+import java.util.Map;
 
 import javax.jcr.PropertyType;
 
@@ -30,6 +32,7 @@
 import org.apache.jackrabbit.spi.QNodeDefinition;
 import org.apache.jackrabbit.spi.QNodeTypeDefinition;
 import org.apache.jackrabbit.spi.QPropertyDefinition;
+import org.apache.jackrabbit.spi.QValueConstraint;
 
 /**
  * A <code>NodeTypeDefDiff</code> represents the result of the comparison of
@@ -100,11 +103,13 @@
     private final QNodeTypeDefinition newDef;
     private int type;
 
-    private final List propDefDiffs = new ArrayList();
-    private final List childNodeDefDiffs = new ArrayList();
+    private final List<PropDefDiff> propDefDiffs = new ArrayList<PropDefDiff>();
+    private final List<ChildNodeDefDiff> childNodeDefDiffs = new ArrayList<ChildNodeDefDiff>();
 
     /**
      * Constructor
+     * @param oldDef old definition
+     * @param newDef new definition
      */
     private NodeTypeDefDiff(QNodeTypeDefinition oldDef, QNodeTypeDefinition newDef) {
         this.oldDef = oldDef;
@@ -154,9 +159,9 @@
     }
 
     /**
-     * @param oldDef
-     * @param newDef
-     * @return
+     * @param oldDef old definition
+     * @param newDef new definition
+     * @return the diff
      */
     public static NodeTypeDefDiff create(QNodeTypeDefinition oldDef, QNodeTypeDefinition newDef) {
         if (oldDef == null || newDef == null) {
@@ -169,28 +174,28 @@
     }
 
     /**
-     * @return
+     * @return <code>true</code> if modified
      */
     public boolean isModified() {
         return type != NONE;
     }
 
     /**
-     * @return
+     * @return <code>true</code> if trivial
      */
     public boolean isTrivial() {
         return type == TRIVIAL;
     }
 
     /**
-     * @return
+     * @return <code>true</code> if minor
      */
     public boolean isMinor() {
         return type == MINOR;
     }
 
     /**
-     * @return
+     * @return <code>true</code> if major
      */
     public boolean isMajor() {
         return type == MAJOR;
@@ -215,21 +220,21 @@
     }
 
     /**
-     * @return
+     * @return <code>true</code> if mixin diff
      */
     public int mixinFlagDiff() {
         return oldDef.isMixin() != newDef.isMixin() ? MAJOR : NONE;
     }
 
     /**
-     * @return
+     * @return <code>true</code> if supertypes diff
      */
     public int supertypesDiff() {
         return !Arrays.equals(oldDef.getSupertypes(), newDef.getSupertypes()) ? MAJOR : NONE;
     }
 
     /**
-     * @return
+     * @return diff type
      */
     private int buildPropDefDiffs() {
         /**
@@ -239,15 +244,15 @@
 
         int maxType = NONE;
         QPropertyDefinition[] pda1 = oldDef.getPropertyDefs();
-        HashMap defs1 = new HashMap();
-        for (int i = 0; i < pda1.length; i++) {
-            defs1.put(pda1[i].getName(), pda1[i]);
+        Map<Name, QPropertyDefinition> defs1 = new HashMap<Name, QPropertyDefinition>();
+        for (QPropertyDefinition aPda1 : pda1) {
+            defs1.put(aPda1.getName(), aPda1);
         }
 
         QPropertyDefinition[] pda2 = newDef.getPropertyDefs();
-        HashMap defs2 = new HashMap();
-        for (int i = 0; i < pda2.length; i++) {
-            defs2.put(pda2[i].getName(), pda2[i]);
+        Map<Name, QPropertyDefinition> defs2 = new HashMap<Name, QPropertyDefinition>();
+        for (QPropertyDefinition aPda2 : pda2) {
+            defs2.put(aPda2.getName(), aPda2);
         }
 
         /**
@@ -257,8 +262,8 @@
         Iterator iter = defs1.keySet().iterator();
         while (iter.hasNext()) {
             Name name = (Name) iter.next();
-            QPropertyDefinition def1 = (QPropertyDefinition) defs1.get(name);
-            QPropertyDefinition def2 = (QPropertyDefinition) defs2.get(name);
+            QPropertyDefinition def1 = defs1.get(name);
+            QPropertyDefinition def2 = defs2.get(name);
             PropDefDiff diff = new PropDefDiff(def1, def2);
             if (diff.getType() > maxType) {
                 maxType = diff.getType();
@@ -274,7 +279,7 @@
         iter = defs2.keySet().iterator();
         while (iter.hasNext()) {
             Name name = (Name) iter.next();
-            QPropertyDefinition def = (QPropertyDefinition) defs2.get(name);
+            QPropertyDefinition def = defs2.get(name);
             PropDefDiff diff = new PropDefDiff(null, def);
             if (diff.getType() > maxType) {
                 maxType = diff.getType();
@@ -286,7 +291,7 @@
     }
 
     /**
-     * @return
+     * @return diff type
      */
     private int buildChildNodeDefDiffs() {
         /**
@@ -296,15 +301,15 @@
 
         int maxType = NONE;
         QNodeDefinition[] cnda1 = oldDef.getChildNodeDefs();
-        HashMap defs1 = new HashMap();
-        for (int i = 0; i < cnda1.length; i++) {
-            defs1.put(cnda1[i].getName(), cnda1[i]);
+        Map<Name, QNodeDefinition> defs1 = new HashMap<Name, QNodeDefinition>();
+        for (QNodeDefinition aCnda1 : cnda1) {
+            defs1.put(aCnda1.getName(), aCnda1);
         }
 
         QNodeDefinition[] cnda2 = newDef.getChildNodeDefs();
-        HashMap defs2 = new HashMap();
-        for (int i = 0; i < cnda2.length; i++) {
-            defs2.put(cnda2[i].getName(), cnda2[i]);
+        Map<Name, QNodeDefinition> defs2 = new HashMap<Name, QNodeDefinition>();
+        for (QNodeDefinition aCnda2 : cnda2) {
+            defs2.put(aCnda2.getName(), aCnda2);
         }
 
         /**
@@ -314,8 +319,8 @@
         Iterator iter = defs1.keySet().iterator();
         while (iter.hasNext()) {
             Name name = (Name) iter.next();
-            QNodeDefinition def1 = (QNodeDefinition) defs1.get(name);
-            QNodeDefinition def2 = (QNodeDefinition) defs2.get(name);
+            QNodeDefinition def1 = defs1.get(name);
+            QNodeDefinition def2 = defs2.get(name);
             ChildNodeDefDiff diff = new ChildNodeDefDiff(def1, def2);
             if (diff.getType() > maxType) {
                 maxType = diff.getType();
@@ -331,7 +336,7 @@
         iter = defs2.keySet().iterator();
         while (iter.hasNext()) {
             Name name = (Name) iter.next();
-            QNodeDefinition def = (QNodeDefinition) defs2.get(name);
+            QNodeDefinition def = defs2.get(name);
             ChildNodeDefDiff diff = new ChildNodeDefDiff(null, def);
             if (diff.getType() > maxType) {
                 maxType = diff.getType();
@@ -361,7 +366,7 @@
         return result;
     }
 
-    private String toString(List childItemDefDiffs) {
+    private String toString(List<? extends ChildItemDefDiff> childItemDefDiffs) {
         String result = "";
         for (Iterator iter = childItemDefDiffs.iterator(); iter.hasNext();) {
             ChildItemDefDiff propDefDiff = (ChildItemDefDiff) iter.next();
@@ -520,15 +525,15 @@
                  * check if valueConstraints were made more restrictive
                  * (constraints are ORed)
                  */
-                String[] vca1 = getOldDef().getValueConstraints();
-                HashSet set1 = new HashSet();
-                for (int i = 0; i < vca1.length; i++) {
-                    set1.add(vca1[i]);
+                QValueConstraint[] vca1 = getOldDef().getValueConstraints();
+                Set<String> set1 = new HashSet<String>();
+                for (QValueConstraint aVca1 : vca1) {
+                    set1.add(aVca1.getString());
                 }
-                String[] vca2 = getNewDef().getValueConstraints();
-                HashSet set2 = new HashSet();
-                for (int i = 0; i < vca2.length; i++) {
-                    set2.add(vca2[i]);
+                QValueConstraint[] vca2 = getNewDef().getValueConstraints();
+                Set<String> set2 = new HashSet<String>();
+                for (QValueConstraint aVca2 : vca2) {
+                    set2.add(aVca2.getString());
                 }
 
                 if (set1.isEmpty() && !set2.isEmpty()) {
@@ -603,8 +608,8 @@
                 // no need to check defaultPrimaryType (TRIVIAL change)
 
                 if (type == TRIVIAL) {
-                    List l1 = Arrays.asList(getOldDef().getRequiredPrimaryTypes());
-                    List l2 = Arrays.asList(getNewDef().getRequiredPrimaryTypes());
+                    List<Name> l1 = Arrays.asList(getOldDef().getRequiredPrimaryTypes());
+                    List<Name> l2 = Arrays.asList(getNewDef().getRequiredPrimaryTypes());
                     if (!l1.equals(l2)) {
                         if (l1.containsAll(l2)) {
                             // removed requiredPrimaryType (MINOR change)

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeTemplateImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeTemplateImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeTypeTemplateImpl.java Wed Jul  8 13:57:13 2009
@@ -16,17 +16,15 @@
  */
 package org.apache.jackrabbit.spi.commons.nodetype;
 
-import org.apache.commons.collections.list.TypedList;
-
-import javax.jcr.nodetype.NodeTypeTemplate;
-import javax.jcr.nodetype.NodeTypeDefinition;
-import javax.jcr.nodetype.NodeDefinitionTemplate;
-import javax.jcr.nodetype.PropertyDefinitionTemplate;
+import java.util.LinkedList;
+import java.util.List;
 
 import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeDefinitionTemplate;
+import javax.jcr.nodetype.NodeTypeDefinition;
+import javax.jcr.nodetype.NodeTypeTemplate;
 import javax.jcr.nodetype.PropertyDefinition;
-import java.util.ArrayList;
-import java.util.List;
+import javax.jcr.nodetype.PropertyDefinitionTemplate;
 
 /**
  * A <code>NodeTypeTemplateImpl</code> ...
@@ -40,8 +38,8 @@
     private boolean queryable;
     private boolean mixin;
     private boolean orderableChildNodes;
-    private List nodeDefinitionTemplates;
-    private List propertyDefinitionTemplates;
+    private List<NodeDefinitionTemplate> nodeDefinitionTemplates;
+    private List<PropertyDefinitionTemplate> propertyDefinitionTemplates;
 
     /**
      * Package private constructor
@@ -66,15 +64,15 @@
         NodeDefinition[] nodeDefs = def.getDeclaredChildNodeDefinitions();
         if (nodeDefs != null) {
             List list = getNodeDefinitionTemplates();
-            for (int i = 0; i < nodeDefs.length; i++) {
-                list.add(new NodeDefinitionTemplateImpl(nodeDefs[i]));
+            for (NodeDefinition nodeDef : nodeDefs) {
+                list.add(new NodeDefinitionTemplateImpl(nodeDef));
             }
         }
         PropertyDefinition[] propDefs = def.getDeclaredPropertyDefinitions();
         if (propDefs != null) {
             List list = getPropertyDefinitionTemplates();
-            for (int i = 0; i < propDefs.length; i++) {
-                list.add(new PropertyDefinitionTemplateImpl(propDefs[i]));
+            for (PropertyDefinition propDef : propDefs) {
+                list.add(new PropertyDefinitionTemplateImpl(propDef));
             }
         }
     }
@@ -127,8 +125,7 @@
      */
     public List getPropertyDefinitionTemplates() {
         if (propertyDefinitionTemplates == null) {
-            propertyDefinitionTemplates = TypedList.decorate(
-                    new ArrayList(), PropertyDefinitionTemplate.class);
+            propertyDefinitionTemplates = new LinkedList<PropertyDefinitionTemplate>();
         }
         return propertyDefinitionTemplates;
     }
@@ -138,8 +135,7 @@
      */
     public List getNodeDefinitionTemplates() {
         if (nodeDefinitionTemplates == null) {
-            nodeDefinitionTemplates = TypedList.decorate(
-                    new ArrayList(), NodeDefinitionTemplate.class);
+            nodeDefinitionTemplates = new LinkedList<NodeDefinitionTemplate>();
         }
         return nodeDefinitionTemplates;
     }
@@ -205,7 +201,7 @@
         if (propertyDefinitionTemplates == null) {
             return null;
         } else {
-            return (PropertyDefinition[]) propertyDefinitionTemplates.toArray(
+            return propertyDefinitionTemplates.toArray(
                     new PropertyDefinition[propertyDefinitionTemplates.size()]);
         }
     }
@@ -217,7 +213,7 @@
         if (nodeDefinitionTemplates == null) {
             return null;
         } else {
-            return (NodeDefinition[]) nodeDefinitionTemplates.toArray(
+            return nodeDefinitionTemplates.toArray(
                     new NodeDefinition[nodeDefinitionTemplates.size()]);
         }
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionImpl.java Wed Jul  8 13:57:13 2009
@@ -16,19 +16,19 @@
  */
 package org.apache.jackrabbit.spi.commons.nodetype;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFactory;
+import javax.jcr.nodetype.PropertyDefinition;
+
 import org.apache.jackrabbit.spi.QPropertyDefinition;
 import org.apache.jackrabbit.spi.QValue;
-import org.apache.jackrabbit.spi.Name;
+import org.apache.jackrabbit.spi.QValueConstraint;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.value.ValueFormat;
-
-import javax.jcr.nodetype.PropertyDefinition;
-import javax.jcr.Value;
-import javax.jcr.RepositoryException;
-import javax.jcr.NamespaceException;
-import javax.jcr.ValueFactory;
+import org.apache.jackrabbit.spi.commons.nodetype.constraint.ValueConstraint;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This class implements the <code>PropertyDefinition</code> interface.
@@ -49,8 +49,8 @@
      * Package private constructor
      *
      * @param propDef    property definition
-     * @param resolver
-     * @param valueFactory
+     * @param resolver the name-path resolver
+     * @param valueFactory a value factory
      */
     public PropertyDefinitionImpl(QPropertyDefinition propDef, NamePathResolver resolver,
                                   ValueFactory valueFactory) {
@@ -59,10 +59,10 @@
 
     /**
      *
-     * @param propDef
-     * @param ntMgr
-     * @param resolver
-     * @param valueFactory
+     * @param propDef underlying propdef
+     * @param ntMgr nodetype manager
+     * @param resolver name-path resolver
+     * @param valueFactory value factory (for default values)
      */
     public PropertyDefinitionImpl(QPropertyDefinition propDef,
                                   AbstractNodeTypeManager ntMgr,
@@ -108,22 +108,22 @@
      * {@inheritDoc}
      */
     public String[] getValueConstraints() {
-        QPropertyDefinition pd = (QPropertyDefinition)itemDef;
-        String[] constraints = pd.getValueConstraints();
+        QPropertyDefinition pd = (QPropertyDefinition) itemDef;
+        QValueConstraint[] constraints = pd.getValueConstraints();
         if (constraints == null || constraints.length == 0) {
             return new String[0];
         }
-        try {
-            String[] vca = new String[constraints.length];
-            for (int i = 0; i < constraints.length; i++) {
-                ValueConstraint constr = ValueConstraint.create(pd.getRequiredType(), constraints[i]);
-                vca[i] = constr.getDefinition(resolver);
+        String[] vca = new String[constraints.length];
+        for (int i = 0; i < constraints.length; i++) {
+            try {
+                ValueConstraint vc = ValueConstraint.create(pd.getRequiredType(), constraints[i].getString());
+                vca[i] = vc.getDefinition(resolver);
+            } catch (InvalidConstraintException e) {
+                log.warn("Internal error during conversion of constraint.", e);
+                vca[i] = constraints[i].getString();
             }
-            return vca;
-        } catch (InvalidConstraintException e) {
-            log.error("Invalid value constraint: " + e.getMessage());
-            return null;
         }
+        return vca;
     }
 
     /**
@@ -137,18 +137,7 @@
      * @see javax.jcr.nodetype.PropertyDefinition#getAvailableQueryOperators()
      */
     public String[] getAvailableQueryOperators() {
-        Name[] names = ((QPropertyDefinition) itemDef).getAvailableQueryOperators();
-        String[] aqos = new String[names.length];
-        for (int i = 0; i < names.length; i++) {
-            try {
-                aqos[i] = resolver.getJCRName(names[i]);
-            } catch (NamespaceException e) {
-                // should not occure. fallback
-                log.warn(e.getMessage());
-                aqos[i] = names[i].toString();
-            }
-        }
-        return aqos;
+        return ((QPropertyDefinition) itemDef).getAvailableQueryOperators();
     }
 
     /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionTemplateImpl.java?rev=792142&r1=792141&r2=792142&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionTemplateImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/PropertyDefinitionTemplateImpl.java Wed Jul  8 13:57:13 2009
@@ -96,7 +96,7 @@
     /**
      * {@inheritDoc}
      */
-    public void setAvailablrQueryOperators(String[] operators) {
+    public void setAvailableQueryOperators(String[] operators) {
         queryOperators = operators;
     }
 
@@ -163,4 +163,5 @@
     public boolean isQueryOrderable() {
         return queryOrderable;
     }
+
 }



Mime
View raw message