jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r793613 [5/8] - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/cluster/ jackrabbit-core/src/main/java/org/apache/jackra...
Date Mon, 13 Jul 2009 15:56:03 GMT
Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SortedLuceneQueryHits.java Mon Jul 13 15:55:55 2009
@@ -21,7 +21,7 @@
 import org.apache.lucene.search.TopFieldDocCollector;
 import org.apache.lucene.search.ScoreDoc;
 import org.apache.lucene.index.IndexReader;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.uuid.UUID;
 import org.slf4j.LoggerFactory;
 import org.slf4j.Logger;
@@ -158,7 +158,7 @@
         ScoreDoc[] docs = collector.topDocs().scoreDocs;
         for (int i = scoreNodes.size(); i < docs.length; i++) {
             String uuid = reader.document(docs[i].doc).get(FieldNames.UUID);
-            NodeId id = new NodeId(UUID.fromString(uuid));
+            NodeId id = new NodeId(uuid);
             scoreNodes.add(new ScoreNode(id, docs[i].score, docs[i].doc));
         }
         log.debug("getHits() {}/{}", scoreNodes.size(), numHits);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/DescendantNodeConstraint.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/DescendantNodeConstraint.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/DescendantNodeConstraint.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/DescendantNodeConstraint.java Mon Jul 13 15:55:55 2009
