jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r432278 - in /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state: NodeState.java WorkspaceItemStateFactory.java
Date Thu, 17 Aug 2006 16:18:02 GMT
Author: angela
Date: Thu Aug 17 09:18:01 2006
New Revision: 432278

URL: http://svn.apache.org/viewvc?rev=432278&view=rev
Log:
work in progress

- NodeState: rename addNodeReferences to setNodeReferences
-            'set' is not possible if NodeState is transient
-            since NodeReferences are not copied to overlaying state, refs
             must be retrieved from overlayed state if present.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java?rev=432278&r1=432277&r2=432278&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/NodeState.java
Thu Aug 17 09:18:01 2006
@@ -812,12 +812,31 @@
         }
     }
 
-    void addNodeReferences(NodeReferences references) {
-        this.references = references;
+    /**
+     * Return the <code>NodeReferences</code> present on this state or
+     * <code>null</code>.
+     *
+     * @return references
+     */
+    NodeReferences getNodeReferences() {
+        if (hasOverlayedState()) {
+            return ((NodeState)getOverlayedState()).references;
+        } else {
+            return references;
+        }
     }
 
-    NodeReferences getNodeReferences() {
-        return references;
+    /**
+     * Set the <code>NodeReferences</code> for this state.
+     *
+     * @param references
+     */
+    void setNodeReferences(NodeReferences references) {
+        if (isTransient()) {
+            // TODO: check again
+            throw new UnsupportedOperationException("Cannot set references to a transient
node state.");
+        }
+        this.references = references;
     }
 
     /**

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java?rev=432278&r1=432277&r2=432278&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/state/WorkspaceItemStateFactory.java
Thu Aug 17 09:18:01 2006
@@ -142,7 +142,7 @@
             // Therefore build a NodeReference instance and add it to the state.
             if (uuid != null) {
                 PropertyId[] references = info.getReferences();
-                state.addNodeReferences(new NodeReferencesImpl(info.getId(), references));
+                state.setNodeReferences(new NodeReferencesImpl(info.getId(), references));
             }
 
             // copied from local-state-mgr TODO... check



Mime
View raw message