jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1339129 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder2.java
Date Wed, 16 May 2012 12:08:11 GMT
Author: mduerig
Date: Wed May 16 12:08:10 2012
New Revision: 1339129

URL: http://svn.apache.org/viewvc?rev=1339129&view=rev
Log:
OAK-100: Proper CommitHook handling in NodeStore
- A very raw POC implementation only for an alternative NodeStateBuilder implementation (WIP,
POC)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder2.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder2.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder2.java?rev=1339129&r1=1339128&r2=1339129&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder2.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/NodeStateBuilder2.java
Wed May 16 12:08:10 2012
@@ -103,6 +103,7 @@ public class NodeStateBuilder2  {
         void addNode(String path);
         void removeNode(String path);
         void setProperty(String path, PropertyState propertyState);
+        void setNode(String concat);
     }
 
     static void toJsop(String path, NodeState node, Listener listener) {
@@ -259,8 +260,7 @@ public class NodeStateBuilder2  {
         @Override
         public void toJsop(String path, Listener listener) {
             super.toJsop(path, listener);
-            listener.removeNode(PathUtils.concat(path, childName));
-            listener.addNode(PathUtils.concat(path, childName));
+            listener.setNode(PathUtils.concat(path, childName));
             NodeStateBuilder2.toJsop(PathUtils.concat(path, childName), node, listener);
         }
     }
@@ -530,6 +530,11 @@ public class NodeStateBuilder2  {
         NodeState r = removeNode(base, "a");
         r = setNode(r, "b", addNode(b, "a", a));
 
+        // >b:c
+//        NodeState b = base.getChildNode("b");
+//        NodeState r = removeNode(base, "b");
+//        r = addNode(r, "c", b);
+
         System.out.println(r);
 
         final StringBuilder sb = new StringBuilder();
@@ -560,6 +565,11 @@ public class NodeStateBuilder2  {
                    .append(':').append(toJson(propertyState));
             }
 
+            @Override
+            public void setNode(String path) {
+                sb.append("-\"").append(path).append('"');
+                sb.append("+\"").append(path).append("\":");
+            }
         });
 
         System.out.println(sb.toString());



Mime
View raw message