jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1324688 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/ oak-jcr/src/main/java/org/apache/ja...
Date Wed, 11 Apr 2012 10:34:22 GMT
Author: mduerig
Date: Wed Apr 11 10:34:22 2012
New Revision: 1324688

URL: http://svn.apache.org/viewvc?rev=1324688&view=rev
Log:
OAK-18: Define Oak API 
introduce TransientNodeState

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/TransientNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java
      - copied, changed from r1324678, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorFuzzIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemStateProvider.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateEditor.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateEditor.java
Wed Apr 11 10:34:22 2012
@@ -97,4 +97,10 @@ public interface NodeStateEditor {
      * @return base node state
      */
     NodeState getBaseNodeState();
+
+    /**
+     * Return the transient state which this editor is acting upon
+     * @return transient node state
+     */
+    TransientNodeState getTransientState();
 }

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/TransientNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/TransientNodeState.java?rev=1324688&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/TransientNodeState.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/TransientNodeState.java
Wed Apr 11 10:34:22 2012
@@ -0,0 +1,100 @@
+package org.apache.jackrabbit.oak.api;
+
+import org.apache.jackrabbit.oak.kernel.KernelNodeStateEditor;
+import org.apache.jackrabbit.oak.kernel.TransientKernelNodeState;
+
+/**
+ * A transient node state represents a node being edited. All edit operations are
+ * done through an associated {@link org.apache.jackrabbit.oak.api.NodeStateEditor}.
+ * <p>
+ * A transient node state contains the current state of a node and is
+ * in contrast to {@link org.apache.jackrabbit.mk.model.NodeState} instances
+ * mutable and not thread safe.
+ * <p>
+ * The various accessors on this class mirror these of {@code NodeState}. However,
+ * since instances of this class are mutable return values may change between
+ * invocations.
+ */
+public interface TransientNodeState {
+    /**
+     * @return  the name of this transient node state
+     */
+    String getName();
+
+    /**
+     * @return  relative path of this transient node state
+     */
+    String getPath();
+
+    /**
+     * @return  the parent of this transient node state
+     */
+    TransientNodeState getParent();
+
+    /**
+     * @return  editor acting upon this instance
+     */
+    KernelNodeStateEditor getEditor();
+
+    /**
+     * Get a property state
+     * @param name name of the property state
+     * @return  the property state with the given {@code name} or {@code null}
+     *          if no such property state exists.
+     */
+    PropertyState getProperty(String name);
+
+    /**
+     * Determine if a property state exists
+     * @param name  name of the property state
+     * @return  {@code true} if and only if a property with the given {@code name}
+     *          exists.
+     */
+    boolean hasProperty(String name);
+
+    /**
+     * Determine the number of properties.
+     * @return  number of properties
+     */
+    long getPropertyCount();
+
+    /**
+     * Get a child node state
+     * @param name  name of the child node state
+     * @return  the child node state with the given {@code name} or {@code null}
+     *          if no such child node state exists.
+     */
+    TransientKernelNodeState getChildNode(String name);
+
+    /**
+     * Determine if a child node state exists
+     * @param name  name of the child node state
+     * @return  {@code true} if and only if a child node with the given {@code name}
+     *          exists.
+     */
+    boolean hasNode(String name);
+
+    /**
+     * Determine the number of child nodes.
+     * @return  number of child nodes.
+     */
+    long getChildNodeCount();
+
+    /**
+     * All property states. The returned {@code Iterable} has snapshot semantics. That
+     * is, it reflect the state of this transient node state instance at the time of the
+     * call. Later changes to this instance are no visible to iterators obtained from
+     * the returned iterable.
+     * @return  An {@code Iterable} for all property states
+     */
+    Iterable<PropertyState> getProperties();
+
+    /**
+     * All child node states. The returned {@code Iterable} has snapshot semantics. That
+     * is, it reflect the state of this transient node state instance at the time of the
+     * call. Later changes to this instance are no visible to iterators obtained from
+     * the returned iterable.
+     * @return  An {@code Iterable} for all child node states
+     */
+    Iterable<TransientNodeState> getChildNodes();
+}

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
Wed Apr 11 10:34:22 2012
@@ -24,6 +24,7 @@ import org.apache.jackrabbit.oak.api.Nod
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
+import org.apache.jackrabbit.oak.api.TransientNodeState;
 
 import java.util.List;
 
