jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1325798 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/test/java/org/apache/jac...
Date Fri, 13 Apr 2012 15:13:52 GMT
Author: angela
Date: Fri Apr 13 15:13:51 2012
New Revision: 1325798

URL: http://svn.apache.org/viewvc?rev=1325798&view=rev
Log:
OAK-18 - Define Oak API (WIP)

1. Connection
    - getCurrentRoot is only used to retrieve editor -> remove
    - change signature of getEditor to no-param -> current root as long as
       we have no other usages...
    - no dependency to NodeState any more.
    
 2. NodeStateEditor
     - remove getBaseNodeState() as this method was only used by impl
        and impl expected one specific node state implementation
       
 3.  NodeStore, NodeStateDiff, NodeState, ChildNodeEntry interfaces
     - moved to oak.kernel  in a first step to get a clearer picture on
        what exactly is needed in oak-api. (see TODO below)
                     
 4. NodeStore.merge
     - simplify and remove NodeState target param as implementation 
        expects a particular impl of NodeState anyway.
        
 Next Steps:
- replace interfaces in oak.kernel by mk.model interfaces (was too big 
   of a change to include in the same patch as PropertyState is affected)
- cleanup PropertyState that is now used for 2 purposes
- naming of TransientNodeState
- take a closer look at Scalar, CoreValue and property types.


Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ChildNodeEntry.java
  (contents, props changed)
      - copied, changed from r1325759, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChildNodeEntry.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java
      - copied, changed from r1325772, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStateDiff.java
      - copied, changed from r1325759, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateDiff.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java
  (contents, props changed)
      - copied, changed from r1325759, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStore.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChildNodeEntry.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateDiff.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStore.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
    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/core/ConnectionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractChildNodeEntry.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelChildNodeEntry.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateEditor.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.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-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Connection.java
Fri Apr 13 15:13:51 2012
@@ -79,8 +79,6 @@ public interface Connection extends Clos
      */
     Connection getRepositoryConnection();
 
-    NodeState getCurrentRoot();
-
     /**
      * Refresh this connection to the latest revision of the underlying Microkernel.
      */
@@ -96,13 +94,12 @@ public interface Connection extends Clos
     void commit(NodeStateEditor editor) throws CommitFailedException;
 
     /**
-     * Get an node state editor for the given state. Use {@link #commit(NodeStateEditor)}
+     * Get an node state editor for the current root. Use {@link #commit(NodeStateEditor)}
      * to atomically apply the changes made in this editor to the underlying Microkernel.
      *
-     * @param state  node state to edit
-     * @return  editor for the passed {@code state}
+     * @return editor for the current root.
      */
-    NodeStateEditor getNodeStateEditor(NodeState state);
+    NodeStateEditor getNodeStateEditor();
 
     /**
      * Get the query engine.

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=1325798&r1=1325797&r2=1325798&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
Fri Apr 13 15:13:51 2012
@@ -21,8 +21,7 @@ package org.apache.jackrabbit.oak.api;
 import java.util.List;
 
 /**
- * An editor for modifying existing and creating new
- * {@link NodeState node states}.
+ * An editor for modifying existing and creating new node states.
  */
 public interface NodeStateEditor {
 
@@ -99,12 +98,6 @@ public interface NodeStateEditor {
     NodeStateEditor edit(String name);
 
     /**
-     * Return the base node state of this private branch
-     * @return base node state
-     */
-    NodeState getBaseNodeState();
-
-    /**
      * Return the transient state which this editor is acting upon
      * @return transient node state
      */

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/ConnectionImpl.java
Fri Apr 13 15:13:51 2012
@@ -20,9 +20,9 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.oak.api.AuthInfo;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.Connection;
-import org.apache.jackrabbit.oak.api.NodeState;
+import org.apache.jackrabbit.oak.kernel.NodeState;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
-import org.apache.jackrabbit.oak.api.NodeStore;
+import org.apache.jackrabbit.oak.kernel.NodeStore;
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -90,11 +90,6 @@ public class ConnectionImpl implements C
             }
         };
     }
