jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r793243 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/ main/java/org/apache/jackrabbit/core/id/ main/java/org/apache/jackrabbit/core/observation/ main/java/org/apache/jackrabbit/core/persistence/ main/java...
Date Sat, 11 Jul 2009 23:47:16 GMT
Author: jukka
Date: Sat Jul 11 23:47:15 2009
New Revision: 793243

URL: http://svn.apache.org/viewvc?rev=793243&view=rev
Log:
JCR-2206: Replace NodeReferencesId with NodeId

Removed:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeReferencesId.java
Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ChangeLogBasedHierarchyMgr.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/AbstractPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/Oracle9PersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/CachingHierarchyManagerTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/BatchedItemOperations.java Sat Jul 11 23:47:15 2009
@@ -37,7 +37,6 @@
 
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.lock.LockManager;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
@@ -66,7 +65,6 @@
 import org.apache.jackrabbit.spi.commons.conversion.MalformedPathException;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
-import org.apache.jackrabbit.uuid.UUID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -919,10 +917,10 @@
         if ((options & CHECK_REFERENCES) == CHECK_REFERENCES) {
             EffectiveNodeType ent = getEffectiveNodeType(targetState);
             if (ent.includesNodeType(NameConstants.MIX_REFERENCEABLE)) {
-                NodeReferencesId refsId = new NodeReferencesId(targetState.getNodeId());
-                if (stateMgr.hasNodeReferences(refsId)) {
+                NodeId targetId = targetState.getNodeId();
+                if (stateMgr.hasNodeReferences(targetId)) {
                     try {
-                        NodeReferences refs = stateMgr.getNodeReferences(refsId);
+                        NodeReferences refs = stateMgr.getNodeReferences(targetId);
                         if (refs.hasReferences()) {
                             throw new ReferentialIntegrityException(safeGetJCRPath(targetPath)
                                     + ": cannot remove node with references");

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java Sat Jul 11 23:47:15 2009
@@ -70,7 +70,6 @@
 import org.apache.jackrabbit.commons.iterator.PropertyIteratorAdapter;
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
 import org.apache.jackrabbit.core.nodetype.ItemDef;
@@ -4661,9 +4660,8 @@
         sanityCheck();
 
         try {
-            NodeReferencesId targetId = new NodeReferencesId((NodeId) id);
-            if (stateMgr.hasNodeReferences(targetId)) {
-                NodeReferences refs = stateMgr.getNodeReferences(targetId);
+            if (stateMgr.hasNodeReferences(getNodeId())) {
+                NodeReferences refs = stateMgr.getNodeReferences(getNodeId());
                 // refs.getReferences() returns a list of PropertyId's
                 List<PropertyId> idList = refs.getReferences();
                 if (name != null) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ChangeLogBasedHierarchyMgr.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ChangeLogBasedHierarchyMgr.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ChangeLogBasedHierarchyMgr.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ChangeLogBasedHierarchyMgr.java Sat Jul 11 23:47:15 2009
@@ -27,7 +27,6 @@
 import org.apache.jackrabbit.core.state.ItemStateManager;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.spi.Path;
 import org.apache.jackrabbit.spi.Name;
 
@@ -168,7 +167,7 @@
         /**
          * Always throws a {@link UnsupportedOperationException}.
          */
-        public NodeReferences getNodeReferences(NodeReferencesId id)
+        public NodeReferences getNodeReferences(NodeId id)
                 throws NoSuchItemStateException, ItemStateException {
             throw new UnsupportedOperationException();
         }
@@ -176,7 +175,7 @@
         /**
          * {@inheritDoc}
          */
-        public boolean hasNodeReferences(NodeReferencesId id) {
+        public boolean hasNodeReferences(NodeId id) {
             return false;
         }
     }
@@ -238,7 +237,7 @@
         /**
          * Always throws a {@link UnsupportedOperationException}.
          */
-        public NodeReferences getNodeReferences(NodeReferencesId id)
+        public NodeReferences getNodeReferences(NodeId id)
                 throws NoSuchItemStateException, ItemStateException {
             throw new UnsupportedOperationException();
         }
@@ -246,7 +245,7 @@
         /**
          * {@inheritDoc}
          */
-        public boolean hasNodeReferences(NodeReferencesId id) {
+        public boolean hasNodeReferences(NodeId id) {
             return false;
         }
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/AbstractPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/AbstractPersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/AbstractPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/AbstractPersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -80,7 +80,7 @@
             if (refs.hasReferences()) {
                 store(refs);
             } else {
-                if (exists(refs.getId())) {
+                if (existsReferencesTo(refs.getTargetId())) {
                     destroy(refs);
                 }
             }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceCopier.java Sat Jul 11 23:47:15 2009
@@ -25,7 +25,6 @@
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.spi.Name;
@@ -142,11 +141,11 @@
         }
 
         // Copy all node references
-        NodeReferencesId refsId = new NodeReferencesId(sourceNode.getNodeId());
-        if (source.exists(refsId)) {
-            changes.modified(source.load(refsId));
-        } else if (target.exists(refsId)) {
-            NodeReferences references = target.load(refsId);
+        if (source.existsReferencesTo(sourceNode.getNodeId())) {
+            changes.modified(source.loadReferencesTo(sourceNode.getNodeId()));
+        } else if (target.existsReferencesTo(sourceNode.getNodeId())) {
+            NodeReferences references =
+                target.loadReferencesTo(sourceNode.getNodeId());
             references.clearAllReferences();
             changes.modified(references);
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/PersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -23,7 +23,6 @@
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.ChangeLog;
 
 /**
@@ -132,13 +131,13 @@
             throws NoSuchItemStateException, ItemStateException;
 
     /**
-     * Load the persistent members of a node references object.
+     * Load the persisted references to the node with the given identifier.
      *
      * @param id reference target node id
      * @throws NoSuchItemStateException if the target node does not exist
      * @throws ItemStateException if another error occurs
      */
-    NodeReferences load(NodeReferencesId id)
+    NodeReferences loadReferencesTo(NodeId id)
             throws NoSuchItemStateException, ItemStateException;
 
     /**
@@ -169,7 +168,7 @@
      *         <code>false</code> otherwise
      * @throws ItemStateException on persistence manager errors
      */
-    boolean exists(NodeReferencesId targetId) throws ItemStateException;
+    boolean existsReferencesTo(NodeId targetId) throws ItemStateException;
 
     /**
      * Atomically saves the given set of changes.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/AbstractBundlePersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -25,7 +25,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.id.ItemId;
@@ -237,12 +236,12 @@
      * @param id the id of the node
      * @return the buffer with the appended data.
      */
-    protected StringBuffer buildNodeReferencesFilePath(StringBuffer buf,
-                                                       NodeReferencesId id) {
+    protected StringBuffer buildNodeReferencesFilePath(
+            StringBuffer buf, NodeId id) {
         if (buf == null) {
             buf = new StringBuffer();
         }
-        buildNodeFolderPath(buf, id.getTargetId());
+        buildNodeFolderPath(buf, id);
         buf.append(FileSystem.SEPARATOR);
         buf.append(NODEREFSFILENAME);
         return buf;
@@ -363,12 +362,6 @@
             throws ItemStateException;
 
     /**
-     * {@inheritDoc}
-     */
-    public abstract NodeReferences load(NodeReferencesId targetId)
-            throws NoSuchItemStateException, ItemStateException;
-
-    /**
      * Deletes the node references from the underlying system.
      *
      * @param refs the node references to destroy.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleDbPersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -59,7 +59,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.util.Text;
 import org.apache.jackrabbit.uuid.UUID;
 import org.slf4j.Logger;
@@ -1234,7 +1233,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized NodeReferences load(NodeReferencesId targetId)
+    public synchronized NodeReferences loadReferencesTo(NodeId targetId)
             throws NoSuchItemStateException, ItemStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
@@ -1244,7 +1243,7 @@
         InputStream in = null;
         try {
             Statement stmt = connectionManager.executeStmt(
-                    nodeReferenceSelectSQL, getKey(targetId.getTargetId()));
+                    nodeReferenceSelectSQL, getKey(targetId));
             rs = stmt.getResultSet();
             if (!rs.next()) {
                 throw new NoSuchItemStateException(targetId.toString());
@@ -1283,7 +1282,7 @@
         }
 
         // check if insert or update
-        boolean update = exists(refs.getId());
+        boolean update = existsReferencesTo(refs.getTargetId());
         String sql = (update) ? nodeReferenceUpdateSQL : nodeReferenceInsertSQL;
 
         try {
@@ -1298,7 +1297,7 @@
             // there's no need to close a ByteArrayOutputStream
             //out.close();
         } catch (Exception e) {
-            String msg = "failed to write node references: " + refs.getId();
+            String msg = "failed to write " + refs;
             log.error(msg, e);
             throw new ItemStateException(msg, e);
         }
@@ -1319,7 +1318,7 @@
             if (e instanceof NoSuchItemStateException) {
                 throw (NoSuchItemStateException) e;
             }
-            String msg = "failed to delete references: " + refs.getTargetId();
+            String msg = "failed to delete " + refs;
             log.error(msg, e);
             throw new ItemStateException(msg, e);
         }
@@ -1328,15 +1327,15 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized boolean exists(NodeReferencesId targetId) throws ItemStateException {
+    public synchronized boolean existsReferencesTo(NodeId targetId) throws ItemStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
         }
 
         ResultSet rs = null;
         try {
-            Statement stmt = connectionManager.executeStmt(nodeReferenceSelectSQL,
-                    getKey(targetId.getTargetId()));
+            Statement stmt = connectionManager.executeStmt(
+                    nodeReferenceSelectSQL, getKey(targetId));
             rs = stmt.getResultSet();
 
             // a reference exists if the result has at least one entry

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -34,7 +34,6 @@
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.state.ItemStateException;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
 
@@ -296,12 +295,12 @@
      * @param id the id of the node
      * @return the buffer with the appended data.
      */
-    protected StringBuffer buildNodeReferencesFilePath(StringBuffer buf,
-                                                       NodeReferencesId id) {
+    protected StringBuffer buildNodeReferencesFilePath(
+            StringBuffer buf, NodeId id) {
         if (buf == null) {
             buf = new StringBuffer();
         }
-        buildNodeFolderPath(buf, id.getTargetId());
+        buildNodeFolderPath(buf, id);
         buf.append('.');
         buf.append(NODEREFSFILENAME);
         return buf;
@@ -351,7 +350,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized NodeReferences load(NodeReferencesId targetId)
+    public synchronized NodeReferences loadReferencesTo(NodeId targetId)
             throws NoSuchItemStateException, ItemStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
@@ -399,7 +398,7 @@
             Serializer.serialize(refs, out);
             out.close();
         } catch (Exception e) {
-            String msg = "failed to write property state: " + refs.getTargetId();
+            String msg = "failed to write " + refs;
             BundleFsPersistenceManager.log.error(msg, e);
             throw new ItemStateException(msg, e);
         }
@@ -413,13 +412,13 @@
             throw new IllegalStateException("not initialized");
         }
         try {
-            StringBuffer buf = buildNodeReferencesFilePath(null, refs.getId());
+            StringBuffer buf = buildNodeReferencesFilePath(null, refs.getTargetId());
             itemFs.deleteFile(buf.toString());
         } catch (Exception e) {
             if (e instanceof NoSuchItemStateException) {
                 throw (NoSuchItemStateException) e;
             }
-            String msg = "failed to delete references: " + refs.getTargetId();
+            String msg = "failed to delete " + refs;
             BundleFsPersistenceManager.log.error(msg, e);
             throw new ItemStateException(msg, e);
         }
@@ -428,7 +427,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized boolean exists(NodeReferencesId targetId) throws ItemStateException {
+    public synchronized boolean existsReferencesTo(NodeId targetId) throws ItemStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/Oracle9PersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/Oracle9PersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/Oracle9PersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/Oracle9PersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -144,7 +144,7 @@
         Blob blob = null;
         try {
             // check if insert or update
-            boolean update = exists(refs.getId());
+            boolean update = existsReferencesTo(refs.getTargetId());
             String sql = (update) ? nodeReferenceUpdateSQL : nodeReferenceInsertSQL;
 
             ByteArrayOutputStream out = new ByteArrayOutputStream(INITIAL_BUFFER_SIZE);
@@ -161,7 +161,7 @@
             // there's no need to close a ByteArrayOutputStream
             //out.close();
         } catch (Exception e) {
-            String msg = "failed to write property state: " + refs.getTargetId();
+            String msg = "failed to write " + refs;
             log.error(msg, e);
             throw new ItemStateException(msg, e);
         } finally {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/util/ItemStateBinding.java Sat Jul 11 23:47:15 2009
@@ -18,8 +18,6 @@
 
 import org.apache.jackrabbit.core.persistence.util.BLOBStore;
 import org.apache.jackrabbit.core.persistence.PersistenceManager;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
-import org.apache.jackrabbit.core.state.NodeReferences;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
 import org.apache.jackrabbit.core.util.StringIndex;
@@ -28,7 +26,6 @@
 import org.apache.jackrabbit.core.data.DataStore;
 import org.apache.jackrabbit.core.nodetype.NodeDefId;
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 
 import java.io.DataInputStream;
@@ -139,46 +136,6 @@
     }
 
     /**
-     * Deserializes a <code>NodeReferences</code> from the data input stream.
-     *
-     * @param in the input stream
-     * @param id the id of the nodereference to deserialize
-     * @param pMgr the persistence manager
-     * @return the node references
-     * @throws IOException in an I/O error occurs.
-     */
-    public NodeReferences readState(DataInputStream in, NodeReferencesId id,
-                                    PersistenceManager pMgr)
-            throws IOException {
-        NodeReferences state = new NodeReferences(id);
-        int count = in.readInt();   // count & version
-        // int version = (count >> 24) | 0x0ff;
-        count &= 0x00ffffff;
-        for (int i = 0; i < count; i++) {
-            state.addReference(readPropertyId(in));    // propertyId
-        }
-        return state;
-    }
-
-    /**
-     * Serializes a <code>NodeReferences</code> to the data output stream.
-     *
-     * @param out the output stream
-     * @param state the state to write.
-     * @throws IOException in an I/O error occurs.
-     */
-    public void writeState(DataOutputStream out, NodeReferences state)
-            throws IOException {
-        // references
-        Collection<PropertyId> c = state.getReferences();
-        out.writeInt(c.size() | (VERSION_CURRENT << 24)); // count
-        for (Iterator<PropertyId> iter = c.iterator(); iter.hasNext();) {
-            PropertyId propId = iter.next();
-            writePropertyId(out, propId);
-        }
-    }
-
-    /**
      * Deserializes a <code>NodeState</code> from the data input stream.
      *
      * @param in the input streaam

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/DatabasePersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -31,7 +31,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.value.InternalValue;
@@ -560,7 +559,7 @@
     /**
      * {@inheritDoc}
      */
-    public NodeReferences load(NodeReferencesId targetId)
+    public NodeReferences loadReferencesTo(NodeId targetId)
             throws NoSuchItemStateException, ItemStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
@@ -612,7 +611,7 @@
         }
 
         // check if insert or update
-        boolean update = exists(refs.getId());
+        boolean update = existsReferencesTo(refs.getTargetId());
         String sql = (update) ? nodeReferenceUpdateSQL : nodeReferenceInsertSQL;
 
         try {
@@ -623,12 +622,12 @@
 
             // we are synchronized on this instance, therefore we do not
             // not have to additionally synchronize on the sql statement
-            executeStmt(sql, new Object[]{out.toByteArray(), refs.getId().toString()});
+            executeStmt(sql, new Object[]{out.toByteArray(), refs.getTargetId().toString()});
 
             // there's no need to close a ByteArrayOutputStream
             //out.close();
         } catch (Exception e) {
-            String msg = "failed to write node references: " + refs.getId();
+            String msg = "failed to write " + refs;
             log.error(msg, e);
             throw new ItemStateException(msg, e);
         }
@@ -646,9 +645,9 @@
         try {
             // we are synchronized on this instance, therefore we do not
             // not have to additionally synchronize on the sql statement
-            executeStmt(nodeReferenceDeleteSQL, new Object[]{refs.getId().toString()});
+            executeStmt(nodeReferenceDeleteSQL, new Object[]{refs.getTargetId().toString()});
         } catch (Exception e) {
-            String msg = "failed to delete node references: " + refs.getId();
+            String msg = "failed to delete " + refs;
             log.error(msg, e);
             throw new ItemStateException(msg, e);
         }
@@ -710,7 +709,7 @@
     /**
      * {@inheritDoc}
      */
-    public boolean exists(NodeReferencesId targetId) throws ItemStateException {
+    public boolean existsReferencesTo(NodeId targetId) throws ItemStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/db/OraclePersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -252,7 +252,7 @@
         }
 
         // check if insert or update
-        boolean update = exists(refs.getId());
+        boolean update = existsReferencesTo(refs.getTargetId());
         String sql = (update) ? nodeReferenceUpdateSQL : nodeReferenceInsertSQL;
 
         Blob blob = null;
@@ -265,12 +265,12 @@
             // we are synchronized on this instance, therefore we do not
             // not have to additionally synchronize on the sql statement
             blob = createTemporaryBlob(new ByteArrayInputStream(out.toByteArray()));
-            executeStmt(sql, new Object[]{blob, refs.getId().toString()});
+            executeStmt(sql, new Object[]{blob, refs.getTargetId().toString()});
 
             // there's no need to close a ByteArrayOutputStream
             //out.close();
         } catch (Exception e) {
-            String msg = "failed to write node references: " + refs.getId();
+            String msg = "failed to write " + refs;
             log.error(msg, e);
             throw new ItemStateException(msg, e);
         } finally {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemPersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -29,7 +29,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.persistence.util.FileSystemBLOBStore;
@@ -72,7 +71,7 @@
     protected boolean initialized;
 
     protected Map<ItemId, byte[]> stateStore;
-    protected Map<NodeReferencesId, byte[]> refsStore;
+    protected Map<NodeId, byte[]> refsStore;
 
     // initial size of buffer used to serialize objects
     protected static final int INITIAL_BUFFER_SIZE = 1024;
@@ -214,7 +213,7 @@
             int n = in.readInt();   // number of entries
             while (n-- > 0) {
                 String s = in.readUTF();    // target id
-                NodeReferencesId id = NodeReferencesId.valueOf(s);
+                NodeId id = NodeId.valueOf(s);
                 int length = in.readInt();  // data length
                 byte[] data = new byte[length];
                 in.readFully(data);  // data
@@ -266,7 +265,7 @@
         try {
             out.writeInt(refsStore.size()); // number of entries
             // entries
-            for (NodeReferencesId id : refsStore.keySet()) {
+            for (NodeId id : refsStore.keySet()) {
                 out.writeUTF(id.toString());    // target id
                 byte[] data = refsStore.get(id);
                 out.writeInt(data.length);  // data length
@@ -287,7 +286,7 @@
         }
 
         stateStore = new HashMap<ItemId, byte[]>(initialCapacity, loadFactor);
-        refsStore = new HashMap<NodeReferencesId, byte[]>(initialCapacity, loadFactor);
+        refsStore = new HashMap<NodeId, byte[]>(initialCapacity, loadFactor);
 
         wspFS = context.getFileSystem();
 
@@ -492,7 +491,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized NodeReferences load(NodeReferencesId id)
+    public synchronized NodeReferences loadReferencesTo(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
         if (!initialized) {
@@ -531,11 +530,11 @@
             Serializer.serialize(refs, out);
 
             // store in serialized format in map for better memory efficiency
-            refsStore.put(refs.getId(), out.toByteArray());
+            refsStore.put(refs.getTargetId(), out.toByteArray());
             // there's no need to close a ByteArrayOutputStream
             //out.close();
         } catch (Exception e) {
-            String msg = "failed to store references: " + refs.getId();
+            String msg = "failed to store " + refs;
             log.debug(msg);
             throw new ItemStateException(msg, e);
         }
@@ -550,7 +549,7 @@
         }
 
         // remove node references
-        refsStore.remove(refs.getId());
+        refsStore.remove(refs.getTargetId());
     }
 
     /**
@@ -576,7 +575,7 @@
     /**
      * {@inheritDoc}
      */
-    public boolean exists(NodeReferencesId id) throws ItemStateException {
+    public boolean existsReferencesTo(NodeId id) throws ItemStateException {
         if (!initialized) {
             throw new IllegalStateException("not initialized");
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/obj/ObjectPersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -31,7 +31,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.value.InternalValue;
@@ -124,8 +123,8 @@
         return buildNodeFolderPath(id) + FileSystem.SEPARATOR + NODEFILENAME;
     }
 
-    private static String buildNodeReferencesFilePath(NodeReferencesId id) {
-        return buildNodeFolderPath(id.getTargetId()) + FileSystem.SEPARATOR + NODEREFSFILENAME;
+    private static String buildNodeReferencesFilePath(NodeId id) {
+        return buildNodeFolderPath(id) + FileSystem.SEPARATOR + NODEREFSFILENAME;
     }
 
     //---------------------------------------------------< PersistenceManager >
@@ -259,7 +258,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized NodeReferences load(NodeReferencesId id)
+    public synchronized NodeReferences loadReferencesTo(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
         if (!initialized) {
@@ -355,7 +354,7 @@
             throw new IllegalStateException("not initialized");
         }
 
-        String refsFilePath = buildNodeReferencesFilePath(refs.getId());
+        String refsFilePath = buildNodeReferencesFilePath(refs.getTargetId());
         FileSystemResource refsFile = new FileSystemResource(itemStateFS, refsFilePath);
         try {
             refsFile.makeParentDirs();
@@ -366,7 +365,7 @@
                 out.close();
             }
         } catch (Exception e) {
-            String msg = "failed to store references: " + refs.getId();
+            String msg = "failed to store " + refs;
             log.debug(msg);
             throw new ItemStateException(msg, e);
         }
@@ -435,7 +434,7 @@
             throw new IllegalStateException("not initialized");
         }
 
-        String refsFilePath = buildNodeReferencesFilePath(refs.getId());
+        String refsFilePath = buildNodeReferencesFilePath(refs.getTargetId());
         FileSystemResource refsFile = new FileSystemResource(itemStateFS, refsFilePath);
         try {
             if (refsFile.exists()) {
@@ -443,7 +442,7 @@
                 refsFile.delete(true);
             }
         } catch (FileSystemException fse) {
-            String msg = "failed to delete node references: " + refs.getId();
+            String msg = "failed to delete " + refs;
             log.debug(msg);
             throw new ItemStateException(msg, fse);
         }
@@ -490,7 +489,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized boolean exists(NodeReferencesId id)
+    public synchronized boolean existsReferencesTo(NodeId id)
             throws ItemStateException {
 
         if (!initialized) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/xml/XMLPersistenceManager.java Sat Jul 11 23:47:15 2009
@@ -30,7 +30,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.persistence.PMContext;
 import org.apache.jackrabbit.core.state.PropertyState;
@@ -210,8 +209,8 @@
         return buildNodeFolderPath(id) + "/" + NODEFILENAME;
     }
 
-    private String buildNodeReferencesFilePath(NodeReferencesId id) {
-        return buildNodeFolderPath(id.getTargetId()) + "/" + NODEREFSFILENAME;
+    private String buildNodeReferencesFilePath(NodeId id) {
+        return buildNodeFolderPath(id) + "/" + NODEREFSFILENAME;
     }
 
     private void readState(DOMWalker walker, NodeState state)
@@ -395,7 +394,7 @@
             throw new ItemStateException(msg);
         }
         // check targetId
-        if (!refs.getId().equals(NodeReferencesId.valueOf(walker.getAttribute(TARGETID_ATTRIBUTE)))) {
+        if (!refs.getTargetId().equals(NodeId.valueOf(walker.getAttribute(TARGETID_ATTRIBUTE)))) {
             String msg = "invalid serialized state: targetId  mismatch";
             log.debug(msg);
             throw new ItemStateException(msg);
@@ -780,7 +779,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized NodeReferences load(NodeReferencesId id)
+    public synchronized NodeReferences loadReferencesTo(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
         if (!initialized) {
@@ -824,8 +823,7 @@
             throw new IllegalStateException("not initialized");
         }
 
-        NodeReferencesId id = refs.getId();
-        String refsFilePath = buildNodeReferencesFilePath(id);
+        String refsFilePath = buildNodeReferencesFilePath(refs.getTargetId());
         FileSystemResource refsFile = new FileSystemResource(itemStateFS, refsFilePath);
         try {
             refsFile.makeParentDirs();
@@ -843,7 +841,7 @@
                 }
                 writer.write("<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>\n");
                 writer.write("<" + NODEREFERENCES_ELEMENT + " "
-                        + TARGETID_ATTRIBUTE + "=\"" + refs.getId() + "\">\n");
+                        + TARGETID_ATTRIBUTE + "=\"" + refs.getTargetId() + "\">\n");
                 // write references (i.e. the id's of the REFERENCE properties)
                 Iterator iter = refs.getReferences().iterator();
                 while (iter.hasNext()) {
@@ -856,7 +854,7 @@
                 writer.close();
             }
         } catch (Exception e) {
-            String msg = "failed to store references: " + id;
+            String msg = "failed to store " + refs;
             log.debug(msg);
             throw new ItemStateException(msg, e);
         }
@@ -870,8 +868,7 @@
             throw new IllegalStateException("not initialized");
         }
 
-        NodeReferencesId id = refs.getId();
-        String refsFilePath = buildNodeReferencesFilePath(id);
+        String refsFilePath = buildNodeReferencesFilePath(refs.getTargetId());
         FileSystemResource refsFile = new FileSystemResource(itemStateFS, refsFilePath);
         try {
             if (refsFile.exists()) {
@@ -879,7 +876,7 @@
                 refsFile.delete(true);
             }
         } catch (FileSystemException fse) {
-            String msg = "failed to delete references: " + id;
+            String msg = "failed to delete " + refs;
             log.debug(msg);
             throw new ItemStateException(msg, fse);
         }
@@ -926,7 +923,7 @@
     /**
      * {@inheritDoc}
      */
-    public synchronized boolean exists(NodeReferencesId id)
+    public synchronized boolean existsReferencesTo(NodeId id)
             throws ItemStateException {
 
         if (!initialized) {

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ChangeLog.java Sat Jul 11 23:47:15 2009
@@ -20,7 +20,7 @@
 
 import org.apache.commons.collections.map.LinkedMap;
 import org.apache.jackrabbit.core.id.ItemId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
+import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.version.VersionItemStateManager;
 
 /**
@@ -51,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
@@ -114,7 +114,7 @@
      * @param refs refs that has been modified
      */
     public void modified(NodeReferences refs) {
-        modifiedRefs.put(refs.getId(), refs);
+        modifiedRefs.put(refs.id, refs);
     }
 
     /**
@@ -124,7 +124,7 @@
      *
      * @param targetId target node id
      */
-    public void removeReferencesEntry(NodeReferencesId targetId) {
+    public void removeReferencesEntry(NodeId targetId) {
         modifiedRefs.remove(targetId);
     }
 
@@ -184,13 +184,13 @@
     }
 
     /**
-     * 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);
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java Sat Jul 11 23:47:15 2009
@@ -25,7 +25,6 @@
 
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 
 import EDU.oswego.cs.dl.util.concurrent.Latch;
@@ -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;
                 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ItemStateManager.java Sat Jul 11 23:47:15 2009
@@ -17,7 +17,7 @@
 package org.apache.jackrabbit.core.state;
 
 import org.apache.jackrabbit.core.id.ItemId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
+import org.apache.jackrabbit.core.id.NodeId;
 
 /**
  * The <code>ItemStateManager</code> interface provides methods for retrieving
@@ -51,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;
 
     /**
@@ -61,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/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/LocalItemStateManager.java Sat Jul 11 23:47:15 2009
@@ -20,7 +20,6 @@
 
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.observation.EventStateCollectionFactory;
 import org.apache.jackrabbit.spi.Name;
@@ -206,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;
         }
@@ -220,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/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/NodeReferences.java Sat Jul 11 23:47:15 2009
@@ -22,7 +22,6 @@
 import java.util.List;
 
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 
 /**
@@ -37,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
@@ -51,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;
     }
 
     /**
@@ -124,4 +109,11 @@
     public void clearAllReferences() {
         references.clear();
     }
+
+    //--------------------------------------------------------------< Object >
+
+    public String toString() {
+        return "references to " + id;
+    }
+
 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SessionItemStateManager.java Sat Jul 11 23:47:15 2009
@@ -34,7 +34,6 @@
 import org.apache.jackrabbit.core.ZombieHierarchyManager;
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeRegistry;
@@ -206,7 +205,7 @@
     /**
      * {@inheritDoc}
      */
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
         return stateMgr.getNodeReferences(id);
@@ -215,7 +214,7 @@
     /**
      * {@inheritDoc}
      */
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    public boolean hasNodeReferences(NodeId id) {
         return stateMgr.hasNodeReferences(id);
     }
 
@@ -997,7 +996,7 @@
         /**
          * {@inheritDoc}
          */
-        public NodeReferences getNodeReferences(NodeReferencesId id)
+        public NodeReferences getNodeReferences(NodeId id)
                 throws NoSuchItemStateException, ItemStateException {
             // n/a
             throw new ItemStateException("getNodeReferences() not implemented");
@@ -1006,7 +1005,7 @@
         /**
          * {@inheritDoc}
          */
-        public boolean hasNodeReferences(NodeReferencesId id) {
+        public boolean hasNodeReferences(NodeId id) {
             // n/a
             return false;
         }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/SharedItemStateManager.java Sat Jul 11 23:47:15 2009
@@ -31,7 +31,6 @@
 import org.apache.jackrabbit.core.cluster.UpdateEventChannel;
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.nodetype.EffectiveNodeType;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
@@ -314,13 +313,13 @@
     /**
      * {@inheritDoc}
      */
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
-        ISMLocking.ReadLock readLock = acquireReadLock(id.getTargetId());
+        ISMLocking.ReadLock readLock = acquireReadLock(id);
         try {
             // check persistence manager
             try {
-                return persistMgr.load(id);
+                return persistMgr.loadReferencesTo(id);
             } catch (NoSuchItemStateException e) {
                 // ignore
             }
@@ -344,17 +343,17 @@
     /**
      * {@inheritDoc}
      */
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    public boolean hasNodeReferences(NodeId id) {
         ISMLocking.ReadLock readLock;
         try {
-            readLock = acquireReadLock(id.getTargetId());
+            readLock = acquireReadLock(id);
         } catch (ItemStateException e) {
             return false;
         }
         try {
             // check persistence manager
             try {
-                if (persistMgr.exists(id)) {
+                if (persistMgr.existsReferencesTo(id)) {
                     return true;
                 }
             } catch (ItemStateException e) {
@@ -669,7 +668,7 @@
                 // (see comment above)
                 for (NodeReferences refs : local.modifiedRefs()) {
                     boolean virtual = false;
-                    NodeId id = refs.getId().getTargetId();
+                    NodeId id = refs.getTargetId();
                     for (int i = 0; i < virtualProviders.length; i++) {
                         if (virtualProviders[i].hasItemState(id)) {
                             ChangeLog virtualRefs = virtualNodeReferences[i];
@@ -909,16 +908,15 @@
 
         private void addReference(PropertyId id, NodeId target)
                 throws ItemStateException {
-            NodeReferencesId refsId = new NodeReferencesId(target);
             if (virtualProvider == null
-                    || !virtualProvider.hasNodeReferences(refsId)) {
+                    || !virtualProvider.hasNodeReferences(target)) {
                 // get or create the references instance
-                NodeReferences refs = local.get(refsId);
+                NodeReferences refs = local.getReferencesTo(target);
                 if (refs == null) {
-                    if (hasNodeReferences(refsId)) {
-                        refs = getNodeReferences(refsId);
+                    if (hasNodeReferences(target)) {
+                        refs = getNodeReferences(target);
                     } else {
-                        refs = new NodeReferences(refsId);
+                        refs = new NodeReferences(target);
                     }
                 }
                 // add reference
@@ -944,14 +942,13 @@
 
         private void removeReference(PropertyId id, NodeId target)
                 throws ItemStateException {
-            NodeReferencesId refsId = new NodeReferencesId(target);
             if (virtualProvider == null
-                    || !virtualProvider.hasNodeReferences(refsId)) {
+                    || !virtualProvider.hasNodeReferences(target)) {
                 // either get node references from change log or load from
                 // persistence manager
-                NodeReferences refs = local.get(refsId);
-                if (refs == null && hasNodeReferences(refsId)) {
-                    refs = getNodeReferences(refsId);
+                NodeReferences refs = local.getReferencesTo(target);
+                if (refs == null && hasNodeReferences(target)) {
+                    refs = getNodeReferences(target);
                 }
                 if (refs != null) {
                     // remove reference
@@ -983,20 +980,20 @@
                 if (state.isNode()) {
                     NodeState node = (NodeState) state;
                     if (isReferenceable(node)) {
-                        NodeReferencesId refsId = new NodeReferencesId(node.getNodeId());
+                        NodeId targetId = node.getNodeId();
                         // either get node references from change log or
                         // load from persistence manager
-                        NodeReferences refs = local.get(refsId);
+                        NodeReferences refs = local.getReferencesTo(targetId);
                         if (refs == null) {
-                            if (!hasNodeReferences(refsId)) {
+                            if (!hasNodeReferences(targetId)) {
                                 continue;
                             }
-                            refs = getNodeReferences(refsId);
+                            refs = getNodeReferences(targetId);
                         }
                         // in some versioning operations (such as restore) a node
                         // may actually be deleted and then again added with the
                         // same UUID, i.e. the node is still referenceable.
-                        if (refs.hasReferences() && !local.has(node.getNodeId())) {
+                        if (refs.hasReferences() && !local.has(targetId)) {
                             String msg = node.getNodeId()
                                     + ": the node cannot be removed because it is still being referenced.";
                             log.debug(msg);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/XAItemStateManager.java Sat Jul 11 23:47:15 2009
@@ -31,7 +31,6 @@
 import org.apache.jackrabbit.core.TransactionException;
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.observation.EventStateCollectionFactory;
 import org.apache.jackrabbit.core.value.InternalValue;
@@ -311,7 +310,7 @@
      * check the transactional change log. Fallback is always the call to
      * the base class.
      */
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
         if (virtualProvider != null && virtualProvider.hasNodeReferences(id)) {
@@ -328,7 +327,7 @@
      * check the transactional change log. Fallback is always the call to
      * the base class.
      */
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    public boolean hasNodeReferences(NodeId id) {
         if (virtualProvider != null && virtualProvider.hasNodeReferences(id)) {
             return true;
         }
@@ -366,7 +365,7 @@
      * @throws ItemStateException if an error occurs while reading from the
      *                            underlying shared item state manager.
      */
-    private NodeReferences getReferences(NodeReferencesId id)
+    private NodeReferences getReferences(NodeId id)
             throws ItemStateException {
         NodeReferences refs;
         try {
@@ -377,12 +376,11 @@
         // apply changes from change log
         ChangeLog changes = getChangeLog();
         if (changes != null) {
-            NodeId target = id.getTargetId();
             // check removed reference properties
             for (PropertyState prop : filterReferenceProperties(changes.deletedStates())) {
                 InternalValue[] values = prop.getValues();
                 for (int i = 0; i < values.length; i++) {
-                    if (values[i].getNodeId().equals(target)) {
+                    if (values[i].getNodeId().equals(id)) {
                         refs.removeReference(prop.getPropertyId());
                         break;
                     }
@@ -392,7 +390,7 @@
             for (PropertyState prop : filterReferenceProperties(changes.addedStates())) {
                 InternalValue[] values = prop.getValues();
                 for (int i = 0; i < values.length; i++) {
-                    if (values[i].getNodeId().equals(target)) {
+                    if (values[i].getNodeId().equals(id)) {
                         refs.addReference(prop.getPropertyId());
                         break;
                     }
@@ -409,7 +407,7 @@
                         // remove if one of the old values references the node
                         InternalValue[] values = old.getValues();
                         for (int i = 0; i < values.length; i++) {
-                            if (values[i].getNodeId().equals(target)) {
+                            if (values[i].getNodeId().equals(id)) {
                                 refs.removeReference(old.getPropertyId());
                                 break;
                             }
@@ -424,7 +422,7 @@
                     // add if modified value references node
                     InternalValue[] values = prop.getValues();
                     for (int i = 0; i < values.length; i++) {
-                        if (values[i].getNodeId().equals(target)) {
+                        if (values[i].getNodeId().equals(id)) {
                             refs.addReference(prop.getPropertyId());
                             break;
                         }
@@ -479,7 +477,7 @@
                     for (int i = 0; vals != null && i < vals.length; i++) {
                         addVirtualReference(
                                 references, prop.getPropertyId(),
-                                new NodeReferencesId(vals[i].getNodeId()));
+                                vals[i].getNodeId());
                     }
                 }
             }
@@ -494,7 +492,7 @@
                     for (int i = 0; vals != null && i < vals.length; i++) {
                         removeVirtualReference(
                                 references, oldProp.getPropertyId(),
-                                new NodeReferencesId(vals[i].getNodeId()));
+                                vals[i].getNodeId());
                     }
                 }
                 if (newProp.getType() == PropertyType.REFERENCE) {
@@ -502,7 +500,7 @@
                     for (int i = 0; vals != null && i < vals.length; i++) {
                         addVirtualReference(
                                 references, newProp.getPropertyId(),
-                                new NodeReferencesId(vals[i].getNodeId()));
+                                vals[i].getNodeId());
                     }
                 }
             }
@@ -515,7 +513,7 @@
                     for (int i = 0; vals != null && i < vals.length; i++) {
                         removeVirtualReference(
                                 references, prop.getPropertyId(),
-                                new NodeReferencesId(vals[i].getNodeId()));
+                                vals[i].getNodeId());
                     }
                 }
             }
@@ -529,18 +527,18 @@
      * Ignored if <code>refsId.getTargetId()</code> does not denote a
      * virtual node.
      * @param sourceId property id
-     * @param refsId node references id
+     * @param targetId target node id
      */
     private void addVirtualReference(
-            ChangeLog references, PropertyId sourceId, NodeReferencesId refsId)
+            ChangeLog references, PropertyId sourceId, NodeId targetId)
             throws NoSuchItemStateException, ItemStateException {
 
-        NodeReferences refs = references.get(refsId);
+        NodeReferences refs = references.getReferencesTo(targetId);
         if (refs == null) {
-            refs = virtualProvider.getNodeReferences(refsId);
+            refs = virtualProvider.getNodeReferences(targetId);
         }
-        if (refs == null && virtualProvider.hasItemState(refsId.getTargetId())) {
-            refs = new NodeReferences(refsId);
+        if (refs == null && virtualProvider.hasItemState(targetId)) {
+            refs = new NodeReferences(targetId);
         }
         if (refs != null) {
             refs.addReference(sourceId);
@@ -553,18 +551,18 @@
      * Ignored if <code>refsId.getTargetId()</code> does not denote a
      * virtual node.
      * @param sourceId property id
-     * @param refsId node references id
+     * @param targetId target node id
      */
     private void removeVirtualReference(
-            ChangeLog references, PropertyId sourceId, NodeReferencesId refsId)
+            ChangeLog references, PropertyId sourceId, NodeId targetId)
             throws NoSuchItemStateException, ItemStateException {
 
-        NodeReferences refs = references.get(refsId);
+        NodeReferences refs = references.getReferencesTo(targetId);
         if (refs == null) {
-            refs = virtualProvider.getNodeReferences(refsId);
+            refs = virtualProvider.getNodeReferences(targetId);
         }
-        if (refs == null && virtualProvider.hasItemState(refsId.getTargetId())) {
-            refs = new NodeReferences(refsId);
+        if (refs == null && virtualProvider.hasItemState(targetId)) {
+            refs = new NodeReferences(targetId);
         }
         if (refs != null) {
             refs.removeReference(sourceId);

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/AbstractVersionManager.java Sat Jul 11 23:47:15 2009
@@ -32,12 +32,10 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.LocalItemStateManager;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.spi.Name;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
-import org.apache.jackrabbit.uuid.UUID;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -449,9 +447,8 @@
         try {
             // check if the activity has any references in the workspaces
             NodeId nodeId = activity.getId();
-            NodeReferencesId refId = new NodeReferencesId(nodeId);
-            if (stateMgr.hasNodeReferences(refId)) {
-                NodeReferences refs = stateMgr.getNodeReferences(refId);
+            if (stateMgr.hasNodeReferences(nodeId)) {
+                NodeReferences refs = stateMgr.getNodeReferences(nodeId);
                 if (refs.hasReferences()) {
                     throw new ReferentialIntegrityException("Unable to delete activity. still referenced.");
                 }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateManager.java Sat Jul 11 23:47:15 2009
@@ -31,7 +31,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -62,11 +61,12 @@
         this.pMgr = persistMgr;
     }
 
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    @Override
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
         // check persistence manager
         try {
-            return pMgr.load(id);
+            return pMgr.loadReferencesTo(id);
         } catch (NoSuchItemStateException e) {
             // ignore
         }
@@ -74,10 +74,11 @@
         throw new NoSuchItemStateException(id.toString());
     }
 
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    @Override
+    public boolean hasNodeReferences(NodeId id) {
         // check persistence manager
         try {
-            if (pMgr.exists(id)) {
+            if (pMgr.existsReferencesTo(id)) {
                 return true;
             }
         } catch (ItemStateException e) {
@@ -97,7 +98,7 @@
 
             for (NodeReferences source : references.modifiedRefs()) {
                 // filter out version storage intern ones
-                NodeReferences target = new NodeReferences(source.getId());
+                NodeReferences target = new NodeReferences(source.getTargetId());
                 for (PropertyId id : source.getReferences()) {
                     if (!hasNonVirtualItemState(id.getParentId())) {
                         target.addReference(id);
@@ -121,18 +122,18 @@
         // only store VV-type references and NV-type references
 
         // check whether targets of modified node references exist
-        Set<NodeReferencesId> remove = new HashSet<NodeReferencesId>();
+        Set<NodeId> remove = new HashSet<NodeId>();
         for (NodeReferences refs : changes.modifiedRefs()) {
             // no need to check existence of target if there are no references
             if (refs.hasReferences()) {
                 NodeId id = refs.getTargetId();
                 if (!changes.has(id) && !hasNonVirtualItemState(id)) {
-                    remove.add(refs.getId());
+                    remove.add(refs.getTargetId());
                 }
             }
         }
         // remove references
-        for (NodeReferencesId id : remove) {
+        for (NodeId id : remove) {
             changes.removeReferencesEntry(id);
         }
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionItemStateProvider.java Sat Jul 11 23:47:15 2009
@@ -27,7 +27,6 @@
 import org.apache.jackrabbit.core.state.ItemStateListener;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.virtual.VirtualItemStateProvider;
 import org.apache.jackrabbit.core.virtual.VirtualNodeState;
 import org.apache.jackrabbit.core.virtual.VirtualPropertyState;
@@ -130,7 +129,7 @@
     /**
      * @inheritDoc
      */
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
         return stateMgr.getNodeReferences(id);
     }
@@ -138,7 +137,7 @@
     /**
      * @inheritDoc
      */
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    public boolean hasNodeReferences(NodeId id) {
         return stateMgr.hasNodeReferences(id);
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/VersionManagerImpl.java Sat Jul 11 23:47:15 2009
@@ -50,7 +50,6 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.ItemStateListener;
 import org.apache.jackrabbit.core.state.LocalItemStateManager;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.SharedItemStateManager;
@@ -370,10 +369,9 @@
             // we're currently leverage the fact, that only references to "real"
             // workspaces are recorded.
             NodeId nodeId = activity.getNodeId();
-            NodeReferencesId refId = new NodeReferencesId(nodeId);
-            if (stateMgr.hasNodeReferences(refId)) {
+            if (stateMgr.hasNodeReferences(nodeId)) {
                 try {
-                    NodeReferences refs = stateMgr.getNodeReferences(refId);
+                    NodeReferences refs = stateMgr.getNodeReferences(nodeId);
                     if (refs.hasReferences()) {
                         throw new ActivityViolationException("Unable to checkout. " +
                                 "Activity is already used for the same node in " +
@@ -548,7 +546,7 @@
      */
     protected boolean hasItemReferences(NodeId id)
             throws RepositoryException {
-        return stateMgr.hasNodeReferences(new NodeReferencesId(id));
+        return stateMgr.hasNodeReferences(id);
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/XAVersionManager.java Sat Jul 11 23:47:15 2009
@@ -42,7 +42,6 @@
 import org.apache.jackrabbit.core.state.ItemStateListener;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.XAItemStateManager;
 import org.apache.jackrabbit.core.state.ISMLocking.ReadLock;
@@ -360,12 +359,12 @@
     /**
      * {@inheritDoc}
      */
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
 
         ChangeLog changeLog = ((XAItemStateManager) stateMgr).getChangeLog();
         if (changeLog != null) {
-            return changeLog.get(id);
+            return changeLog.getReferencesTo(id);
         }
         return null;
     }
@@ -373,10 +372,10 @@
     /**
      * {@inheritDoc}
      */
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    public boolean hasNodeReferences(NodeId id) {
         ChangeLog changeLog = ((XAItemStateManager) stateMgr).getChangeLog();
         if (changeLog != null) {
-            return changeLog.get(id) != null;
+            return changeLog.getReferencesTo(id) != null;
         }
         return false;
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/virtual/AbstractVISProvider.java Sat Jul 11 23:47:15 2009
@@ -29,13 +29,11 @@
 import org.apache.jackrabbit.core.state.ItemStateException;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
 import org.apache.jackrabbit.core.state.NodeReferences;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.NodeState;
 import org.apache.jackrabbit.core.state.ItemStateReferenceMap;
 import org.apache.jackrabbit.core.state.ItemStateListener;
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
 import org.apache.jackrabbit.spi.Name;
-import org.apache.jackrabbit.uuid.UUID;
 import org.apache.jackrabbit.util.WeakIdentityCollection;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.slf4j.Logger;
@@ -142,7 +140,7 @@
     /**
      * {@inheritDoc}
      */
-    public NodeReferences getNodeReferences(NodeReferencesId id)
+    public NodeReferences getNodeReferences(NodeId id)
             throws NoSuchItemStateException, ItemStateException {
         throw new NoSuchItemStateException(id.toString());
     }
@@ -150,7 +148,7 @@
     /**
      * {@inheritDoc}
      */
-    public boolean hasNodeReferences(NodeReferencesId id) {
+    public boolean hasNodeReferences(NodeId id) {
         return false;
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/CachingHierarchyManagerTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/CachingHierarchyManagerTest.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/CachingHierarchyManagerTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/CachingHierarchyManagerTest.java Sat Jul 11 23:47:15 2009
@@ -23,7 +23,6 @@
 
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.state.ChildNodeEntry;
 import org.apache.jackrabbit.core.state.ItemState;
@@ -39,7 +38,6 @@
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
 import org.apache.jackrabbit.spi.commons.name.NameFactoryImpl;
 import org.apache.jackrabbit.spi.commons.name.PathFactoryImpl;
-import org.apache.jackrabbit.uuid.UUID;
 
 public class CachingHierarchyManagerTest extends TestCase {
 
@@ -559,7 +557,7 @@
         /**
          * {@inheritDoc}
          */
-        public NodeReferences getNodeReferences(NodeReferencesId id)
+        public NodeReferences getNodeReferences(NodeId id)
                 throws NoSuchItemStateException, ItemStateException {
             return null;
         }
@@ -567,7 +565,7 @@
         /**
          * {@inheritDoc}
          */
-        public boolean hasNodeReferences(NodeReferencesId id) {
+        public boolean hasNodeReferences(NodeId id) {
             return false;
         }
     }

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java?rev=793243&r1=793242&r2=793243&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/state/AbstractISMLockingTest.java Sat Jul 11 23:47:15 2009
@@ -24,11 +24,9 @@
 
 import org.apache.jackrabbit.core.id.ItemId;
 import org.apache.jackrabbit.core.id.NodeId;
-import org.apache.jackrabbit.core.id.NodeReferencesId;
 import org.apache.jackrabbit.core.state.ISMLocking.ReadLock;
 import org.apache.jackrabbit.core.state.ISMLocking.WriteLock;
 import org.apache.jackrabbit.spi.commons.name.NameConstants;
-import org.apache.jackrabbit.uuid.UUID;
 
 /**
  * <code>AbstractISMLockingTest</code> contains test cases for the ISMLocking requirements.
@@ -60,7 +58,7 @@
         locking = createISMLocking();
         NodeId id = new NodeId();
         state = new NodeState(id, NameConstants.NT_BASE, null, ItemState.STATUS_EXISTING, true);
-        refs = new NodeReferences(new NodeReferencesId(state.getNodeId()));
+        refs = new NodeReferences(state.getNodeId());
         logs = new ArrayList();
         ChangeLog log = new ChangeLog();
         log.added(state);



Mime
View raw message