@@ -26,7 +26,7 @@
 import org.apache.jackrabbit.core.query.lucene.ScoreNode;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 
 /**
  * <code>DescendantNodeConstraint</code> implements a descendant node

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/HierarchyConstraint.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/HierarchyConstraint.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/HierarchyConstraint.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/HierarchyConstraint.java Mon Jul 13 15:55:55 2009
@@ -19,7 +19,7 @@
 import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.spi.commons.query.qom.SelectorImpl;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.NodeImpl;
 
 /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java Mon Jul 13 15:55:55 2009
@@ -28,7 +28,7 @@
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
-import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.SessionImpl;
 
 /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/HoldImpl.java Mon Jul 13 15:55:55 2009
@@ -20,7 +20,7 @@
 import org.apache.jackrabbit.spi.NameFactory;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.PropertyImpl;
 import org.apache.jackrabbit.core.SessionImpl;
 import javax.jcr.retention.Hold;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionManagerImpl.java Mon Jul 13 15:55:55 2009
@@ -133,7 +133,7 @@
             PropertyImpl p = n.getProperty(REP_HOLD);
             Value[] vls = p.getValues();
 
-            List newValues = new ArrayList(vls.length - 1);
+            List<Value> newValues = new ArrayList<Value>(vls.length - 1);
             for (int i = 0; i < vls.length; i++) {
                 if (!hold.equals(HoldImpl.createFromValue(vls[i], n.getNodeId(), session))) {
                     newValues.add(vls[i]);
@@ -143,7 +143,7 @@
                 if (newValues.size() == 0) {
                     removeItem(p);
                 } else {
-                    setProperty(n, REP_HOLD, (Value[]) newValues.toArray(new Value[newValues.size()]));
+                    setProperty(n, REP_HOLD, newValues.toArray(new Value[newValues.size()]));
                 }
             } else {
                 // no matching hold.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionPolicyImpl.java Mon Jul 13 15:55:55 2009
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.retention;
 
 import javax.jcr.retention.RetentionPolicy;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
 import org.apache.jackrabbit.spi.commons.conversion.IllegalNameException;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/retention/RetentionRegistryImpl.java Mon Jul 13 15:55:55 2009
@@ -19,9 +19,9 @@
 import org.apache.commons.io.IOUtils;
 import javax.jcr.retention.Hold;
 import javax.jcr.retention.RetentionPolicy;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.NodeImpl;
-import org.apache.jackrabbit.core.PropertyId;
+import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.PropertyImpl;
 import org.apache.jackrabbit.core.SessionImpl;
 import org.apache.jackrabbit.core.fs.FileSystem;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessManager.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/AccessManager.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.security;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.security.authorization.AccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager;
 import org.apache.jackrabbit.spi.Name;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/DefaultAccessManager.java Mon Jul 13 15:55:55 2009
@@ -19,7 +19,7 @@
 import org.apache.jackrabbit.api.security.JackrabbitAccessControlPolicy;
 import org.apache.jackrabbit.commons.iterator.AccessControlPolicyIteratorAdapter;
 import org.apache.jackrabbit.core.HierarchyManager;
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.security.authorization.AccessControlEditor;
 import org.apache.jackrabbit.core.security.authorization.AccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.CompiledPermissions;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/SimpleJBossAccessManager.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.security;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.security.authorization.AccessControlProvider;
 import org.apache.jackrabbit.core.security.authorization.Permission;
 import org.apache.jackrabbit.core.security.authorization.WorkspaceAccessManager;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/AbstractLoginModule.java Mon Jul 13 15:55:55 2009
@@ -524,9 +524,7 @@
                 callbackHandler.handle(new Callback[]{callback});
                 Credentials creds = callback.getCredentials();
                 if (null != creds) {
-                    if (creds instanceof SimpleCredentials) {
-                       credentials = creds;
-                    } else if (creds instanceof GuestCredentials) {
+                    if (supportsCredentials(creds)) {
                        credentials = creds;
                     }
                     if (credentials != null) {
@@ -558,6 +556,20 @@
     }
 
     /**
+     * Return a flag indicating whether the credentials are supported by
+     * this login module. Default implementation supports
+     * {@link SimpleCredentials} and {@link GuestCredentials}.
+     *
+     * @param creds credentials
+     * @return <code>true</code> if the credentials are supported;
+     *         <code>false</code> otherwise
+     */
+    protected boolean supportsCredentials(Credentials creds) {
+        return creds instanceof SimpleCredentials ||
+            creds instanceof GuestCredentials;
+    }
+
+    /**
      * Method supports tries to acquire a UserID in the follwing order:
      * <ol>
      * <li>If passed credentials are {@link GuestCredentials} the anonymous user id

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/DefaultLoginModule.java Mon Jul 13 15:55:55 2009
@@ -48,7 +48,7 @@
 
     private static final Logger log = LoggerFactory.getLogger(AbstractLoginModule.class);
 
-    private User user;
+    protected User user;
     private UserManager userManager;
 
     /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AbstractCompiledPermissions.java Mon Jul 13 15:55:55 2009
@@ -60,7 +60,7 @@
     protected abstract Result buildResult(Path absPath) throws RepositoryException;
 
     /**
-     *
+     * Removes all entries from the cache.
      */
     protected void clearCache() {
         synchronized (cache) {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/AccessControlProvider.java Mon Jul 13 15:55:55 2009
@@ -24,6 +24,7 @@
 import javax.jcr.Session;
 import java.util.Map;
 import java.util.Set;
+import java.security.Principal;
 
 /**
  * The AccessControlProvider is used to provide access control policy and entry
@@ -116,7 +117,7 @@
      * specified set of principals.
      * @throws RepositoryException If an error occurs.
      */
-    CompiledPermissions compilePermissions(Set principals) throws RepositoryException;
+    CompiledPermissions compilePermissions(Set<Principal> principals) throws RepositoryException;
 
     /**
      * Returns <code>true</code> if the given set of principals can access the
@@ -130,5 +131,5 @@
      * <code>false</code> otherwise.
      * @throws RepositoryException If an error occurs.
      */
-    boolean canAccessRoot(Set principals) throws RepositoryException;
+    boolean canAccessRoot(Set<Principal> principals) throws RepositoryException;
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/acl/ACLProvider.java Mon Jul 13 15:55:55 2009
@@ -21,7 +21,7 @@
 import javax.jcr.security.AccessControlList;
 import javax.jcr.security.AccessControlManager;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.PropertyImpl;
 import org.apache.jackrabbit.core.ItemImpl;
@@ -183,7 +183,7 @@
     /**
      * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#compilePermissions(Set)
      */
-    public CompiledPermissions compilePermissions(Set principals) throws RepositoryException {
+    public CompiledPermissions compilePermissions(Set<Principal> principals) throws RepositoryException {
         checkInitialized();
         if (isAdminOrSystem(principals)) {
             return getAdminPermissions();
@@ -197,7 +197,7 @@
     /**
      * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#canAccessRoot(Set)
      */
-    public boolean canAccessRoot(Set principals) throws RepositoryException {
+    public boolean canAccessRoot(Set<Principal> principals) throws RepositoryException {
         checkInitialized();
         if (isAdminOrSystem(principals)) {
             return true;
@@ -338,14 +338,14 @@
          */
         private boolean readAllowed;
 
-        private AclPermissions(Set principals) throws RepositoryException {
+        private AclPermissions(Set<Principal> principals) throws RepositoryException {
             this(principals, true);
         }
 
-        private AclPermissions(Set principals, boolean listenToEvents) throws RepositoryException {
+        private AclPermissions(Set<Principal> principals, boolean listenToEvents) throws RepositoryException {
             principalNames = new ArrayList(principals.size());
-            for (Iterator it = principals.iterator(); it.hasNext();) {
-                principalNames.add(((Principal) it.next()).getName());
+            for (Principal princ : principals) {
+                principalNames.add(princ.getName());
             }
             jcrReadPrivilegeName = session.getAccessControlManager().privilegeFromName(Privilege.JCR_READ).getName();
 
@@ -382,8 +382,9 @@
          * this shortcut is not possible.
          *
          * @param principalnames
+         * @return true if read is allowed everywhere.
          */
-        private boolean isReadAllowed(Collection principalnames) {
+        private boolean isReadAllowed(Collection<String> principalnames) {
             boolean isReadAllowed = false;
             if (initializedWithDefaults) {
                 try {
@@ -478,7 +479,7 @@
             int parentAllows = PrivilegeRegistry.NO_PRIVILEGE;
             int parentDenies = PrivilegeRegistry.NO_PRIVILEGE;
 
-            while (entries.hasNext() && allows != privAll) {
+            while (entries.hasNext()) {
                 ACLTemplate.Entry ace = (ACLTemplate.Entry) entries.next();
                 // Determine if the ACE is defined on the node at absPath (locally):
                 // Except for READ-privileges the permissions must be determined
@@ -616,6 +617,11 @@
         }
     }
 
+    //--------------------------------------------------------------------------
+    /**
+     * Inner class used to collect ACEs for a given set of principals throughout
+     * the node hierarchy.
+     */
     private class Entries {
 
         private final ListOrderedMap principalNamesToEntries;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authorization/principalbased/ACLProvider.java Mon Jul 13 15:55:55 2009
@@ -202,7 +202,7 @@
     /**
      * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#compilePermissions(Set)
      */
-    public CompiledPermissions compilePermissions(Set principals) throws RepositoryException {
+    public CompiledPermissions compilePermissions(Set<Principal> principals) throws RepositoryException {
         checkInitialized();
         if (isAdminOrSystem(principals)) {
             return getAdminPermissions();
@@ -216,7 +216,7 @@
     /**
      * @see org.apache.jackrabbit.core.security.authorization.AccessControlProvider#canAccessRoot(Set)
      */
-    public boolean canAccessRoot(Set principals) throws RepositoryException {
+    public boolean canAccessRoot(Set<Principal> principals) throws RepositoryException {
         checkInitialized();
         if (isAdminOrSystem(principals)) {
             return true;
@@ -233,15 +233,15 @@
     private class CompiledPermissionImpl extends AbstractCompiledPermissions
             implements SynchronousEventListener {
 
-        private final Set principals;
-        private final Set acPaths;
-        private ACLProvider.Entries entries;
+        private final Set<Principal> principals;
+        private final Set<String> acPaths;
+        private List<AccessControlEntry> entries;
 
         /**
          * @param principals
          * @throws RepositoryException
          */
-        private CompiledPermissionImpl(Set principals) throws RepositoryException {
+        private CompiledPermissionImpl(Set<Principal> principals) throws RepositoryException {
             this(principals, true);
         }
 
@@ -249,7 +249,7 @@
          * @param principals
          * @throws RepositoryException
          */
-        private CompiledPermissionImpl(Set principals, boolean listenToEvents) throws RepositoryException {
+        private CompiledPermissionImpl(Set<Principal> principals, boolean listenToEvents) throws RepositoryException {
 
             this.principals = principals;
             acPaths = new HashSet(principals.size());
@@ -282,13 +282,69 @@
             Result result;
             if (session.itemExists(jcrPath)) {
                 Item item = session.getItem(jcrPath);
-                result = entries.getResult(item, item.getPath(), isAcItem);
+                result = getResult(item, item.getPath(), isAcItem);
             } else {
-                result = entries.getResult(null, jcrPath, isAcItem);
+                result = getResult(null, jcrPath, isAcItem);
             }
             return result;
         }
 
+
+        /**
+         * Loop over all entries and evaluate allows/denies for those matching
+         * the given jcrPath.
+         *
+         * @param target Existing target item for which the permissions will be
+         * evaluated or <code>null</code>.
+         * @param targetPath Path used for the evaluation; pointing to an
+         * existing or non-existing item.
+         * @param isAcItem
+         * @return
+         * @throws RepositoryException
+         */
+        private Result getResult(Item target,
+                                 String targetPath,
+                                 boolean isAcItem) throws RepositoryException {
+            int allows = Permission.NONE;
+            int denies = Permission.NONE;
+            int allowPrivileges = PrivilegeRegistry.NO_PRIVILEGE;
+            int denyPrivileges = PrivilegeRegistry.NO_PRIVILEGE;
+            int parentAllows = PrivilegeRegistry.NO_PRIVILEGE;
+            int parentDenies = PrivilegeRegistry.NO_PRIVILEGE;
+
+            String parentPath = Text.getRelativeParent(targetPath, 1);
+            for (AccessControlEntry entry : entries) {
+                if (!(entry instanceof ACLTemplate.Entry)) {
+                    log.warn("Unexpected AccessControlEntry instance -> ignore");
+                    continue;
+                }
+                ACLTemplate.Entry entr = (ACLTemplate.Entry) entry;
+                int privs = entr.getPrivilegeBits();
+
+                if (!"".equals(parentPath) && entr.matches(parentPath)) {
+                    if (entr.isAllow()) {
+                        parentAllows |= Permission.diff(privs, parentDenies);
+                    } else {
+                        parentDenies |= Permission.diff(privs, parentAllows);
+                    }
+                }
+
+                boolean matches = (target != null) ? entr.matches(target) : entr.matches(targetPath);
+                if (matches) {
+                    if (entr.isAllow()) {
+                        allowPrivileges |= Permission.diff(privs, denyPrivileges);
+                        int permissions = PrivilegeRegistry.calculatePermissions(allowPrivileges, parentAllows, true, isAcItem);
+                        allows |= Permission.diff(permissions, denies);
+                    } else {
+                        denyPrivileges |= Permission.diff(privs, allowPrivileges);
+                        int permissions = PrivilegeRegistry.calculatePermissions(denyPrivileges, parentDenies, false, isAcItem);
+                        denies |= Permission.diff(permissions, allows);
+                    }
+                }
+            }
+            return new Result(allows, denies, allowPrivileges, denyPrivileges);
+        }
+
         //--------------------------------------------< CompiledPermissions >---
         /**
          * @see CompiledPermissions#close()
@@ -348,14 +404,14 @@
          * @return
          * @throws RepositoryException
          */
-        private ACLProvider.Entries reload() throws RepositoryException {
+        private List<AccessControlEntry> reload() throws RepositoryException {
             // reload the paths
             acPaths.clear();
 
             // acNodes must be ordered in the same order as the principals
             // in order to obtain proper acl-evalution in case the given
             // principal-set is ordered.
-            List allACEs = new ArrayList();
+            List<AccessControlEntry> allACEs = new ArrayList<AccessControlEntry>();
             // build acl-hierarchy assuming that principal-order determines the
             // acl-inheritance.
             for (Iterator it = principals.iterator(); it.hasNext();) {
@@ -371,80 +427,12 @@
                 }
             }
 
-            return new ACLProvider.Entries(allACEs);
+            return allACEs;
         }
     }
 
     //--------------------------------------------------------------------------
     /**
-     * Utility class that raps a list of access control entries and evaluates
-     * them for a specified item/path.
-     */
-    private class Entries {
-
-        private final List entries;
-
-        /**
-         *
-         * @param entries
-         */
-        private Entries(List entries) {
-            this.entries = entries;
-        }
-
-        /**
-         * Loop over all entries and evaluate allows/denies for those matching
-         * the given jcrPath.
-         *
-         * @param target Existing target item for which the permissions will be
-         * evaluated or <code>null</code>.
-         * @param targetPath Path used for the evaluation; pointing to an
-         * existing or non-existing item.
-         * @param isAcItem
-         * @return
-         * @throws RepositoryException
-         */
-        private AbstractCompiledPermissions.Result getResult(Item target,
-                                                             String targetPath,
-                                                             boolean isAcItem) throws RepositoryException {
-            int allows = Permission.NONE;
-            int denies = Permission.NONE;
-            int allowPrivileges = PrivilegeRegistry.NO_PRIVILEGE;
-            int denyPrivileges = PrivilegeRegistry.NO_PRIVILEGE;
-            int parentAllows = PrivilegeRegistry.NO_PRIVILEGE;
-            int parentDenies = PrivilegeRegistry.NO_PRIVILEGE;
-
-            String parentPath = Text.getRelativeParent(targetPath, 1);
-            for (Iterator it = entries.iterator(); it.hasNext() && allows != Permission.ALL;) {
-                ACLTemplate.Entry entr = (ACLTemplate.Entry) it.next();
-                int privs = entr.getPrivilegeBits();
-
-                if (!"".equals(parentPath) && entr.matches(parentPath)) {
-                    if (entr.isAllow()) {
-                        parentAllows |= Permission.diff(privs, parentDenies);
-                    } else {
-                        parentDenies |= Permission.diff(privs, parentAllows);
-                    }
-                }
-
-                boolean matches = (target != null) ? entr.matches(target) : entr.matches(targetPath);
-                if (matches) {
-                    if (entr.isAllow()) {
-                        allowPrivileges |= Permission.diff(privs, denyPrivileges);
-                        int permissions = PrivilegeRegistry.calculatePermissions(allowPrivileges, parentAllows, true, isAcItem);
-                        allows |= Permission.diff(permissions, denies);
-                    } else {
-                        denyPrivileges |= Permission.diff(privs, allowPrivileges);
-                        int permissions = PrivilegeRegistry.calculatePermissions(denyPrivileges, parentDenies, false, isAcItem);
-                        denies |= Permission.diff(permissions, allows);
-                    }
-                }
-            }
-            return new AbstractCompiledPermissions.Result(allows, denies, allowPrivileges, denyPrivileges);
-        }
-    }
-
-    /**
      * Dummy effective policy 
      */
     private static final class EffectivePrincipalBasedPolicy implements AccessControlPolicy {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/ItemBasedPrincipal.java Mon Jul 13 15:55:55 2009
@@ -21,7 +21,7 @@
 /**
  * <code>ItemBasedPrincipal</code> is a <code>Principal</code> that is
  * persisted as item within the repository. In addition to the methods
- * inherited from the {@link Principal} interface it therefore provides
+ * inherited from the {@link java.security.Principal} interface it therefore provides
  * a {@link #getPath()} method.
  */
 public interface ItemBasedPrincipal extends JackrabbitPrincipal {

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/principal/PrincipalProvider.java Mon Jul 13 15:55:55 2009
@@ -28,7 +28,7 @@
  * sources for authorization and authentication, as may be used by a custom
  * {@link javax.security.auth.spi.LoginModule} for example.
  *
- * @see PrincipalManager for more details about principals, users and groups.
+ * @see org.apache.jackrabbit.api.security.principal.PrincipalManager for more details about principals, users and groups.
  */
 public interface PrincipalProvider {
 
@@ -56,9 +56,9 @@
      * @param simpleFilter
      * @param searchType searchType Any of the following constants:
      * <ul>
-     * <li>{@link PrincipalManager#SEARCH_TYPE_ALL}</li>
-     * <li>{@link PrincipalManager#SEARCH_TYPE_GROUP}</li>
-     * <li>{@link PrincipalManager#SEARCH_TYPE_NOT_GROUP}</li>
+     * <li>{@link org.apache.jackrabbit.api.security.principal.PrincipalManager#SEARCH_TYPE_ALL}</li>
+     * <li>{@link org.apache.jackrabbit.api.security.principal.PrincipalManager#SEARCH_TYPE_GROUP}</li>
+     * <li>{@link org.apache.jackrabbit.api.security.principal.PrincipalManager#SEARCH_TYPE_NOT_GROUP}</li>
      * </ul>
      * @return
      * @see #findPrincipals(String)
@@ -71,9 +71,9 @@
      * @return an iterator over all principals that match the given search type.
      * @param searchType searchType Any of the following constants:
      * <ul>
-     * <li>{@link PrincipalManager#SEARCH_TYPE_ALL}</li>
-     * <li>{@link PrincipalManager#SEARCH_TYPE_GROUP}</li>
-     * <li>{@link PrincipalManager#SEARCH_TYPE_NOT_GROUP}</li>
+     * <li>{@link org.apache.jackrabbit.api.security.principal.PrincipalManager#SEARCH_TYPE_ALL}</li>
+     * <li>{@link org.apache.jackrabbit.api.security.principal.PrincipalManager#SEARCH_TYPE_GROUP}</li>
+     * <li>{@link org.apache.jackrabbit.api.security.principal.PrincipalManager#SEARCH_TYPE_NOT_GROUP}</li>
      * </ul>
      */
     PrincipalIterator getPrincipals(int searchType);
@@ -81,7 +81,7 @@
     /**
      * Returns an iterator over all group principals for which the given
      * principal is either direct or indirect member of. If a principal is
-     * a direct member of a group, then <code>{@link Group#isMember(Principal)}</code>
+     * a direct member of a group, then <code>{@link java.security.acl.Group#isMember(Principal)}</code>
      * evaluates to <code>true</code>. A principal is an indirect member of a
      * group if any of its groups (to any degree of separation) is direct memeber
      * of the group.

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/simple/SimpleAccessManager.java Mon Jul 13 15:55:55 2009
@@ -19,7 +19,7 @@
 import javax.jcr.security.AccessControlPolicy;
 import javax.jcr.security.Privilege;
 import org.apache.jackrabbit.core.HierarchyManager;
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.security.AMContext;
 import org.apache.jackrabbit.core.security.AbstractAccessControlManager;
 import org.apache.jackrabbit.core.security.AccessManager;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/IndexNodeResolver.java Mon Jul 13 15:55:55 2009
@@ -95,7 +95,7 @@
      */
     private Query buildQuery(Name nodeName, Name ntName)
             throws RepositoryException {
-        StringBuffer stmt = new StringBuffer("/jcr:root");
+        StringBuilder stmt = new StringBuilder("/jcr:root");
         stmt.append(getSearchRoot(ntName));
         stmt.append("//element(");
         stmt.append(ISO9075.encode(getNamePathResolver().getJCRName(nodeName)));
@@ -118,7 +118,7 @@
     private Query buildQuery(String value, Set props, Name ntName,
                              boolean exact, long maxSize)
             throws RepositoryException {
-        StringBuffer stmt = new StringBuffer("/jcr:root");
+        StringBuilder stmt = new StringBuilder("/jcr:root");
         stmt.append(getSearchRoot(ntName));
         stmt.append("//element(*,");
         stmt.append(getNamePathResolver().getJCRName(ntName));
@@ -133,9 +133,15 @@
                 stmt.append((exact) ? "@" : "jcr:like(@");
                 String pName = getNamePathResolver().getJCRName((Name) itr.next());
                 stmt.append(ISO9075.encode(pName));
-                stmt.append((exact) ? "='" : ",'%");
-                stmt.append(value);
-                stmt.append((exact) ? "'" : "%')");
+                if (exact) {
+                    stmt.append("='");
+                    stmt.append(value);
+                    stmt.append("'");
+                } else {
+                    stmt.append(",'%");
+                    stmt.append(escapeForQuery(value));
+                    stmt.append("%')");
+                }
                 if (++i < props.size()) {
                     stmt.append(" or ");
                 }
@@ -146,4 +152,19 @@
         q.setLimit(maxSize);
         return q;
     }
+
+    private static String escapeForQuery(String value) {
+        StringBuilder ret = new StringBuilder();
+        for (int i = 0; i < value.length(); i++) {
+            char c = value.charAt(i);
+            if (c == '\\') {
+                ret.append("\\\\");
+            } else if (c == '\'') {
+                ret.append("\\'");
+            } else {
+                ret.append(c);
+            }
+        }
+        return ret.toString();
+    }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserImpl.java Mon Jul 13 15:55:55 2009
@@ -34,35 +34,20 @@
 /**
  * UserImpl
  */
-class UserImpl extends AuthorizableImpl implements User {
+public class UserImpl extends AuthorizableImpl implements User {
 
     private final String id;
 
     private Principal principal;
     private Impersonation impersonation;
 
-    private UserImpl(NodeImpl node, UserManagerImpl userManager) throws RepositoryException {
+    protected UserImpl(NodeImpl node, UserManagerImpl userManager) throws RepositoryException {
         super(node, userManager);
 
         id = node.getProperty(P_USERID).getString();
     }
 
     //--------------------------------------------------------------------------
-    /**
-     * @param node
-     * @param userManager
-     * @return
-     * @throws RepositoryException
-     */
-    static User create(NodeImpl node, UserManagerImpl userManager) throws RepositoryException {
-        if (node == null || !node.isNodeType(NT_REP_USER)) {
-            throw new IllegalArgumentException();
-        }
-        if (!Text.isDescendant(USERS_PATH, node.getPath())) {
-            throw new IllegalArgumentException("User has to be within the User Path");
-        }
-        return new UserImpl(node, userManager);
-    }
 
     /**
      *

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/user/UserManagerImpl.java Mon Jul 13 15:55:55 2009
@@ -207,7 +207,7 @@
             throw new IllegalArgumentException("Cannot create user: null password.");
         }
         if (!isValidPrincipal(principal)) {
-            throw new IllegalArgumentException("Cannot create user: Principal may not be null and must have a valid name.");            
+            throw new IllegalArgumentException("Cannot create user: Principal may not be null and must have a valid name.");
         }
         if (getAuthorizable(userID) != null) {
             throw new AuthorizableExistsException("User for '" + userID + "' already exists");
@@ -362,12 +362,31 @@
      * @throws RepositoryException
      */
     User createUser(NodeImpl userNode) throws RepositoryException {
-        User user = UserImpl.create(userNode, this);
+        if (userNode == null || !userNode.isNodeType(NT_REP_USER)) {
+            throw new IllegalArgumentException();
+        }
+        if (!Text.isDescendant(USERS_PATH, userNode.getPath())) {
+            throw new IllegalArgumentException("User has to be within the User Path");
+        }
+        User user = doCreateUser(userNode);
         idPathMap.put(user.getID(), userNode.getPath());
         return user;
     }
 
     /**
+     * Build the user object from the given user node. May be overridden to
+     * return a custom implementation.
+     *
+     * @param node user node
+     * @return user object
+     * @throws RepositoryException if an error occurs
+     */
+    protected User doCreateUser(NodeImpl node) throws RepositoryException {
+        return new UserImpl(node, this);
+    }
+
+
+    /**
      * Build the Group object from the given group node.
      *
      * @param groupNode
@@ -464,7 +483,7 @@
     private static boolean isValidPrincipal(Principal principal) {
         return principal != null && principal.getName() != null && principal.getName().length() > 0;
     }
-    
+
     private static String getParentPath(String hint, String root) {
         StringBuffer b = new StringBuffer();
         if (hint == null || !hint.startsWith(root)) {
@@ -520,7 +539,7 @@
     }
 
     /**
-     * @see SessionListener#loggedOut(org.apache.jackrabbit.core.SessionImpl) 
+     * @see SessionListener#loggedOut(org.apache.jackrabbit.core.SessionImpl)
      */
     public void loggedOut(SessionImpl session) {
         // clear the map

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java Mon Jul 13 15:55:55 2009
@@ -16,12 +16,13 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.commons.collections.map.LinkedMap;
-import org.apache.jackrabbit.core.ItemId;
-
-import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.commons.collections.map.LinkedMap;
+import org.apache.jackrabbit.core.id.ItemId;
+import org.apache.jackrabbit.core.id.NodeId;
+import org.apache.jackrabbit.core.version.VersionItemStateManager;
+
 /**
  * Registers changes made to states and references and consolidates
  * empty changes.
@@ -50,7 +51,7 @@
      * Modified references
      */
     @SuppressWarnings("unchecked")
-    private final Map<NodeReferencesId, NodeReferences> modifiedRefs = (Map<NodeReferencesId, NodeReferences>) new LinkedMap();
+    private final Map<NodeId, NodeReferences> modifiedRefs = (Map<NodeId, NodeReferences>) new LinkedMap();
 
     /**
      * Checks whether this change log contains any changes. This method is
@@ -113,7 +114,18 @@
      * @param refs refs that has been modified
      */
     public void modified(NodeReferences refs) {
-        modifiedRefs.put(refs.getId(), refs);
+        modifiedRefs.put(refs.id, refs);
+    }
+
+    /**
+     * Removes the references entry with the given target node id.
+     * This method is called by {@link VersionItemStateManager} to drop
+     * references to virtual nodes.
+     *
+     * @param targetId target node id
+     */
+    public void removeReferencesEntry(NodeId targetId) {
+        modifiedRefs.remove(targetId);
     }
 
     /**
@@ -172,50 +184,59 @@
     }
 
     /**
-     * Return a node references object given its id. Returns
+     * Return a node references object given the target node id. Returns
      * <code>null</code> if the node reference is not in the modified
      * section.
      *
      * @return node references or <code>null</code>
      */
-    public NodeReferences get(NodeReferencesId id) {
+    public NodeReferences getReferencesTo(NodeId id) {
         return modifiedRefs.get(id);
     }
 
     /**
-     * Return an iterator over all added states.
+     * Return the added states in this change log.
      *
-     * @return iterator over all added states.
+     * @return added states
      */
-    public Iterator<ItemState> addedStates() {
-        return addedStates.values().iterator();
+    public Iterable<ItemState> addedStates() {
+        return addedStates.values();
     }
 
     /**
-     * Return an iterator over all modified states.
+     * Return the modified states in this change log.
+     * <p>
+     * Note that this change log must not be modified while iterating
+     * through the returned states.
      *
-     * @return iterator over all modified states.
+     * @return modified states
      */
-    public Iterator<ItemState> modifiedStates() {
-        return modifiedStates.values().iterator();
+    public Iterable<ItemState> modifiedStates() {
+        return modifiedStates.values();
     }
 
     /**
-     * Return an iterator over all deleted states.
+     * Return the deleted states in this change log.
+     * <p>
+     * Note that this change log must not be modified while iterating
+     * through the returned states.
      *
-     * @return iterator over all deleted states.
+     * @return deleted states
      */
-    public Iterator<ItemState> deletedStates() {
-        return deletedStates.values().iterator();
+    public Iterable<ItemState> deletedStates() {
+        return deletedStates.values();
     }
 
     /**
-     * Return an iterator over all modified references.
+     * Return the modified references in this change log.
+     * <p>
+     * Note that this change log must not be modified while iterating
+     * through the returned states.
      *
-     * @return iterator over all modified references.
+     * @return modified references
      */
-    public Iterator<NodeReferences> modifiedRefs() {
-        return modifiedRefs.values().iterator();
+    public Iterable<NodeReferences> modifiedRefs() {
+        return modifiedRefs.values();
     }
 
     /**
@@ -225,9 +246,7 @@
      */
     public void merge(ChangeLog other) {
         // Remove all states from our 'added' set that have now been deleted
-        Iterator<ItemState> iter = other.deletedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : other.deletedStates()) {
             if (addedStates.remove(state.getId()) == null) {
                 deletedStates.put(state.getId(), state);
             }
@@ -236,9 +255,7 @@
         }
 
         // only add modified states that are not already 'added'
-        iter = other.modifiedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : other.modifiedStates()) {
             if (!addedStates.containsKey(state.getId())) {
                 modifiedStates.put(state.getId(), state);
             } else {
@@ -249,9 +266,7 @@
         }
 
         // add 'added' state, but respect previously deleted
-        iter = other.addedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : other.addedStates()) {
             ItemState deletedState = deletedStates.remove(state.getId());
             if (deletedState != null) {
                 // the newly 'added' state had previously been deleted;
@@ -275,17 +290,14 @@
      * items we have.
      */
     public void push() {
-        Iterator<ItemState> iter = modifiedStates();
-        while (iter.hasNext()) {
-            iter.next().push();
-        }
-        iter = deletedStates();
-        while (iter.hasNext()) {
-            iter.next().push();
-        }
-        iter = addedStates();
-        while (iter.hasNext()) {
-            iter.next().push();
+        for (ItemState state : modifiedStates()) {
+            state.push();
+        }
+        for (ItemState state : deletedStates()) {
+            state.push();
+        }
+        for (ItemState state : addedStates()) {
+            state.push();
         }
     }
 
@@ -294,22 +306,16 @@
      * internal states and notify listeners.
      */
     public void persisted() {
-        Iterator<ItemState> iter = modifiedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : modifiedStates()) {
             state.setStatus(ItemState.STATUS_EXISTING);
             state.notifyStateUpdated();
         }
-        iter = deletedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : deletedStates()) {
             state.setStatus(ItemState.STATUS_EXISTING_REMOVED);
             state.notifyStateDestroyed();
             state.discard();
         }
-        iter = addedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : addedStates()) {
             state.setStatus(ItemState.STATUS_EXISTING);
             state.notifyStateCreated();
         }
@@ -331,17 +337,14 @@
      * states.
      */
     public void disconnect() {
-        Iterator<ItemState> iter = modifiedStates();
-        while (iter.hasNext()) {
-            iter.next().disconnect();
-        }
-        iter = deletedStates();
-        while (iter.hasNext()) {
-            iter.next().disconnect();
-        }
-        iter = addedStates();
-        while (iter.hasNext()) {
-            iter.next().disconnect();
+        for (ItemState state : modifiedStates()) {
+            state.disconnect();
+        }
+        for (ItemState state : deletedStates()) {
+            state.disconnect();
+        }
+        for (ItemState state : addedStates()) {
+            state.disconnect();
         }
     }
 
@@ -353,9 +356,7 @@
      * @param parent parent manager that will hold current data
      */
     public void undo(ItemStateManager parent) {
-        Iterator<ItemState> iter = modifiedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : modifiedStates()) {
             try {
                 state.connect(parent.getItemState(state.getId()));
                 state.pull();
@@ -363,9 +364,7 @@
                 state.discard();
             }
         }
-        iter = deletedStates();
-        while (iter.hasNext()) {
-            ItemState state = iter.next();
+        for (ItemState state : deletedStates()) {
             try {
                 state.connect(parent.getItemState(state.getId()));
                 state.pull();
@@ -373,9 +372,8 @@
                 state.discard();
             }
         }
-        iter = addedStates();
-        while (iter.hasNext()) {
-            iter.next().discard();
+        for (ItemState state : addedStates()) {
+            state.discard();
         }
         reset();
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntries.java Mon Jul 13 15:55:55 2009
@@ -19,7 +19,7 @@
 import org.apache.commons.collections.map.LinkedMap;
 import org.apache.commons.collections.MapIterator;
 import org.apache.commons.collections.OrderedMapIterator;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.util.EmptyLinkedMap;
 import org.apache.jackrabbit.spi.Name;
 
@@ -52,7 +52,7 @@
      * Map used for lookup by name
      * (key=name, value=either a single entry or a list of sns entries)
      */
-    private Map nameMap;
+    private Map<Name, Object> nameMap;
 
     /**
      * Indicates whether the entries and nameMap are shared with another
@@ -73,7 +73,7 @@
         if (obj == null) {
             return Collections.emptyList();
         }
-        if (obj instanceof ArrayList) {
+        if (obj instanceof ArrayList<?>) {
             // map entry is a list of siblings
             return Collections.unmodifiableList((ArrayList<ChildNodeEntry>) obj);
         } else {
@@ -91,11 +91,11 @@
         if (obj == null) {
             return null;
         }
-        if (obj instanceof ArrayList) {
+        if (obj instanceof ArrayList<?>) {
             // map entry is a list of siblings
-            ArrayList siblings = (ArrayList) obj;
+            ArrayList<ChildNodeEntry> siblings = (ArrayList<ChildNodeEntry>) obj;
             if (index <= siblings.size()) {
-                return (ChildNodeEntry) siblings.get(index - 1);
+                return siblings.get(index - 1);
             }
         } else {
             // map entry is a single child node entry
@@ -108,13 +108,13 @@
 
     ChildNodeEntry add(Name nodeName, NodeId id) {
         ensureModifiable();
-        List siblings = null;
+        List<Object> siblings = null;
         int index = 0;
         Object obj = nameMap.get(nodeName);
         if (obj != null) {
-            if (obj instanceof ArrayList) {
+            if (obj instanceof ArrayList<?>) {
                 // map entry is a list of siblings
-                siblings = (ArrayList) obj;
+                siblings = (ArrayList<Object>) obj;
                 if (siblings.size() > 0) {
                     // reuse immutable Name instance from 1st same name sibling
                     // in order to help gc conserving memory
@@ -123,7 +123,7 @@
             } else {
                 // map entry is a single child node entry,
                 // convert to siblings list
-                siblings = new ArrayList();
+                siblings = new ArrayList<Object>();
                 siblings.add(obj);
                 nameMap.put(nodeName, siblings);
             }
@@ -143,10 +143,8 @@
         return entry;
     }
 
-    void addAll(List entriesList) {
-        Iterator iter = entriesList.iterator();
-        while (iter.hasNext()) {
-            ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+    void addAll(List<ChildNodeEntry> entriesList) {
+        for (ChildNodeEntry entry : entriesList) {
             // delegate to add(Name, String) to maintain consistency
             add(entry.getName(), entry.getId());
         }
@@ -175,19 +173,19 @@
         }
 
         // map entry is a list of siblings
-        List siblings = (ArrayList) obj;
+        List<ChildNodeEntry> siblings = (ArrayList<ChildNodeEntry>) obj;
         if (index > siblings.size()) {
             return null;
         }
 
         // remove from siblings list
-        ChildNodeEntry removedEntry = (ChildNodeEntry) siblings.remove(index - 1);
+        ChildNodeEntry removedEntry = siblings.remove(index - 1);
         // remove from ordered entries map
         entries.remove(removedEntry.getId());
 
         // update indices of subsequent same-name siblings
         for (int i = index - 1; i < siblings.size(); i++) {
-            ChildNodeEntry oldEntry = (ChildNodeEntry) siblings.get(i);
+            ChildNodeEntry oldEntry = siblings.get(i);
             ChildNodeEntry newEntry = new ChildNodeEntry(nodeName, oldEntry.getId(), oldEntry.getIndex() - 1);
             // overwrite old entry with updated entry in siblings list
             siblings.set(i, newEntry);
@@ -262,10 +260,8 @@
             return this;
         }
 
-        List result = new ArrayList();
-        Iterator iter = iterator();
-        while (iter.hasNext()) {
-            ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+        List<ChildNodeEntry> result = new ArrayList<ChildNodeEntry>();
+        for (ChildNodeEntry entry : this) {
             ChildNodeEntry otherEntry = other.get(entry.getId());
             if (entry == otherEntry) {
                 continue;
@@ -275,7 +271,6 @@
                 result.add(entry);
             }
         }
-
         return result;
     }
 
@@ -298,10 +293,8 @@
             return Collections.emptyList();
         }
 
-        List result = new ArrayList();
-        Iterator iter = iterator();
-        while (iter.hasNext()) {
-            ChildNodeEntry entry = (ChildNodeEntry) iter.next();
+        List<ChildNodeEntry> result = new ArrayList<ChildNodeEntry>();
+        for (ChildNodeEntry entry : this) {
             ChildNodeEntry otherEntry = other.get(entry.getId());
             if (entry == otherEntry) {
                 result.add(entry);
@@ -310,7 +303,6 @@
                 result.add(entry);
             }
         }
-
         return result;
     }
 
@@ -358,15 +350,15 @@
         return new EntriesIterator();
     }
 
-    public ListIterator listIterator() {
+    public ListIterator<ChildNodeEntry> listIterator() {
         return new EntriesIterator();
     }
 
-    public ListIterator listIterator(int index) {
+    public ListIterator<ChildNodeEntry> listIterator(int index) {
         if (index < 0 || index >= entries.size()) {
             throw new IndexOutOfBoundsException();
         }
-        ListIterator iter = new EntriesIterator();
+        ListIterator<ChildNodeEntry> iter = new EntriesIterator();
         while (index-- > 0) {
             iter.next();
         }
@@ -377,9 +369,9 @@
         return entries.size();
     }
 
-    public List subList(int fromIndex, int toIndex) {
+    public List<ChildNodeEntry> subList(int fromIndex, int toIndex) {
         // @todo FIXME does not fulfill the contract of List.subList(int,int)
-        return Collections.unmodifiableList(new ArrayList(this).subList(fromIndex, toIndex));
+        return Collections.unmodifiableList(new ArrayList<ChildNodeEntry>(this).subList(fromIndex, toIndex));
     }
 
     public Object[] toArray() {
@@ -511,11 +503,11 @@
      */
     private void ensureModifiable() {
         if (nameMap == Collections.EMPTY_MAP) {
-            nameMap = new HashMap();
+            nameMap = new HashMap<Name, Object>();
             entries = new LinkedMap();
         } else if (shared) {
             entries = (LinkedMap) entries.clone();
-            nameMap = (Map) ((HashMap) nameMap).clone();
+            nameMap = (Map<Name, Object>) ((HashMap<Name, Object>) nameMap).clone();
             for (Iterator it = nameMap.entrySet().iterator(); it.hasNext(); ) {
                 Map.Entry entry = (Map.Entry) it.next();
                 Object value = entry.getValue();
@@ -528,7 +520,7 @@
     }
 
     //--------------------------------------------------------< inner classes >
-    class EntriesIterator implements ListIterator {
+    class EntriesIterator implements ListIterator<ChildNodeEntry> {
 
         private final OrderedMapIterator mapIter;
 
@@ -540,9 +532,9 @@
             return mapIter.hasNext();
         }
 
-        public Object next() {
+        public ChildNodeEntry next() {
             mapIter.next();
-            return mapIter.getValue();
+            return (ChildNodeEntry) mapIter.getValue();
         }
 
         public boolean hasPrevious() {
@@ -553,16 +545,16 @@
             return entries.indexOf(mapIter.getKey()) + 1;
         }
 
-        public Object previous() {
+        public ChildNodeEntry previous() {
             mapIter.previous();
-            return mapIter.getValue();
+            return (ChildNodeEntry) mapIter.getValue();
         }
 
         public int previousIndex() {
             return entries.indexOf(mapIter.getKey()) - 1;
         }
 
-        public void add(Object o) {
+        public void add(ChildNodeEntry o) {
             throw new UnsupportedOperationException();
         }
 
@@ -570,7 +562,7 @@
             throw new UnsupportedOperationException();
         }
 
-        public void set(Object o) {
+        public void set(ChildNodeEntry o) {
             throw new UnsupportedOperationException();
         }
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntry.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntry.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChildNodeEntry.java Mon Jul 13 15:55:55 2009
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.state;
 
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 
 /**
  * <code>ChildNodeEntry</code> specifies the name, index (in the case of

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/DefaultISMLocking.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/DefaultISMLocking.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/DefaultISMLocking.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/DefaultISMLocking.java Mon Jul 13 15:55:55 2009
@@ -18,7 +18,7 @@
 
 import javax.transaction.xa.Xid;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.TransactionContext;
 
 import EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java Mon Jul 13 15:55:55 2009
@@ -16,21 +16,20 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
-import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.core.PropertyId;
-import org.apache.jackrabbit.uuid.UUID;
-
-import java.util.Map;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.List;
 import java.util.LinkedList;
-import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.jackrabbit.core.id.ItemId;
+import org.apache.jackrabbit.core.id.NodeId;
+import org.apache.jackrabbit.core.id.PropertyId;
 
+import EDU.oswego.cs.dl.util.concurrent.Latch;
 import EDU.oswego.cs.dl.util.concurrent.ReadWriteLock;
 import EDU.oswego.cs.dl.util.concurrent.Sync;
-import EDU.oswego.cs.dl.util.concurrent.Latch;
 import EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock;
 
 /**
@@ -239,7 +238,7 @@
     private static boolean hasDependency(ChangeLog changeLog, ItemId id) {
         try {
             if (changeLog.get(id) == null) {
-                if (!id.denotesNode() || changeLog.get(new NodeReferencesId((NodeId) id)) == null) {
+                if (!id.denotesNode() || changeLog.getReferencesTo((NodeId) id) == null) {
                     // change log does not contain the item
                     return false;
                 }
@@ -384,13 +383,13 @@
         }
 
         private static int slotIndex(ItemId id) {
-            UUID uuid;
+            NodeId nodeId;
             if (id.denotesNode()) {
-                uuid = ((NodeId) id).getUUID();
+                nodeId = (NodeId) id;
             } else {
-                uuid = ((PropertyId) id).getParentId().getUUID();
+                nodeId = ((PropertyId) id).getParentId();
             }
-            return ((int) uuid.getLeastSignificantBits()) & 0xf;
+            return ((int) nodeId.getLeastSignificantBits()) & 0xf;
         }
     }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ISMLocking.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 
 /**
  * <code>ISMLocking</code> defines an interface for a locking strategy of an

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemState.java Mon Jul 13 15:55:55 2009
@@ -16,8 +16,8 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.ItemId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateCache.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateCache.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateCache.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 
 /**
  * An <code>ItemStateCache</code> maintains a cache of <code>ItemState</code>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,8 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
+import org.apache.jackrabbit.core.id.NodeId;
 
 /**
  * The <code>ItemStateManager</code> interface provides methods for retrieving
@@ -50,7 +51,7 @@
      * @throws NoSuchItemStateException if the item does not exist
      * @throws ItemStateException if an error occurs
      */
-    NodeReferences getNodeReferences(NodeReferencesId id)
+    NodeReferences getNodeReferences(NodeId id)
         throws NoSuchItemStateException, ItemStateException;
 
     /**
@@ -60,5 +61,5 @@
      * @return <code>true</code> if a node reference object exists for the given
      *         id, otherwise <code>false</code>.
      */
-    boolean hasNodeReferences(NodeReferencesId id);
+    boolean hasNodeReferences(NodeId id);
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateMap.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateMap.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateMap.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.util.Dumpable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateReferenceCache.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.util.Dumpable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateStore.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateStore.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateStore.java Mon Jul 13 15:55:55 2009
@@ -16,7 +16,7 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 
 import java.util.Set;
 import java.util.Collection;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java Mon Jul 13 15:55:55 2009
@@ -16,14 +16,14 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
-import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.core.PropertyId;
+import javax.jcr.ReferentialIntegrityException;
+
+import org.apache.jackrabbit.core.id.ItemId;
+import org.apache.jackrabbit.core.id.NodeId;
+import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.observation.EventStateCollectionFactory;
 import org.apache.jackrabbit.spi.Name;
 
-import javax.jcr.ReferentialIntegrityException;
-
 /**
  * Local <code>ItemStateManager</code> that isolates changes to
  * persistent states from other clients.
@@ -205,11 +205,11 @@
     /**
      * {@inheritDoc}
      */
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
         // check change log
-        NodeReferences refs = changeLog.get(id);
+        NodeReferences refs = changeLog.getReferencesTo(id);
         if (refs != null) {
             return refs;
         }
@@ -219,9 +219,9 @@
     /**
      * {@inheritDoc}
      */
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    public boolean hasNodeReferences(NodeId id) {
         // check change log
-        if (changeLog.get(id) != null) {
+        if (changeLog.getReferencesTo(id) != null) {
             return true;
         }
         return sharedStateMgr.hasNodeReferences(id);

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/MLRUItemStateCache.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/MLRUItemStateCache.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/MLRUItemStateCache.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/MLRUItemStateCache.java Mon Jul 13 15:55:55 2009
@@ -19,7 +19,7 @@
 import java.util.Iterator;
 
 import org.apache.commons.collections.map.LinkedMap;
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java Mon Jul 13 15:55:55 2009
@@ -16,14 +16,14 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.PropertyId;
-import org.apache.jackrabbit.core.NodeId;
-
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
+import org.apache.jackrabbit.core.id.NodeId;
+import org.apache.jackrabbit.core.id.PropertyId;
+
 /**
  * <code>NodeReferences</code> represents the references (i.e. properties of
  * type <code>REFERENCE</code>) to a particular node (denoted by its uuid).
@@ -36,9 +36,9 @@
     static final long serialVersionUID = 7007727035982680717L;
 
     /**
-     * identifier of this <code>NodeReferences</code> instance.
+     * Identifier of the target node.
      */
-    protected NodeReferencesId id;
+    protected NodeId id;
 
     /**
      * list of PropertyId's (i.e. the id's of the properties that refer to
@@ -50,31 +50,17 @@
      */
     protected ArrayList<PropertyId> references = new ArrayList<PropertyId>();
 
-    /**
-     * Package private constructor
-     *
-     * @param id
-     */
-    public NodeReferences(NodeReferencesId id) {
+    public NodeReferences(NodeId id) {
         this.id = id;
     }
 
     /**
-     * Returns the identifier of this node references object.
-     *
-     * @return the id of this node references object.
-     */
-    public NodeReferencesId getId() {
-        return id;
-    }
-
-    /**
      * Returns the identifier of the target node.
      *
      * @return the id of the target node
      */
     public NodeId getTargetId() {
-        return id.getTargetId();
+        return id;
     }
 
     /**
@@ -123,4 +109,11 @@
     public void clearAllReferences() {
         references.clear();
     }
+
+    //--------------------------------------------------------------< Object >
+
+    public String toString() {
+        return "references to " + id;
+    }
+
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeState.java Mon Jul 13 15:55:55 2009
@@ -16,8 +16,8 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.ItemId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.spi.Name;
 

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateListener.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateListener.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateListener.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateListener.java Mon Jul 13 15:55:55 2009
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.state;
 
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.NodeId;
 
 /**
  * Extends the <code>ItemStateListener</code> allowing a client to be

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeStateMerger.java Mon Jul 13 15:55:55 2009
@@ -16,9 +16,9 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.ItemId;
-import org.apache.jackrabbit.core.PropertyId;
-import org.apache.jackrabbit.core.NodeId;
+import org.apache.jackrabbit.core.id.ItemId;
+import org.apache.jackrabbit.core.id.PropertyId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.spi.Name;
 
 import java.util.ArrayList;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java?rev=793613&r1=793612&r2=793613&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/PropertyState.java Mon Jul 13 15:55:55 2009
@@ -16,9 +16,9 @@
  */
 package org.apache.jackrabbit.core.state;
 
-import org.apache.jackrabbit.core.PropertyId;
-import org.apache.jackrabbit.core.NodeId;
-import org.apache.jackrabbit.core.ItemId;
+import org.apache.jackrabbit.core.id.PropertyId;
+import org.apache.jackrabbit.core.id.NodeId;
+import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.nodetype.PropDefId;
 import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.jackrabbit.spi.Name;



Mime
View raw message