-
-    @Override
-    public NodeState getCurrentRoot() {
-        return root;
-    }
     
     @Override
     public void refresh() {
@@ -106,15 +101,15 @@ public class ConnectionImpl implements C
     @Override
     public void commit(NodeStateEditor editor) throws CommitFailedException {
         try {
-            store.merge(editor, editor.getBaseNodeState());
+            store.merge(editor);
         } catch (MicroKernelException e) {
             throw new CommitFailedException(e);
         }
     }
 
     @Override
-    public NodeStateEditor getNodeStateEditor(NodeState state) {
-        return store.branch(state);
+    public NodeStateEditor getNodeStateEditor() {
+        return store.branch(root);
     }
 
     @Override

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TmpRepositoryService.java
Fri Apr 13 15:13:51 2012
@@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.core;
 import org.apache.jackrabbit.mk.MicroKernelFactory;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.oak.api.Connection;
-import org.apache.jackrabbit.oak.api.NodeState;
+import org.apache.jackrabbit.oak.kernel.NodeState;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
 import org.apache.jackrabbit.oak.api.QueryEngine;
 import org.apache.jackrabbit.oak.api.RepositoryService;
@@ -85,7 +85,7 @@ public class TmpRepositoryService implem
             if (wspNode == null) {
                 NodeStateEditor editor = nodeStore.branch(root);
                 editor.addNode(wspName);
-                nodeStore.merge(editor, editor.getBaseNodeState());
+                nodeStore.merge(editor);
             }
         }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractChildNodeEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractChildNodeEntry.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractChildNodeEntry.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractChildNodeEntry.java
Fri Apr 13 15:13:51 2012
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
-import org.apache.jackrabbit.oak.api.ChildNodeEntry;
-
 /**
  * Abstract base class for {@link ChildNodeEntry} implementations.
  * This base class contains default implementations of the

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractNodeState.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/AbstractNodeState.java
Fri Apr 13 15:13:51 2012
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
-import org.apache.jackrabbit.oak.api.ChildNodeEntry;
-import org.apache.jackrabbit.oak.api.NodeState;
 import org.apache.jackrabbit.oak.api.PropertyState;
 
 /**

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ChildNodeEntry.java
(from r1325759, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChildNodeEntry.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ChildNodeEntry.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ChildNodeEntry.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChildNodeEntry.java&r1=1325759&r2=1325798&rev=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ChildNodeEntry.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ChildNodeEntry.java
Fri Apr 13 15:13:51 2012
@@ -14,10 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.oak.api;
+package org.apache.jackrabbit.oak.kernel;
 
 /**
- * TODO: document
+ * TODO: document OR replace by mk.model ChildNodeEntry interface
  *
  * <h2>Equality and hash codes</h2>
  * <p>

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ChildNodeEntry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelChildNodeEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelChildNodeEntry.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelChildNodeEntry.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelChildNodeEntry.java
Fri Apr 13 15:13:51 2012
@@ -18,8 +18,6 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
-import org.apache.jackrabbit.oak.api.NodeState;
-
 class KernelChildNodeEntry extends AbstractChildNodeEntry {
 
     private final String name;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Fri Apr 13 15:13:51 2012
@@ -21,8 +21,6 @@ package org.apache.jackrabbit.oak.kernel
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.json.JsopReader;
 import org.apache.jackrabbit.mk.json.JsopTokenizer;
-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.api.Scalar;
 

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=1325798&r1=1325797&r2=1325798&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
Fri Apr 13 15:13:51 2012
@@ -20,7 +20,6 @@ package org.apache.jackrabbit.oak.kernel
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.json.JsonBuilder;
-import org.apache.jackrabbit.oak.api.NodeState;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
@@ -35,7 +34,7 @@ import static org.apache.jackrabbit.mk.u
 /**
  * This {@code NodeStateEditor} implementation accumulates all changes into a json diff
  * and applies them to the microkernel on
- * {@link org.apache.jackrabbit.oak.api.NodeStore#merge(NodeStateEditor, NodeState)}
+ * {@link NodeStore#merge(org.apache.jackrabbit.oak.api.NodeStateEditor)}
  *
  * TODO: review/rewrite when OAK-45 is resolved
  * When the MicroKernel has support for branching and merging private working copies,
@@ -165,16 +164,18 @@ public class KernelNodeStateEditor imple
     }
 
     @Override
-    public NodeState getBaseNodeState() {
-        return base;
-    }
-
-    @Override
     public TransientNodeState getTransientState() {
         return transientState;
     }
 
     //------------------------------------------------------------< internal >---
+    /**
+     * Return the base node state of this private branch
+     * @return base node state
+     */
+    NodeState getBaseNodeState() {
+        return base;
+    }
 
     /**
      * Atomically merges the changes from this branch back into the

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStore.java
Fri Apr 13 15:13:51 2012
@@ -19,10 +19,7 @@
 package org.apache.jackrabbit.oak.kernel;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
-import org.apache.jackrabbit.oak.api.NodeState;
-import org.apache.jackrabbit.oak.api.NodeStateDiff;
 import org.apache.jackrabbit.oak.api.NodeStateEditor;
-import org.apache.jackrabbit.oak.api.NodeStore;
 
 /**
  * {@link MicroKernel}-based {@link NodeStore} implementation.
@@ -46,10 +43,13 @@ public class KernelNodeStore implements 
     }
 
     @Override
-    public NodeState merge(NodeStateEditor branch, NodeState target) {
+    public NodeState merge(NodeStateEditor branch) {
         if (!(branch instanceof KernelNodeStateEditor)) {
             throw new IllegalArgumentException("Branch does not belong to this store");
         }
+
+        KernelNodeStateEditor kne = (KernelNodeStateEditor) branch;
+        NodeState target = kne.getBaseNodeState();
         if (!(target instanceof KernelNodeState)) {
             throw new IllegalArgumentException("Target does not belong to this store");
         }

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java
(from r1325772, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeState.java&r1=1325772&r2=1325798&rev=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java
Fri Apr 13 15:13:51 2012
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.oak.api;
+package org.apache.jackrabbit.oak.kernel;
+
+import org.apache.jackrabbit.oak.api.PropertyState;
 
 /**
  * A content tree consists of nodes and properties, each of which
@@ -89,6 +91,8 @@ package org.apache.jackrabbit.oak.api;
  */
 public interface NodeState {
 
+    // TODO: check if can be replaced by the mk.model interface
+
     /**
      * Returns the named property. The name is an opaque string and
      * is not parsed or otherwise interpreted by this method.

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStateDiff.java
(from r1325759, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateDiff.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStateDiff.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStateDiff.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateDiff.java&r1=1325759&r2=1325798&rev=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStateDiff.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStateDiff.java
Fri Apr 13 15:13:51 2012
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.oak.api;
+package org.apache.jackrabbit.oak.kernel;
+
+import org.apache.jackrabbit.oak.api.PropertyState;
 
 /**
  * Handler of node state differences.
@@ -25,6 +27,8 @@ package org.apache.jackrabbit.oak.api;
  * added, changed or deleted methods where appropriate. Differences in
  * the ordering of properties or child nodes do not affect the comparison,
  * and the order in which such differences are reported is unspecified.
+ *
+ * TODO: check if can be replaced by mk.model.NodeStateDiff
  */
 public interface NodeStateDiff {
 

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java
(from r1325759, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStore.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStore.java&r1=1325759&r2=1325798&rev=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/NodeStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java
Fri Apr 13 15:13:51 2012
@@ -14,19 +14,23 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.oak.api;
+package org.apache.jackrabbit.oak.kernel;
+
+import org.apache.jackrabbit.oak.api.NodeStateEditor;
 
 /**
  * Storage abstraction for content trees. At any given point in time
  * the stored content tree is rooted at a single immutable node state.
  * Changes in the tree are constructed by branching off a private copy
  * using the {@link #branch(NodeState)} method which can be modified
- * and merged back using the {@link #merge(NodeStateEditor, NodeState)}
+ * and merged back using the {@link #merge(org.apache.jackrabbit.oak.api.NodeStateEditor)}
  * method.
  * <p>
  * This is a low-level interface that doesn't cover functionality like
  * merging concurrent changes or rejecting new tree states based on some
  * higher-level consistency constraints.
+ *
+ * TODO: check if can be replaced by mk.model.NodeStore
  */
 public interface NodeStore {
 
@@ -40,7 +44,7 @@ public interface NodeStore {
     /**
      * Creates a private branch from a {@code base} node state
      * for editing. The branch can later be merged back into
-     * the node store using the {@link #merge(NodeStateEditor, NodeState) merge}
+     * the node store using the {@link #merge(org.apache.jackrabbit.oak.api.NodeStateEditor)
merge}
      * method.
      *
      * @param base base node state
@@ -52,12 +56,12 @@ public interface NodeStore {
      * Atomically merges the changes from {@code branch} back into the
      * {@code target}.
      *
+     *
      * @param branch branch for merging into {@code target}
-     * @param target target of the merge operation
      * @return node state resulting from merging {@code branch} into
      *         {@code target}.
      */
-    NodeState merge(NodeStateEditor branch, NodeState target);
+    NodeState merge(NodeStateEditor branch);
 
     /**
      * Compares the given two node states. Any found differences are

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/TransientKernelNodeState.java
Fri Apr 13 15:13:51 2012
@@ -18,8 +18,6 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
-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.api.TransientNodeState;
 import org.apache.jackrabbit.oak.util.Function1;

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=1325798&r1=1325797&r2=1325798&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
Fri Apr 13 15:13:51 2012
@@ -21,7 +21,6 @@ package org.apache.jackrabbit.oak.kernel
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.simple.SimpleKernelImpl;
 import org.apache.jackrabbit.mk.util.PathUtils;
-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;

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=1325798&r1=1325797&r2=1325798&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
Fri Apr 13 15:13:51 2012
@@ -20,7 +20,6 @@ package org.apache.jackrabbit.oak.kernel
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.simple.SimpleKernelImpl;
-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;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateTest.java
Fri Apr 13 15:13:51 2012
@@ -30,8 +30,6 @@ import java.util.List;
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.simple.SimpleKernelImpl;
-import org.apache.jackrabbit.oak.api.ChildNodeEntry;
-import org.apache.jackrabbit.oak.api.NodeState;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.junit.Before;
 import org.junit.Test;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
Fri Apr 13 15:13:51 2012
@@ -25,8 +25,6 @@ import static junit.framework.Assert.ass
 
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.mk.simple.SimpleKernelImpl;
-import org.apache.jackrabbit.oak.api.ChildNodeEntry;
-import org.apache.jackrabbit.oak.api.NodeState;
 import org.junit.Before;
 import org.junit.Test;
 

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=1325798&r1=1325797&r2=1325798&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
Fri Apr 13 15:13:51 2012
@@ -64,7 +64,7 @@ public class SessionImpl extends Abstrac
         this.valueFactory = new ValueFactoryImpl();
         workspace = new WorkspaceImpl(sessionContext);
 
-        this.editor = connection.getNodeStateEditor(connection.getCurrentRoot());
+        this.editor = connection.getNodeStateEditor();
         this.itemStateProvider = new ItemStateProvider(editor.getTransientState());
     }
 
@@ -156,7 +156,7 @@ public class SessionImpl extends Abstrac
         try {
             connection.commit(editor);
             connection.refresh();
-            editor = connection.getNodeStateEditor(connection.getCurrentRoot());
+            editor = connection.getNodeStateEditor();
             itemStateProvider = new ItemStateProvider(editor.getTransientState());
         } catch (CommitFailedException e) {
             throw new RepositoryException(e);
@@ -168,7 +168,7 @@ public class SessionImpl extends Abstrac
         ensureIsAlive();
         connection.refresh();
         if (!keepChanges) {
-            editor = connection.getNodeStateEditor(connection.getCurrentRoot());
+            editor = connection.getNodeStateEditor();
             itemStateProvider = new ItemStateProvider(editor.getTransientState());
         }
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java?rev=1325798&r1=1325797&r2=1325798&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/WorkspaceImpl.java
Fri Apr 13 15:13:51 2012
@@ -85,7 +85,7 @@ public class WorkspaceImpl implements Wo
 
         try {
             Connection connection = sessionContext.getConnection();
-            NodeStateEditor editor = connection.getNodeStateEditor(connection.getCurrentRoot());
+            NodeStateEditor editor = connection.getNodeStateEditor();
 
             String srcPath = Paths.relativize("/", srcAbsPath);
             String destPath = Paths.relativize("/", destAbsPath);
@@ -116,7 +116,7 @@ public class WorkspaceImpl implements Wo
 
         try {
             Connection connection = sessionContext.getConnection();
-            NodeStateEditor editor = connection.getNodeStateEditor(connection.getCurrentRoot());
+            NodeStateEditor editor = connection.getNodeStateEditor();
 
             String srcPath = Paths.relativize("/", srcAbsPath);
             String destPath = Paths.relativize("/", destAbsPath);



Mime
View raw message