@@ -50,7 +51,7 @@ public class KernelNodeStateEditor imple
     private final NodeState base;
 
     /** Transient state this editor is acting upon */
-    private final TransientNodeState transientState;
+    private final TransientKernelNodeState transientState;
 
     /** Json diff of this private branch */
     private final StringBuilder jsop;
@@ -62,7 +63,7 @@ public class KernelNodeStateEditor imple
      */
     KernelNodeStateEditor(NodeState base) {
         this.base = base;
-        transientState = new TransientNodeState(base, this);
+        transientState = new TransientKernelNodeState(base, this);
         jsop = new StringBuilder();
     }
 
@@ -71,7 +72,7 @@ public class KernelNodeStateEditor imple
      * @param parentEditor  editor of the parent of {@code state}
      * @param state  transient node state for which to create the node state editor
      */
-    KernelNodeStateEditor(KernelNodeStateEditor parentEditor, TransientNodeState state) {
+    KernelNodeStateEditor(KernelNodeStateEditor parentEditor, TransientKernelNodeState state)
{
         base = parentEditor.base;
         transientState = state;
         jsop = parentEditor.jsop;
@@ -117,13 +118,13 @@ public class KernelNodeStateEditor imple
 
     @Override
     public void move(String sourcePath, String destPath) {
-        TransientNodeState sourceParent = getTransientState(getParentPath(sourcePath));
+        TransientKernelNodeState sourceParent = getTransientState(getParentPath(sourcePath));
         String sourceName = getName(sourcePath);
         if (sourceParent == null || !sourceParent.hasNode(sourceName)) {
             return;
         }
         
-        TransientNodeState destParent = getTransientState(getParentPath(destPath));
+        TransientKernelNodeState destParent = getTransientState(getParentPath(destPath));
         String destName = getName(destPath);
         if (destParent == null || destParent.hasNode(destName)) {
             return;
@@ -136,13 +137,13 @@ public class KernelNodeStateEditor imple
 
     @Override
     public void copy(String sourcePath, String destPath) {
-        TransientNodeState sourceParent = getTransientState(getParentPath(sourcePath));
+        TransientKernelNodeState sourceParent = getTransientState(getParentPath(sourcePath));
         String sourceName = getName(sourcePath);
         if (sourceParent == null || !sourceParent.hasNode(sourceName)) {
             return;
         }
 
-        TransientNodeState destParent = getTransientState(getParentPath(destPath));
+        TransientKernelNodeState destParent = getTransientState(getParentPath(destPath));
         String destName = getName(destPath);
         if (destParent == null || destParent.hasNode(destName)) {
             return;
@@ -166,10 +167,7 @@ public class KernelNodeStateEditor imple
         return base;
     }
 
-    /**
-     * @return the {@link TransientNodeState} instance this editor is
-     *         acting upon.
-     */
+    @Override
     public TransientNodeState getTransientState() {
         return transientState;
     }
@@ -195,11 +193,11 @@ public class KernelNodeStateEditor imple
      * Get a transient node state for the node identified by
      * {@code path}
      * @param path  the path to the node state
-     * @return  a {@link TransientNodeState} instance for the item
+     * @return  a {@link TransientKernelNodeState} instance for the item
      *          at {@code path} or {@code null} if no such item exits.
      */
-    private TransientNodeState getTransientState(String path) {
-        TransientNodeState state = transientState;
+    private TransientKernelNodeState getTransientState(String path) {
+        TransientKernelNodeState state = transientState;
         for (String name : elements(path)) {
             state = state.getChildNode(name);
             if (state == null) {

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java
(from r1324678, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java&r1=1324678&r2=1324688&rev=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java
Wed Apr 11 10:34:22 2012
@@ -25,7 +25,8 @@ import org.apache.commons.collections.it
 import org.apache.jackrabbit.oak.api.ChildNodeEntry;
 import org.apache.jackrabbit.oak.api.NodeState;
 import org.apache.jackrabbit.oak.api.PropertyState;
-import org.apache.jackrabbit.oak.kernel.TransientNodeState.Iterators.PagedIterator;
+import org.apache.jackrabbit.oak.api.TransientNodeState;
+import org.apache.jackrabbit.oak.kernel.TransientKernelNodeState.Iterators.PagedIterator;
 
 import java.util.HashMap;
 import java.util.HashSet;
@@ -35,25 +36,13 @@ import java.util.Map.Entry;
 import java.util.NoSuchElementException;
 import java.util.Set;
 
-import static org.apache.jackrabbit.oak.kernel.TransientNodeState.Iterators.Function1;
-import static org.apache.jackrabbit.oak.kernel.TransientNodeState.Iterators.Predicate;
-import static org.apache.jackrabbit.oak.kernel.TransientNodeState.Iterators.add;
-import static org.apache.jackrabbit.oak.kernel.TransientNodeState.Iterators.filter;
-import static org.apache.jackrabbit.oak.kernel.TransientNodeState.Iterators.map;
-
-/**
- * A transient node state represents a node being edited. All edit operations are
- * done through an associated {@link org.apache.jackrabbit.oak.api.NodeStateEditor}.
- * <p>
- * A transient node state contains the current state of a node and is
- * in contrast to {@link org.apache.jackrabbit.mk.model.NodeState} instances
- * mutable and not thread safe.
- * <p>
- * The various accessors on this class mirror these of {@code NodeState}. However,
- * since instances of this class are mutable return values may change between
- * invocations.
- */
-public class TransientNodeState {
+import static org.apache.jackrabbit.oak.kernel.TransientKernelNodeState.Iterators.Function1;
+import static org.apache.jackrabbit.oak.kernel.TransientKernelNodeState.Iterators.Predicate;
+import static org.apache.jackrabbit.oak.kernel.TransientKernelNodeState.Iterators.add;
+import static org.apache.jackrabbit.oak.kernel.TransientKernelNodeState.Iterators.filter;
+import static org.apache.jackrabbit.oak.kernel.TransientKernelNodeState.Iterators.map;
+
+public class TransientKernelNodeState implements TransientNodeState {
     /** Editor acting upon this instance */
     private final KernelNodeStateEditor editor;
 
@@ -64,12 +53,12 @@ public class TransientNodeState {
     private final NodeState persistentState;
 
     /** Resolved persistent child states */
-    private final Map<String, TransientNodeState> existingChildNodes =
-            new HashMap<String, TransientNodeState>();
+    private final Map<String, TransientKernelNodeState> existingChildNodes =
+            new HashMap<String, TransientKernelNodeState>();
 
     /** Transiently added node states */
-    private final Map<String, TransientNodeState> addedNodes =
-            new HashMap<String, TransientNodeState>();
+    private final Map<String, TransientKernelNodeState> addedNodes =
+            new HashMap<String, TransientKernelNodeState>();
 
     /** Transiently removed node stated */
     private final Set<String> removedNodes = new HashSet<String>();
@@ -92,7 +81,7 @@ public class TransientNodeState {
      * @param persistentState  underlying persistent state
      * @param editor  editor acting upon the transient node state
      */
-    TransientNodeState(NodeState persistentState, KernelNodeStateEditor editor) {
+    TransientKernelNodeState(NodeState persistentState, KernelNodeStateEditor editor) {
         this.editor = editor;
         this.persistentState = persistentState;
         this.parent = null;
@@ -104,7 +93,7 @@ public class TransientNodeState {
      * @param parentEditor  editor of the parent state
      * @param name  name of the state
      */
-    private TransientNodeState(KernelNodeStateEditor parentEditor, String name) {
+    private TransientKernelNodeState(KernelNodeStateEditor parentEditor, String name) {
         this(parentEditor, name, null);
     }
 
@@ -114,7 +103,7 @@ public class TransientNodeState {
      * @param name  name of the state
      * @param persistedState  underlying persistent state
      */
-    private TransientNodeState(KernelNodeStateEditor parentEditor, String name,
+    private TransientKernelNodeState(KernelNodeStateEditor parentEditor, String name,
             NodeState persistedState) {
 
         editor = new KernelNodeStateEditor(parentEditor, this);
@@ -130,7 +119,7 @@ public class TransientNodeState {
      * @param parent  parent of the copied state
      * @param name  name of the copied state
      */
-    private TransientNodeState(TransientNodeState state, TransientNodeState parent,
+    private TransientKernelNodeState(TransientKernelNodeState state, TransientNodeState parent,
             String name) {
 
         editor = new KernelNodeStateEditor(parent.getEditor(), this);
@@ -139,17 +128,17 @@ public class TransientNodeState {
         this.name = name;
 
         // recursively copy all existing node states
-        for (Entry<String, TransientNodeState> existing : state.existingChildNodes.entrySet())
{
+        for (Entry<String, TransientKernelNodeState> existing : state.existingChildNodes.entrySet())
{
             String existingName = existing.getKey();
             this.existingChildNodes.put(existingName,
-                    new TransientNodeState(existing.getValue(), this, existingName));
+                    new TransientKernelNodeState(existing.getValue(), this, existingName));
         }
         
         // recursively copy all added node states
-        for (Entry<String, TransientNodeState> added : state.addedNodes.entrySet())
{
+        for (Entry<String, TransientKernelNodeState> added : state.addedNodes.entrySet())
{
             String addedName = added.getKey();
             this.addedNodes.put(addedName,
-                    new TransientNodeState(added.getValue(), this, addedName));
+                    new TransientKernelNodeState(added.getValue(), this, addedName));
         }
 
         this.removedNodes.addAll(state.removedNodes);
@@ -157,16 +146,12 @@ public class TransientNodeState {
         this.removedProperties.addAll(state.removedProperties);
     }
 
-    /**
-     * @return  the name of this transient node state
-     */
+    @Override
     public String getName() {
         return name;
     }
 
-    /**
-     * @return  relative path of this transient node state
-     */
+    @Override
     public String getPath() {
         if (parent == null) {
             return name;
@@ -179,23 +164,17 @@ public class TransientNodeState {
         }
     }
 
+    @Override
     public TransientNodeState getParent() {
         return parent;
     }
 
-    /**
-     * @return  editor acting upon this instance
-     */
+    @Override
     public KernelNodeStateEditor getEditor() {
         return editor;
     }
 
-    /**
-     * Get a property state
-     * @param name name of the property state
-     * @return  the property state with the given {@code name} or {@code null}
-     *          if no such property state exists.
-     */
+    @Override
     public PropertyState getProperty(String name) {
         PropertyState state = addedProperties.get(name);
         if (state != null) {
@@ -209,20 +188,12 @@ public class TransientNodeState {
             : persistentState.getProperty(name);
     }
 
-    /**
-     * Determine if a property state exists
-     * @param name  name of the property state
-     * @return  {@code true} if and only if a property with the given {@code name}
-     *          exists.
-     */
+    @Override
     public boolean hasProperty(String name) {
         return getProperty(name) != null;
     }
 
-    /**
-     * Determine the number of properties.
-     * @return  number of properties
-     */
+    @Override
     public long getPropertyCount() {
         long persistentCount = persistentState == null
             ? 0
@@ -231,14 +202,9 @@ public class TransientNodeState {
         return persistentCount + addedProperties.size() - removedProperties.size();
     }
 
-    /**
-     * Get a child node state
-     * @param name  name of the child node state
-     * @return  the child node state with the given {@code name} or {@code null}
-     *          if no such child node state exists.
-     */
-    public TransientNodeState getChildNode(String name) {
-        TransientNodeState state = addedNodes.get(name);
+    @Override
+    public TransientKernelNodeState getChildNode(String name) {
+        TransientKernelNodeState state = addedNodes.get(name);
         if (state != null) {
             // Added or removed and re-added child node
             return state;
@@ -250,20 +216,12 @@ public class TransientNodeState {
             : getExistingChildNode(name);
     }
 
-    /**
-     * Determine if a child node state exists
-     * @param name  name of the child node state
-     * @return  {@code true} if and only if a child node with the given {@code name}
-     *          exists.
-     */
+    @Override
     public boolean hasNode(String name) {
         return getChildNode(name) != null;
     }
 
-    /**
-     * Determine the number of child nodes.
-     * @return  number of child nodes.
-     */
+    @Override
     public long getChildNodeCount() {
         long persistentCount = persistentState == null
                 ? 0
@@ -272,13 +230,7 @@ public class TransientNodeState {
         return persistentCount + addedNodes.size() - removedNodes.size();
     }
 
-    /**
-     * All property states. The returned {@code Iterable} has snapshot semantics. That
-     * is, it reflect the state of this transient node state instance at the time of the
-     * call. Later changes to this instance are no visible to iterators obtained from
-     * the returned iterable.
-     * @return  An {@code Iterable} for all property states
-     */
+    @Override
     public Iterable<PropertyState> getProperties() {
         // Persisted property states
         final Iterable<? extends PropertyState> persisted = persistentState == null
@@ -319,13 +271,7 @@ public class TransientNodeState {
         };
     }
 
-    /**
-     * All child node states. The returned {@code Iterable} has snapshot semantics. That
-     * is, it reflect the state of this transient node state instance at the time of the
-     * call. Later changes to this instance are no visible to iterators obtained from
-     * the returned iterable.
-     * @return  An {@code Iterable} for all child node states
-     */
+    @Override
     public Iterable<TransientNodeState> getChildNodes() {
         // Copy od removed child node states
         final Set<String> removed = new HashSet<String>();
@@ -379,7 +325,7 @@ public class TransientNodeState {
      * @param name  name of the child node state
      */
     void addNode(String name) {
-        addedNodes.put(name, new TransientNodeState(editor, name));
+        addedNodes.put(name, new TransientKernelNodeState(editor, name));
     }
 
     /**
@@ -429,8 +375,8 @@ public class TransientNodeState {
      * @param destParent  parent of the moved node state
      * @param destName  name of the moved node state
      */
-    void move(String name, TransientNodeState destParent, String destName) {
-        TransientNodeState state = getChildNode(name);
+    void move(String name, TransientKernelNodeState destParent, String destName) {
+        TransientKernelNodeState state = getChildNode(name);
         removeNode(name);
 
         state.name = destName;
@@ -447,9 +393,9 @@ public class TransientNodeState {
      * @param destParent  parent of the moved node state
      * @param destName  name of the moved node state
      */
-    void copy(String name, TransientNodeState destParent, String destName) {
+    void copy(String name, TransientKernelNodeState destParent, String destName) {
         destParent.addedNodes.put(destName,
-                new TransientNodeState(getChildNode(name), destParent, destName));
+                new TransientKernelNodeState(getChildNode(name), destParent, destName));
     }
 
     /**
@@ -462,18 +408,18 @@ public class TransientNodeState {
      *          or the underlying persistent state does not have a child
      *          node state with the given {@code name}.
      */
-    private TransientNodeState getExistingChildNode(String name) {
+    private TransientKernelNodeState getExistingChildNode(String name) {
         if (persistentState == null) {
             return null;
         }
 
-        TransientNodeState transientState = existingChildNodes.get(name);
+        TransientKernelNodeState transientState = existingChildNodes.get(name);
         if (transientState == null) {
             NodeState state = persistentState.getChildNode(name);
             if (state == null) {
                 return null;
             }
-            transientState = new TransientNodeState(editor, name, state);
+            transientState = new TransientKernelNodeState(editor, name, state);
             existingChildNodes.put(name, transientState);
         }
         return transientState;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorFuzzIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorFuzzIT.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorFuzzIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorFuzzIT.java
Wed Apr 11 10:34:22 2012
@@ -24,6 +24,7 @@ import org.apache.jackrabbit.mk.util.Pat
 import org.apache.jackrabbit.oak.api.ChildNodeEntry;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
+import org.apache.jackrabbit.oak.api.TransientNodeState;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditorTest.java
Wed Apr 11 10:34:22 2012
@@ -23,6 +23,7 @@ import org.apache.jackrabbit.mk.simple.S
 import org.apache.jackrabbit.oak.api.NodeState;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
+import org.apache.jackrabbit.oak.api.TransientNodeState;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemStateProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemStateProvider.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemStateProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemStateProvider.java
Wed Apr 11 10:34:22 2012
@@ -2,7 +2,7 @@ package org.apache.jackrabbit.oak.jcr;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.oak.api.PropertyState;
-import org.apache.jackrabbit.oak.kernel.TransientNodeState;
+import org.apache.jackrabbit.oak.api.TransientNodeState;
 
 public class ItemStateProvider {
     private final TransientNodeState root;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Wed Apr 11 10:34:22 2012
@@ -22,6 +22,7 @@ import org.apache.jackrabbit.commons.ite
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
 import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.TransientNodeState;
 import org.apache.jackrabbit.oak.jcr.util.Function1;
 import org.apache.jackrabbit.oak.jcr.util.ItemNameMatcher;
 import org.apache.jackrabbit.oak.jcr.util.Iterators;
@@ -29,7 +30,6 @@ import org.apache.jackrabbit.oak.jcr.uti
 import org.apache.jackrabbit.oak.jcr.util.Predicate;
 import org.apache.jackrabbit.oak.jcr.util.ValueConverter;
 import org.apache.jackrabbit.oak.kernel.ScalarImpl;
-import org.apache.jackrabbit.oak.kernel.TransientNodeState;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
Wed Apr 11 10:34:22 2012
@@ -19,9 +19,9 @@ package org.apache.jackrabbit.oak.jcr;
 import org.apache.jackrabbit.mk.util.PathUtils;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
 import org.apache.jackrabbit.oak.api.PropertyState;
+import org.apache.jackrabbit.oak.api.TransientNodeState;
 import org.apache.jackrabbit.oak.jcr.util.LogUtil;
 import org.apache.jackrabbit.oak.jcr.util.ValueConverter;
-import org.apache.jackrabbit.oak.kernel.TransientNodeState;
 import org.apache.jackrabbit.value.ValueHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java?rev=1324688&r1=1324687&r2=1324688&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
Wed Apr 11 10:34:22 2012
@@ -21,7 +21,6 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.Connection;
 import org.apache.jackrabbit.oak.api.NodeState;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
-import org.apache.jackrabbit.oak.kernel.KernelNodeStateEditor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.xml.sax.ContentHandler;
@@ -69,8 +68,7 @@ public class SessionImpl extends Abstrac
         this.valueFactory = new ValueFactoryImpl();
 
         this.editor = connection.getNodeStateEditor(connection.getCurrentRoot());
-        // fixme: don't cast to implementation
-        this.itemStateProvider = new ItemStateProvider(((KernelNodeStateEditor) editor).getTransientState());
+        this.itemStateProvider = new ItemStateProvider(editor.getTransientState());
 
         workspace = new WorkspaceImpl(sessionContext);
     }
@@ -160,8 +158,7 @@ public class SessionImpl extends Abstrac
         try {
             NodeState newState = connection.commit(editor);
             editor = connection.getNodeStateEditor(newState);
-            // fixme: don't cast to implementation
-            itemStateProvider = new ItemStateProvider(((KernelNodeStateEditor) editor).getTransientState());
+            itemStateProvider = new ItemStateProvider(editor.getTransientState());
         } catch (CommitFailedException e) {
             throw new RepositoryException(e);
         }
@@ -174,8 +171,7 @@ public class SessionImpl extends Abstrac
             // todo: need a better way to update a connection to head
             NodeState newState = connection.commit(connection.getNodeStateEditor(connection.getCurrentRoot()));
             editor = connection.getNodeStateEditor(newState);
-            // fixme: don't cast to implementation
-            itemStateProvider = new ItemStateProvider(((KernelNodeStateEditor) editor).getTransientState());
+            itemStateProvider = new ItemStateProvider(editor.getTransientState());
         } catch (CommitFailedException e) {
             throw new RepositoryException(e);
         }



Mime
View raw message