jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1357678 - in /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk: core/ model/ model/tree/ store/
Date Thu, 05 Jul 2012 15:25:26 GMT
Author: stefan
Date: Thu Jul  5 15:25:25 2012
New Revision: 1357678

URL: http://svn.apache.org/viewvc?rev=1357678&view=rev
Log:
refactor o.a.j.mk.model package space and fix some confusing naming (result of an earlier refactoring)

Added:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractChildNode.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractChildNodeEntry.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNodeState.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractPropertyState.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractPropertyState.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/ChildNode.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/DiffBuilder.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeDelta.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeState.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeState.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStateDiff.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStore.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/TraversingNodeDiffHandler.java   (contents, props changed)
      - copied, changed from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java
Removed:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractChildNodeEntry.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNodeState.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractPropertyState.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNode.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/DiffBuilder.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeState.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java
Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/Repository.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/MutableNode.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/Node.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDiffHandler.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/StoredNodeAsState.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java Thu Jul  5 15:25:25 2012
@@ -25,13 +25,13 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.mk.json.JsopBuilder;
 import org.apache.jackrabbit.mk.json.JsopReader;
 import org.apache.jackrabbit.mk.json.JsopTokenizer;
-import org.apache.jackrabbit.mk.model.ChildNodeEntry;
+import org.apache.jackrabbit.mk.model.tree.ChildNode;
 import org.apache.jackrabbit.mk.model.Commit;
 import org.apache.jackrabbit.mk.model.CommitBuilder;
 import org.apache.jackrabbit.mk.model.CommitBuilder.NodeTree;
-import org.apache.jackrabbit.mk.model.DiffBuilder;
+import org.apache.jackrabbit.mk.model.tree.DiffBuilder;
 import org.apache.jackrabbit.mk.model.Id;
-import org.apache.jackrabbit.mk.model.NodeState;
+import org.apache.jackrabbit.mk.model.tree.NodeState;
 import org.apache.jackrabbit.mk.model.PropertyState;
 import org.apache.jackrabbit.mk.model.StoredCommit;
 import org.apache.jackrabbit.mk.util.CommitGate;
@@ -615,7 +615,7 @@ public class MicroKernelImpl implements 
                 count = -1;
             }
             int numSiblings = 0;
-            for (ChildNodeEntry entry : node.getChildNodeEntries(offset, count)) {
+            for (ChildNode entry : node.getChildNodeEntries(offset, count)) {
                 if (filter == null || filter.includeNode(entry.getName())) {
                     if (maxChildNodes != -1 && ++numSiblings > maxChildNodes) {
                         break;

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/Repository.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/Repository.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/Repository.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/Repository.java Thu Jul  5 15:25:25 2012
@@ -24,7 +24,7 @@ import org.apache.jackrabbit.mk.blobs.Fi
 import org.apache.jackrabbit.mk.blobs.MemoryBlobStore;
 import org.apache.jackrabbit.mk.model.CommitBuilder;
 import org.apache.jackrabbit.mk.model.Id;
-import org.apache.jackrabbit.mk.model.NodeState;
+import org.apache.jackrabbit.mk.model.tree.NodeState;
 import org.apache.jackrabbit.mk.model.StoredCommit;
 import org.apache.jackrabbit.mk.persistence.H2Persistence;
 import org.apache.jackrabbit.mk.persistence.InMemPersistence;

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNode.java Thu Jul  5 15:25:25 2012
@@ -20,10 +20,8 @@ import org.apache.jackrabbit.mk.store.Bi
 import org.apache.jackrabbit.mk.store.RevisionProvider;
 
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
 
 /**
  *
@@ -55,8 +53,8 @@ public abstract class AbstractNode imple
             } else {
                 this.childEntries = new ChildNodeEntriesTree(provider);
             }
-            for (Iterator<ChildNode> it = other.getChildNodeEntries(0, -1); it.hasNext(); ) {
-                ChildNode cne = it.next();
+            for (Iterator<ChildNodeEntry> it = other.getChildNodeEntries(0, -1); it.hasNext(); ) {
+                ChildNodeEntry cne = it.next();
                 this.childEntries.add(cne);
             }
         }
@@ -66,7 +64,7 @@ public abstract class AbstractNode imple
         return properties;
     }
 
-    public ChildNode getChildNodeEntry(String name) {
+    public ChildNodeEntry getChildNodeEntry(String name) {
         return childEntries.get(name);
     }
 
@@ -78,7 +76,7 @@ public abstract class AbstractNode imple
         return childEntries.getCount();
     }
 
-    public Iterator<ChildNode> getChildNodeEntries(int offset, int count) {
+    public Iterator<ChildNodeEntry> getChildNodeEntries(int offset, int count) {
         return childEntries.getEntries(offset, count);
     }
 
@@ -114,23 +112,23 @@ public abstract class AbstractNode imple
 
             // delegate to ChildNodeEntries implementation
             ChildNodeEntries otherEntries = ((AbstractNode) other).childEntries;
-            for (Iterator<ChildNode> it = childEntries.getAdded(otherEntries); it.hasNext(); ) {
+            for (Iterator<ChildNodeEntry> it = childEntries.getAdded(otherEntries); it.hasNext(); ) {
                 handler.childNodeAdded(it.next());
             }
-            for (Iterator<ChildNode> it = childEntries.getRemoved(otherEntries); it.hasNext(); ) {
+            for (Iterator<ChildNodeEntry> it = childEntries.getRemoved(otherEntries); it.hasNext(); ) {
                 handler.childNodeDeleted(it.next());
             }
-            for (Iterator<ChildNode> it = childEntries.getModified(otherEntries); it.hasNext(); ) {
-                ChildNode old = it.next();
-                ChildNode modified = otherEntries.get(old.getName());
+            for (Iterator<ChildNodeEntry> it = childEntries.getModified(otherEntries); it.hasNext(); ) {
+                ChildNodeEntry old = it.next();
+                ChildNodeEntry modified = otherEntries.get(old.getName());
                 handler.childNodeChanged(old, modified.getId());
             }
             return;
         }
 
-        for (Iterator<ChildNode> it = getChildNodeEntries(0, -1); it.hasNext(); ) {
-            ChildNode child = it.next();
-            ChildNode newChild = other.getChildNodeEntry(child.getName());
+        for (Iterator<ChildNodeEntry> it = getChildNodeEntries(0, -1); it.hasNext(); ) {
+            ChildNodeEntry child = it.next();
+            ChildNodeEntry newChild = other.getChildNodeEntry(child.getName());
             if (newChild == null) {
                 handler.childNodeDeleted(child);
             } else {
@@ -139,8 +137,8 @@ public abstract class AbstractNode imple
                 }
             }
         }
-        for (Iterator<ChildNode> it = other.getChildNodeEntries(0, -1); it.hasNext(); ) {
-            ChildNode child = it.next();
+        for (Iterator<ChildNodeEntry> it = other.getChildNodeEntries(0, -1); it.hasNext(); ) {
+            ChildNodeEntry child = it.next();
             if (getChildNodeEntry(child.getName()) == null) {
                 handler.childNodeAdded(child);
             }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntries.java Thu Jul  5 15:25:25 2012
@@ -35,19 +35,19 @@ public interface ChildNodeEntries extend
 
     int getCount();
 
-    ChildNode get(String name);
+    ChildNodeEntry get(String name);
 
     Iterator<String> getNames(int offset, int count);
 
-    Iterator<ChildNode> getEntries(int offset, int count);
+    Iterator<ChildNodeEntry> getEntries(int offset, int count);
 
     //------------------------------------------------------------< write ops >
 
-    ChildNode add(ChildNode entry);
+    ChildNodeEntry add(ChildNodeEntry entry);
 
-    ChildNode remove(String name);
+    ChildNodeEntry remove(String name);
 
-    ChildNode rename(String oldName, String newName);
+    ChildNodeEntry rename(String oldName, String newName);
 
     //-------------------------------------------------------------< diff ops >
 
@@ -58,7 +58,7 @@ public interface ChildNodeEntries extend
      * @param other
      * @return
      */
-    Iterator<ChildNode> getAdded(final ChildNodeEntries other);
+    Iterator<ChildNodeEntry> getAdded(final ChildNodeEntries other);
 
     /**
      * Returns those entries that exist in {@code this} but not in
@@ -67,7 +67,7 @@ public interface ChildNodeEntries extend
      * @param other
      * @return
      */
-    Iterator<ChildNode> getRemoved(final ChildNodeEntries other);
+    Iterator<ChildNodeEntry> getRemoved(final ChildNodeEntries other);
 
     /**
      * Returns {@code this} instance's entries that have namesakes in
@@ -76,7 +76,7 @@ public interface ChildNodeEntries extend
      * @param other
      * @return
      */
-    Iterator<ChildNode> getModified(final ChildNodeEntries other);
+    Iterator<ChildNodeEntry> getModified(final ChildNodeEntries other);
 
     //------------------------------------------------< serialization support >
 

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesMap.java Thu Jul  5 15:25:25 2012
@@ -31,15 +31,15 @@ import java.util.Map;
  */
 public class ChildNodeEntriesMap implements ChildNodeEntries {
 
-    protected static final List<ChildNode> EMPTY = Collections.emptyList();
+    protected static final List<ChildNodeEntry> EMPTY = Collections.emptyList();
     
-    protected HashMap<String, ChildNode> entries = new HashMap<String, ChildNode>();
+    protected HashMap<String, ChildNodeEntry> entries = new HashMap<String, ChildNodeEntry>();
 
     ChildNodeEntriesMap() {
     }
 
     ChildNodeEntriesMap(ChildNodeEntriesMap other) {
-        entries = (HashMap<String, ChildNode>) other.entries.clone();
+        entries = (HashMap<String, ChildNodeEntry>) other.entries.clone();
     }
 
     //------------------------------------------------------------< overrides >
@@ -60,7 +60,7 @@ public class ChildNodeEntriesMap impleme
         } catch (CloneNotSupportedException e) {
             // can't possibly get here
         }
-        clone.entries = (HashMap<String, ChildNode>) entries.clone();
+        clone.entries = (HashMap<String, ChildNodeEntry>) entries.clone();
         return clone;
     }
 
@@ -77,7 +77,7 @@ public class ChildNodeEntriesMap impleme
     }
 
     @Override
-    public ChildNode get(String name) {
+    public ChildNodeEntry get(String name) {
         return entries.get(name);
     }
 
@@ -102,7 +102,7 @@ public class ChildNodeEntriesMap impleme
     }
 
     @Override
-    public Iterator<ChildNode> getEntries(int offset, int count) {
+    public Iterator<ChildNodeEntry> getEntries(int offset, int count) {
         if (offset < 0 || count < -1) {
             throw new IllegalArgumentException();
         }
@@ -115,38 +115,38 @@ public class ChildNodeEntriesMap impleme
             if (count == -1 || (offset + count) > entries.size()) {
                 count = entries.size() - offset;
             }
-            return new RangeIterator<ChildNode>(entries.values().iterator(), offset, count);
+            return new RangeIterator<ChildNodeEntry>(entries.values().iterator(), offset, count);
         }
     }
 
     //------------------------------------------------------------< write ops >
 
     @Override
-    public ChildNode add(ChildNode entry) {
+    public ChildNodeEntry add(ChildNodeEntry entry) {
         return entries.put(entry.getName(), entry);
     }
 
     @Override
-    public ChildNode remove(String name) {
+    public ChildNodeEntry remove(String name) {
         return entries.remove(name);
     }
 
     @Override
-    public ChildNode rename(String oldName, String newName) {
+    public ChildNodeEntry rename(String oldName, String newName) {
         if (oldName.equals(newName)) {
             return entries.get(oldName);
         }
         if (entries.get(oldName) == null) {
             return null;
         }
-        HashMap<String, ChildNode> clone =
-                (HashMap<String, ChildNode>) entries.clone();
+        HashMap<String, ChildNodeEntry> clone =
+                (HashMap<String, ChildNodeEntry>) entries.clone();
         entries.clear();
-        ChildNode oldCNE = null;
-        for (Map.Entry<String, ChildNode> entry : clone.entrySet()) {
+        ChildNodeEntry oldCNE = null;
+        for (Map.Entry<String, ChildNodeEntry> entry : clone.entrySet()) {
             if (entry.getKey().equals(oldName)) {
                 oldCNE = entry.getValue();
-                entries.put(newName, new ChildNode(newName, oldCNE.getId()));
+                entries.put(newName, new ChildNodeEntry(newName, oldCNE.getId()));
             } else {
                 entries.put(entry.getKey(), entry.getValue());
             }
@@ -157,31 +157,31 @@ public class ChildNodeEntriesMap impleme
     //-------------------------------------------------------------< diff ops >
 
     @Override
-    public Iterator<ChildNode> getAdded(final ChildNodeEntries other) {
-        return new AbstractFilteringIterator<ChildNode>(other.getEntries(0, -1)) {
+    public Iterator<ChildNodeEntry> getAdded(final ChildNodeEntries other) {
+        return new AbstractFilteringIterator<ChildNodeEntry>(other.getEntries(0, -1)) {
             @Override
-            protected boolean include(ChildNode entry) {
+            protected boolean include(ChildNodeEntry entry) {
                 return !entries.containsKey(entry.getName());
             }
         };
     }
 
     @Override
-    public Iterator<ChildNode> getRemoved(final ChildNodeEntries other) {
-        return new AbstractFilteringIterator<ChildNode>(entries.values().iterator()) {
+    public Iterator<ChildNodeEntry> getRemoved(final ChildNodeEntries other) {
+        return new AbstractFilteringIterator<ChildNodeEntry>(entries.values().iterator()) {
             @Override
-            protected boolean include(ChildNode entry) {
+            protected boolean include(ChildNodeEntry entry) {
                 return other.get(entry.getName()) == null;
             }
         };
     }
 
     @Override
-    public Iterator<ChildNode> getModified(final ChildNodeEntries other) {
-        return new AbstractFilteringIterator<ChildNode>(getEntries(0, -1)) {
+    public Iterator<ChildNodeEntry> getModified(final ChildNodeEntries other) {
+        return new AbstractFilteringIterator<ChildNodeEntry>(getEntries(0, -1)) {
             @Override
-            protected boolean include(ChildNode entry) {
-                ChildNode namesake = other.get(entry.getName());
+            protected boolean include(ChildNodeEntry entry) {
+                ChildNodeEntry namesake = other.get(entry.getName());
                 return (namesake != null && !namesake.getId().equals(entry.getId()));
             }
         };
@@ -191,7 +191,7 @@ public class ChildNodeEntriesMap impleme
 
     @Override
     public void serialize(Binding binding) throws Exception {
-        final Iterator<ChildNode> iter = getEntries(0, -1);
+        final Iterator<ChildNodeEntry> iter = getEntries(0, -1);
         binding.writeMap(":children", getCount(),
                 new Binding.BytesEntryIterator() {
                     @Override
@@ -200,7 +200,7 @@ public class ChildNodeEntriesMap impleme
                     }
                     @Override
                     public Binding.BytesEntry next() {
-                        ChildNode cne = iter.next();
+                        ChildNodeEntry cne = iter.next();
                         return new Binding.BytesEntry(cne.getName(), cne.getId().getBytes());
                     }
                     @Override
@@ -215,7 +215,7 @@ public class ChildNodeEntriesMap impleme
         Binding.BytesEntryIterator iter = binding.readBytesMap(":children");
         while (iter.hasNext()) {
             Binding.BytesEntry entry = iter.next();
-            newInstance.add(new ChildNode(entry.getKey(), new Id(entry.getValue())));
+            newInstance.add(new ChildNodeEntry(entry.getKey(), new Id(entry.getValue())));
         }
         return newInstance;
     }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntriesTree.java Thu Jul  5 15:25:25 2012
@@ -34,7 +34,7 @@ import java.util.NoSuchElementException;
  */
 public class ChildNodeEntriesTree implements ChildNodeEntries {
 
-    protected static final List<ChildNode> EMPTY = Collections.emptyList();
+    protected static final List<ChildNodeEntry> EMPTY = Collections.emptyList();
     
     protected int count;
     
@@ -87,13 +87,13 @@ public class ChildNodeEntriesTree implem
     }
 
     @Override
-    public ChildNode get(String name) {
+    public ChildNodeEntry get(String name) {
         IndexEntry entry = index[keyToIndex(name)];
         if (entry == null) {
             return null;
         }
-        if (entry instanceof ChildNode) {
-            ChildNode cne = (ChildNode) entry;
+        if (entry instanceof ChildNodeEntry) {
+            ChildNodeEntry cne = (ChildNodeEntry) entry;
             return cne.getName().equals(name) ? cne : null;
         } else if (entry instanceof BucketInfo) {
             BucketInfo bi = (BucketInfo) entry;
@@ -124,14 +124,14 @@ public class ChildNodeEntriesTree implem
         return new AbstractRangeIterator<String>(getEntries(offset, cnt), 0, -1) {
             @Override
             protected String doNext() {
-                ChildNode cne = (ChildNode) it.next();
+                ChildNodeEntry cne = (ChildNodeEntry) it.next();
                 return cne.getName();
             }
         };
     }
 
     @Override
-    public Iterator<ChildNode> getEntries(int offset, int cnt) {
+    public Iterator<ChildNodeEntry> getEntries(int offset, int cnt) {
         if (offset < 0 || cnt < -1) {
             throw new IllegalArgumentException();
         }
@@ -144,7 +144,7 @@ public class ChildNodeEntriesTree implem
         if (cnt == -1 || (offset + cnt) > count) {
             cnt = count - offset;
         }
-        ArrayList<ChildNode> list = new ArrayList<ChildNode>(cnt);
+        ArrayList<ChildNodeEntry> list = new ArrayList<ChildNodeEntry>(cnt);
         for (IndexEntry e : index) {
             if (e != null) {
                 if (skipped + e.getSize() <= offset) {
@@ -155,7 +155,7 @@ public class ChildNodeEntriesTree implem
                     } else if (e instanceof BucketInfo) {
                         BucketInfo bi = (BucketInfo) e;
                         ChildNodeEntries bucket = retrieveBucket(bi.getId());
-                        for (Iterator<ChildNode> it =
+                        for (Iterator<ChildNodeEntry> it =
                                      bucket.getEntries(offset - skipped, cnt - list.size());
                              it.hasNext(); ) {
                             list.add(it.next());
@@ -164,7 +164,7 @@ public class ChildNodeEntriesTree implem
                     } else {
                         // dirty bucket
                         Bucket bucket = (Bucket) e;
-                        for (Iterator<ChildNode> it =
+                        for (Iterator<ChildNodeEntry> it =
                                      bucket.getEntries(offset - skipped, cnt - list.size());
                              it.hasNext(); ) {
                             list.add(it.next());
@@ -184,7 +184,7 @@ public class ChildNodeEntriesTree implem
     //------------------------------------------------------------< write ops >
 
     @Override
-    public ChildNode add(ChildNode entry) {
+    public ChildNodeEntry add(ChildNodeEntry entry) {
         int idx = keyToIndex(entry.getName());
         IndexEntry ie = index[idx];
         if (ie == null) {
@@ -192,8 +192,8 @@ public class ChildNodeEntriesTree implem
             count++;
             return null;
         }
-        if (ie instanceof ChildNode) {
-            ChildNode existing = (ChildNode) ie;
+        if (ie instanceof ChildNodeEntry) {
+            ChildNodeEntry existing = (ChildNodeEntry) ie;
             if (existing.getName().equals(entry.getName())) {
                 index[idx] = new NodeInfo(entry.getName(), entry.getId());
                 return existing;
@@ -216,7 +216,7 @@ public class ChildNodeEntriesTree implem
             bucket = (Bucket) ie;
         }
 
-        ChildNode existing = bucket.add(entry);
+        ChildNodeEntry existing = bucket.add(entry);
         if (entry.equals(existing)) {
             // no-op
             return existing;
@@ -230,14 +230,14 @@ public class ChildNodeEntriesTree implem
     }
 
     @Override
-    public ChildNode remove(String name) {
+    public ChildNodeEntry remove(String name) {
         int idx = keyToIndex(name);
         IndexEntry ie = index[idx];
         if (ie == null) {
             return null;
         }
-        if (ie instanceof ChildNode) {
-            ChildNode existing = (ChildNode) ie;
+        if (ie instanceof ChildNodeEntry) {
+            ChildNodeEntry existing = (ChildNodeEntry) ie;
             if (existing.getName().equals(name)) {
                 index[idx] = null;
                 count--;
@@ -256,7 +256,7 @@ public class ChildNodeEntriesTree implem
             bucket = (Bucket) ie;
         }
 
-        ChildNode existing = bucket.remove(name);
+        ChildNodeEntry existing = bucket.remove(name);
         if (existing == null) {
             return null;
         }
@@ -264,7 +264,7 @@ public class ChildNodeEntriesTree implem
             index[idx] = null;
         } else if (bucket.getCount() == 1) {
             // inline single remaining entry
-            ChildNode remaining = bucket.getEntries(0, 1).next();
+            ChildNodeEntry remaining = bucket.getEntries(0, 1).next();
             index[idx] = new NodeInfo(remaining.getName(), remaining.getId());
         } else {
             index[idx] = bucket;
@@ -274,24 +274,24 @@ public class ChildNodeEntriesTree implem
     }
 
     @Override
-    public ChildNode rename(String oldName, String newName) {
+    public ChildNodeEntry rename(String oldName, String newName) {
         if (oldName.equals(newName)) {
             return get(oldName);
         }
-        ChildNode old = remove(oldName);
+        ChildNodeEntry old = remove(oldName);
         if (old == null) {
             return null;
         }
-        add(new ChildNode(newName, old.getId()));
+        add(new ChildNodeEntry(newName, old.getId()));
         return old;
     }
 
     //-------------------------------------------------------------< diff ops >
 
     @Override
-    public Iterator<ChildNode> getAdded(final ChildNodeEntries other) {
+    public Iterator<ChildNodeEntry> getAdded(final ChildNodeEntries other) {
         if (other instanceof ChildNodeEntriesTree) {
-            List<ChildNode> added = new ArrayList<ChildNode>();
+            List<ChildNodeEntry> added = new ArrayList<ChildNodeEntry>();
             ChildNodeEntriesTree otherEntries = (ChildNodeEntriesTree) other;
             for (int i = 0; i < index.length; i++) {
                 IndexEntry ie1 = index[i];
@@ -301,18 +301,18 @@ public class ChildNodeEntriesTree implem
                     if (ie1 == null) {
                         // this index entry in null => other must be non-null
                         if (ie2 instanceof NodeInfo) {
-                            added.add((ChildNode) ie2);    
+                            added.add((ChildNodeEntry) ie2);
                         } else if (ie2 instanceof BucketInfo) {
                             BucketInfo bi = (BucketInfo) ie2;
                             ChildNodeEntries bucket = retrieveBucket(bi.getId());
-                            for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
+                            for (Iterator<ChildNodeEntry> it = bucket.getEntries(0, -1);
                                  it.hasNext(); ) {
                                 added.add(it.next());
                             }
                         } else {
                             // dirty bucket
                             Bucket bucket = (Bucket) ie2;
-                            for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
+                            for (Iterator<ChildNodeEntry> it = bucket.getEntries(0, -1);
                                  it.hasNext(); ) {
                                 added.add(it.next());
                             }
@@ -322,7 +322,7 @@ public class ChildNodeEntriesTree implem
                         ChildNodeEntriesMap bucket1;
                         if (ie1 instanceof NodeInfo) {
                             bucket1 = new ChildNodeEntriesMap();
-                            bucket1.add((ChildNode) ie1);
+                            bucket1.add((ChildNodeEntry) ie1);
                         } else if (ie1 instanceof BucketInfo) {
                             BucketInfo bi = (BucketInfo) ie1;
                             bucket1 = retrieveBucket(bi.getId());
@@ -333,7 +333,7 @@ public class ChildNodeEntriesTree implem
                         ChildNodeEntriesMap bucket2;
                         if (ie2 instanceof NodeInfo) {
                             bucket2 = new ChildNodeEntriesMap();
-                            bucket2.add((ChildNode) ie2);
+                            bucket2.add((ChildNodeEntry) ie2);
                         } else if (ie2 instanceof BucketInfo) {
                             BucketInfo bi = (BucketInfo) ie2;
                             bucket2 = retrieveBucket(bi.getId());
@@ -342,7 +342,7 @@ public class ChildNodeEntriesTree implem
                             bucket2 = (Bucket) ie2;
                         }
 
-                        for (Iterator<ChildNode> it = bucket1.getAdded(bucket2);
+                        for (Iterator<ChildNodeEntry> it = bucket1.getAdded(bucket2);
                              it.hasNext(); ) {
                             added.add(it.next());
                         }
@@ -352,9 +352,9 @@ public class ChildNodeEntriesTree implem
             return added.iterator();
         } else {
             // todo optimize
-            return new AbstractFilteringIterator<ChildNode>(other.getEntries(0, -1)) {
+            return new AbstractFilteringIterator<ChildNodeEntry>(other.getEntries(0, -1)) {
                 @Override
-                protected boolean include(ChildNode entry) {
+                protected boolean include(ChildNodeEntry entry) {
                     return get(entry.getName()) == null;
                 }
             };
@@ -362,9 +362,9 @@ public class ChildNodeEntriesTree implem
     }
 
     @Override
-    public Iterator<ChildNode> getRemoved(final ChildNodeEntries other) {
+    public Iterator<ChildNodeEntry> getRemoved(final ChildNodeEntries other) {
         if (other instanceof ChildNodeEntriesTree) {
-            List<ChildNode> removed = new ArrayList<ChildNode>();
+            List<ChildNodeEntry> removed = new ArrayList<ChildNodeEntry>();
             ChildNodeEntriesTree otherEntries = (ChildNodeEntriesTree) other;
             for (int i = 0; i < index.length; i++) {
                 IndexEntry ie1 = index[i];
@@ -374,18 +374,18 @@ public class ChildNodeEntriesTree implem
                     if (ie2 == null) {
                         // other index entry is null => this must be non-null
                         if (ie1 instanceof NodeInfo) {
-                            removed.add((ChildNode) ie1);
+                            removed.add((ChildNodeEntry) ie1);
                         } else if (ie1 instanceof BucketInfo) {
                             BucketInfo bi = (BucketInfo) ie1;
                             ChildNodeEntries bucket = retrieveBucket(bi.getId());
-                            for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
+                            for (Iterator<ChildNodeEntry> it = bucket.getEntries(0, -1);
                                  it.hasNext(); ) {
                                 removed.add(it.next());
                             }
                         } else {
                             // dirty bucket
                             Bucket bucket = (Bucket) ie1;
-                            for (Iterator<ChildNode> it = bucket.getEntries(0, -1);
+                            for (Iterator<ChildNodeEntry> it = bucket.getEntries(0, -1);
                                  it.hasNext(); ) {
                                 removed.add(it.next());
                             }
@@ -395,7 +395,7 @@ public class ChildNodeEntriesTree implem
                         ChildNodeEntriesMap bucket1;
                         if (ie1 instanceof NodeInfo) {
                             bucket1 = new ChildNodeEntriesMap();
-                            bucket1.add((ChildNode) ie1);
+                            bucket1.add((ChildNodeEntry) ie1);
                         } else if (ie1 instanceof BucketInfo) {
                             BucketInfo bi = (BucketInfo) ie1;
                             bucket1 = retrieveBucket(bi.getId());
@@ -406,7 +406,7 @@ public class ChildNodeEntriesTree implem
                         ChildNodeEntriesMap bucket2;
                         if (ie2 instanceof NodeInfo) {
                             bucket2 = new ChildNodeEntriesMap();
-                            bucket2.add((ChildNode) ie2);
+                            bucket2.add((ChildNodeEntry) ie2);
                         } else if (ie2 instanceof BucketInfo) {
                             BucketInfo bi = (BucketInfo) ie2;
                             bucket2 = retrieveBucket(bi.getId());
@@ -415,7 +415,7 @@ public class ChildNodeEntriesTree implem
                             bucket2 = (Bucket) ie2;
                         }
 
-                        for (Iterator<ChildNode> it = bucket1.getRemoved(bucket2);
+                        for (Iterator<ChildNodeEntry> it = bucket1.getRemoved(bucket2);
                              it.hasNext(); ) {
                             removed.add(it.next());
                         }
@@ -425,9 +425,9 @@ public class ChildNodeEntriesTree implem
             return removed.iterator();
         } else {
             // todo optimize
-            return new AbstractFilteringIterator<ChildNode>(getEntries(0, -1)) {
+            return new AbstractFilteringIterator<ChildNodeEntry>(getEntries(0, -1)) {
                 @Override
-                protected boolean include(ChildNode entry) {
+                protected boolean include(ChildNodeEntry entry) {
                     return other.get(entry.getName()) == null;
                 }
             };
@@ -435,9 +435,9 @@ public class ChildNodeEntriesTree implem
     }
 
     @Override
-    public Iterator<ChildNode> getModified(final ChildNodeEntries other) {
+    public Iterator<ChildNodeEntry> getModified(final ChildNodeEntries other) {
         if (other instanceof ChildNodeEntriesTree) {
-            List<ChildNode> modified = new ArrayList<ChildNode>();
+            List<ChildNodeEntry> modified = new ArrayList<ChildNodeEntry>();
             ChildNodeEntriesTree otherEntries = (ChildNodeEntriesTree) other;
             for (int i = 0; i < index.length; i++) {
                 IndexEntry ie1 = index[i];
@@ -458,7 +458,7 @@ public class ChildNodeEntriesTree implem
                     ChildNodeEntriesMap bucket1;
                     if (ie1 instanceof NodeInfo) {
                         bucket1 = new ChildNodeEntriesMap();
-                        bucket1.add((ChildNode) ie1);
+                        bucket1.add((ChildNodeEntry) ie1);
                     } else if (ie1 instanceof BucketInfo) {
                         BucketInfo bi = (BucketInfo) ie1;
                         bucket1 = retrieveBucket(bi.getId());
@@ -469,7 +469,7 @@ public class ChildNodeEntriesTree implem
                     ChildNodeEntriesMap bucket2;
                     if (ie2 instanceof NodeInfo) {
                         bucket2 = new ChildNodeEntriesMap();
-                        bucket2.add((ChildNode) ie2);
+                        bucket2.add((ChildNodeEntry) ie2);
                     } else if (ie2 instanceof BucketInfo) {
                         BucketInfo bi = (BucketInfo) ie2;
                         bucket2 = retrieveBucket(bi.getId());
@@ -478,7 +478,7 @@ public class ChildNodeEntriesTree implem
                         bucket2 = (Bucket) ie2;
                     }
 
-                    for (Iterator<ChildNode> it = bucket1.getModified(bucket2);
+                    for (Iterator<ChildNodeEntry> it = bucket1.getModified(bucket2);
                          it.hasNext(); ) {
                         modified.add(it.next());
                     }
@@ -487,10 +487,10 @@ public class ChildNodeEntriesTree implem
 
             return modified.iterator();
         } else {
-            return new AbstractFilteringIterator<ChildNode>(getEntries(0, -1)) {
+            return new AbstractFilteringIterator<ChildNodeEntry>(getEntries(0, -1)) {
                 @Override
-                protected boolean include(ChildNode entry) {
-                    ChildNode namesake = other.get(entry.getName());
+                protected boolean include(ChildNodeEntry entry) {
+                    ChildNodeEntry namesake = other.get(entry.getName());
                     return (namesake != null && !namesake.getId().equals(entry.getId()));
                 }
             };
@@ -667,7 +667,7 @@ public class ChildNodeEntriesTree implem
         }
     }
 
-    protected static class NodeInfo extends ChildNode implements IndexEntry {
+    protected static class NodeInfo extends ChildNodeEntry implements IndexEntry {
 
         public NodeInfo(String name, Id id) {
             super(name, id);

Added: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java?rev=1357678&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java (added)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java Thu Jul  5 15:25:25 2012
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.mk.model;
+
+/**
+ *
+ */
+public class ChildNodeEntry {
+
+    private final String name;
+    private final Id id;
+
+    public ChildNodeEntry(String name, Id id) {
+        this.name = name;
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public Id getId() {
+        return id;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj instanceof ChildNodeEntry) {
+            ChildNodeEntry other = (ChildNodeEntry) obj;
+            return (name == null ? other.name == null : name.equals(other.name)
+                    && id == null ? other.id == null : id.equals(other.id));
+        }
+        return false;
+    }
+}

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/CommitBuilder.java Thu Jul  5 15:25:25 2012
@@ -24,6 +24,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.jackrabbit.mk.model.tree.DiffBuilder;
+import org.apache.jackrabbit.mk.model.tree.NodeDelta;
 import org.apache.jackrabbit.mk.store.NotFoundException;
 import org.apache.jackrabbit.mk.store.RevisionStore;
 import org.apache.jackrabbit.oak.commons.PathUtils;
@@ -263,7 +265,7 @@ public class CommitBuilder {
                 if (node == null) {
                     // not yet staged, resolve id using staged parent
                     // to allow for staged move operations
-                    ChildNode cne = parent.getChildNodeEntry(name);
+                    ChildNodeEntry cne = parent.getChildNodeEntry(name);
                     if (cne == null) {
                         throw new NotFoundException(nodePath);
                     }
@@ -341,7 +343,7 @@ public class CommitBuilder {
             if (PathUtils.denotesRoot(path)) {
                 rootNodeId = id;
             } else {
-                staged.get(PathUtils.getParentPath(path)).add(new ChildNode(PathUtils.getName(path), id));
+                staged.get(PathUtils.getParentPath(path)).add(new ChildNodeEntry(PathUtils.getName(path), id));
             }
         }
         if (rootNodeId == null) {
@@ -390,10 +392,10 @@ public class CommitBuilder {
         }
 
         for (Map.Entry<String, Id> entry : ourChanges.getAddedChildNodes ().entrySet()) {
-            mergedNode.add(new ChildNode(entry.getKey(), entry.getValue()));
+            mergedNode.add(new ChildNodeEntry(entry.getKey(), entry.getValue()));
         }
         for (Map.Entry<String, Id> entry : ourChanges.getChangedChildNodes ().entrySet()) {
-            mergedNode.add(new ChildNode(entry.getKey(), entry.getValue()));
+            mergedNode.add(new ChildNodeEntry(entry.getKey(), entry.getValue()));
         }
         for (String name : ourChanges.getRemovedChildNodes().keySet()) {
             mergedNode.remove(name);
@@ -508,7 +510,7 @@ public class CommitBuilder {
             newChild.getProperties().putAll(node.props);
 
             // id will be computed on commit
-            modParent.add(new ChildNode(name, null));
+            modParent.add(new ChildNodeEntry(name, null));
             staged.put(newPath, newChild);
 
             for (String childName : node.nodes.keySet()) {
@@ -576,7 +578,7 @@ public class CommitBuilder {
                     throw new NotFoundException(srcPath);
                 }
             } else {
-                ChildNode srcCNE = srcParent.remove(srcNodeName);
+                ChildNodeEntry srcCNE = srcParent.remove(srcNodeName);
                 if (srcCNE == null) {
                     throw new NotFoundException(srcPath);
                 }
@@ -585,7 +587,7 @@ public class CommitBuilder {
                 if (destParent.getChildNodeEntry(destNodeName) != null) {
                     throw new Exception("node already exists at move destination path: " + destPath);
                 }
-                destParent.add(new ChildNode(destNodeName, srcCNE.getId()));
+                destParent.add(new ChildNodeEntry(destNodeName, srcCNE.getId()));
             }
 
             // update staging area
@@ -618,7 +620,7 @@ public class CommitBuilder {
             String destNodeName = PathUtils.getName(destPath);
 
             MutableNode srcParent = getOrCreateStagedNode(srcParentPath);
-            ChildNode srcCNE = srcParent.getChildNodeEntry(srcNodeName);
+            ChildNodeEntry srcCNE = srcParent.getChildNodeEntry(srcNodeName);
             if (srcCNE == null) {
                 throw new NotFoundException(srcPath);
             }
@@ -631,7 +633,7 @@ public class CommitBuilder {
             }
 
             MutableNode destParent = getOrCreateStagedNode(destParentPath);
-            destParent.add(new ChildNode(destNodeName, srcCNE.getId()));
+            destParent.add(new ChildNodeEntry(destNodeName, srcCNE.getId()));
 
         }
 

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/MutableNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/MutableNode.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/MutableNode.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/MutableNode.java Thu Jul  5 15:25:25 2012
@@ -44,12 +44,12 @@ public class MutableNode extends Abstrac
         this.path = path;
     }
 
-    public ChildNode add(ChildNode newEntry) {
-        ChildNode existing = childEntries.add(newEntry);
+    public ChildNodeEntry add(ChildNodeEntry newEntry) {
+        ChildNodeEntry existing = childEntries.add(newEntry);
         if (childEntries.getCount() > ChildNodeEntries.CAPACITY_THRESHOLD
                 && childEntries.inlined()) {
             ChildNodeEntries entries = new ChildNodeEntriesTree(provider);
-            Iterator<ChildNode> iter = childEntries.getEntries(0, -1);
+            Iterator<ChildNodeEntry> iter = childEntries.getEntries(0, -1);
             while (iter.hasNext()) {
                 entries.add(iter.next());
             }
@@ -58,11 +58,11 @@ public class MutableNode extends Abstrac
         return existing;
     }
     
-    public ChildNode remove(String name) {
+    public ChildNodeEntry remove(String name) {
         return childEntries.remove(name);
     }
 
-    public ChildNode rename(String oldName, String newName) {
+    public ChildNodeEntry rename(String oldName, String newName) {
         return childEntries.rename(oldName, newName);
     }
 

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/Node.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/Node.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/Node.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/Node.java Thu Jul  5 15:25:25 2012
@@ -28,12 +28,12 @@ public interface Node {
 
     Map<String, String> getProperties();
     
-    ChildNode getChildNodeEntry(String name);
+    ChildNodeEntry getChildNodeEntry(String name);
 
     Iterator<String> getChildNodeNames(int offset, int count);
     int getChildNodeCount();
     
-    Iterator<ChildNode> getChildNodeEntries(int offset, int count);
+    Iterator<ChildNodeEntry> getChildNodeEntries(int offset, int count);
 
     void diff(Node other, NodeDiffHandler handler);
 

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDiffHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDiffHandler.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDiffHandler.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDiffHandler.java Thu Jul  5 15:25:25 2012
@@ -27,9 +27,9 @@ public interface NodeDiffHandler {
 
     void propDeleted(String propName, String value);
 
-    void childNodeAdded(ChildNode added);
+    void childNodeAdded(ChildNodeEntry added);
 
-    void childNodeDeleted(ChildNode deleted);
+    void childNodeDeleted(ChildNodeEntry deleted);
 
-    void childNodeChanged(ChildNode changed, Id newId);
+    void childNodeChanged(ChildNodeEntry changed, Id newId);
 }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/StoredNode.java Thu Jul  5 15:25:25 2012
@@ -36,7 +36,7 @@ public class StoredNode extends Abstract
         this.id = id;
     }
     
-    public StoredNode(Id id, RevisionProvider provider, Map<String, String> properties, Iterator<ChildNode> cneIt) {
+    public StoredNode(Id id, RevisionProvider provider, Map<String, String> properties, Iterator<ChildNodeEntry> cneIt) {
         super(provider);
         this.id = id;
         this.properties.putAll(properties);
@@ -58,8 +58,8 @@ public class StoredNode extends Abstract
         return Collections.unmodifiableMap(properties);
     }
 
-    public Iterator<ChildNode> getChildNodeEntries(int offset, int count) {
-        return new UnmodifiableIterator<ChildNode>(super.getChildNodeEntries(offset, count));
+    public Iterator<ChildNodeEntry> getChildNodeEntries(int offset, int count) {
+        return new UnmodifiableIterator<ChildNodeEntry>(super.getChildNodeEntries(offset, count));
     }
 
     public Iterator<String> getChildNodeNames(int offset, int count) {

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractChildNode.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractChildNodeEntry.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractChildNode.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractChildNode.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractChildNodeEntry.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractChildNodeEntry.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractChildNode.java Thu Jul  5 15:25:25 2012
@@ -14,15 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
 
 /**
- * Abstract base class for {@link ChildNodeEntry} implementations.
+ * Abstract base class for {@link ChildNode} implementations.
  * This base class contains default implementations of the
  * {@link #equals(Object)} and {@link #hashCode()} methods based on
  * the implemented interface.
  */
-public abstract class AbstractChildNodeEntry implements ChildNodeEntry {
+public abstract class AbstractChildNode implements ChildNode {
 
     /**
      * Checks whether the given object is equal to this one. Two child node
@@ -38,8 +38,8 @@ public abstract class AbstractChildNodeE
     public boolean equals(Object that) {
         if (this == that) {
             return true;
-        } else if (that instanceof ChildNodeEntry) {
-            ChildNodeEntry other = (ChildNodeEntry) that;
+        } else if (that instanceof ChildNode) {
+            ChildNode other = (ChildNode) that;
             return getName().equals(other.getName())
                     && getNode().equals(other.getNode());
         } else {
@@ -52,7 +52,7 @@ public abstract class AbstractChildNodeE
      * Returns a hash code that's compatible with how the
      * {@link #equals(Object)} method is implemented. The current
      * implementation simply returns the hash code of the child node name
-     * since {@link ChildNodeEntry} instances are not intended for use as
+     * since {@link ChildNode} instances are not intended for use as
      * hash keys.
      *
      * @return hash code

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractChildNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNodeState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNodeState.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractNodeState.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java Thu Jul  5 15:25:25 2012
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
+
+import org.apache.jackrabbit.mk.model.PropertyState;
 
 /**
  * Abstract base class for {@link NodeState} implementations.
@@ -53,7 +55,7 @@ public abstract class AbstractNodeState 
 
     @Override
     public NodeState getChildNode(String name) {
-        for (ChildNodeEntry entry : getChildNodeEntries(0, -1)) {
+        for (ChildNode entry : getChildNodeEntries(0, -1)) {
             if (name.equals(entry.getName())) {
                 return entry.getNode();
             }
@@ -65,7 +67,7 @@ public abstract class AbstractNodeState 
     @SuppressWarnings("unused")
     public long getChildNodeCount() {
         long count = 0;
-        for (ChildNodeEntry entry : getChildNodeEntries(0, -1)) {
+        for (ChildNode entry : getChildNodeEntries(0, -1)) {
             count++;
         }
         return count;
@@ -103,7 +105,7 @@ public abstract class AbstractNodeState 
         }
 
         long childNodeCount = 0;
-        for (ChildNodeEntry entry : getChildNodeEntries(0, -1)) {
+        for (ChildNode entry : getChildNodeEntries(0, -1)) {
             if (!entry.getNode().equals(other.getChildNode(entry.getName()))) {
                 return false;
             }

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractNodeState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractPropertyState.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractPropertyState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractPropertyState.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractPropertyState.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractPropertyState.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/AbstractPropertyState.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractPropertyState.java Thu Jul  5 15:25:25 2012
@@ -14,10 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
+
+import org.apache.jackrabbit.mk.model.PropertyState;
 
 /**
- * Abstract base class for {@link PropertyState} implementations.
+ * Abstract base class for {@link org.apache.jackrabbit.mk.model.PropertyState} implementations.
  * This base class contains default implementations of the
  * {@link #equals(Object)} and {@link #hashCode()} methods based on
  * the implemented interface.

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/AbstractPropertyState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/ChildNode.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/ChildNode.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/ChildNode.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/ChildNodeEntry.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/ChildNode.java Thu Jul  5 15:25:25 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
 
 /**
  * TODO: document
@@ -28,7 +28,7 @@ package org.apache.jackrabbit.mk.model;
  * {@link Object#hashCode()} method should still be implemented according
  * to this equality contract.
  */
-public interface ChildNodeEntry {
+public interface ChildNode {
 
     /**
      * TODO: document

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/ChildNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/DiffBuilder.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/DiffBuilder.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/DiffBuilder.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java Thu Jul  5 15:25:25 2012
@@ -14,9 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
 
 import org.apache.jackrabbit.mk.json.JsopBuilder;
+import org.apache.jackrabbit.mk.model.PropertyState;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 
 import java.util.HashMap;
@@ -249,7 +250,7 @@ public class DiffBuilder {
         for (PropertyState property : node.getProperties()) {
             builder.key(property.getName()).encodedValue(property.getEncodedValue());
         }
-        for (ChildNodeEntry entry : node.getChildNodeEntries(0, -1)) {
+        for (ChildNode entry : node.getChildNodeEntries(0, -1)) {
             builder.key(entry.getName()).object();
             toJson(builder, entry.getNode());
             builder.endObject();

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/DiffBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeDelta.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeDelta.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeDelta.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeDelta.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeDelta.java Thu Jul  5 15:25:25 2012
@@ -14,13 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
 
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.jackrabbit.mk.model.Id;
+import org.apache.jackrabbit.mk.model.PropertyState;
 import org.apache.jackrabbit.mk.store.RevisionProvider;
 
 /**

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeDelta.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeState.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeState.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeState.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeState.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeState.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeState.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeState.java Thu Jul  5 15:25:25 2012
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
+
+import org.apache.jackrabbit.mk.model.PropertyState;
 
 /**
  * A content tree consists of nodes and properties, each of which
@@ -142,7 +144,7 @@ public interface NodeState {
     long getChildNodeCount();
 
     /**
-     * Returns an iterable of the child node entries starting from the
+     * Returns an Iterable of the child node entries starting from the
      * given offset. Multiple iterations are guaranteed to return the
      * child nodes in the same order, but the specific order used is
      * implementation-dependent and may change across different states
@@ -154,6 +156,6 @@ public interface NodeState {
      *               or -1 for all remaining entries
      * @return requested child node entries in some stable order
      */
-    Iterable<? extends ChildNodeEntry> getChildNodeEntries(long offset, int count);
+    Iterable<? extends ChildNode> getChildNodeEntries(long offset, int count);
 
 }

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeState.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStateDiff.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStateDiff.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStateDiff.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStateDiff.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStateDiff.java Thu Jul  5 15:25:25 2012
@@ -14,7 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
+
+import org.apache.jackrabbit.mk.model.PropertyState;
 
 /**
  * Handler of node state differences.

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStateDiff.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStore.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStore.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStore.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/NodeStore.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStore.java Thu Jul  5 15:25:25 2012
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
 
 /**
  * Storage abstraction for content trees. At any given point in time

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/NodeStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/TraversingNodeDiffHandler.java (from r1354857, jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/TraversingNodeDiffHandler.java?p2=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/TraversingNodeDiffHandler.java&p1=jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java&r1=1354857&r2=1357678&rev=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/TraversingNodeDiffHandler.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/TraversingNodeDiffHandler.java Thu Jul  5 15:25:25 2012
@@ -14,8 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.jackrabbit.mk.model;
+package org.apache.jackrabbit.mk.model.tree;
 
+import org.apache.jackrabbit.mk.model.tree.NodeState;
+import org.apache.jackrabbit.mk.model.tree.NodeStateDiff;
+import org.apache.jackrabbit.mk.model.tree.NodeStore;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 
 import java.util.Stack;

Propchange: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/model/tree/TraversingNodeDiffHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/AbstractRevisionStore.java Thu Jul  5 15:25:25 2012
@@ -19,10 +19,10 @@ package org.apache.jackrabbit.mk.store;
 import java.util.HashSet;
 import java.util.Set;
 
-import org.apache.jackrabbit.mk.model.ChildNodeEntry;
+import org.apache.jackrabbit.mk.model.tree.ChildNode;
 import org.apache.jackrabbit.mk.model.Id;
-import org.apache.jackrabbit.mk.model.NodeState;
-import org.apache.jackrabbit.mk.model.NodeStateDiff;
+import org.apache.jackrabbit.mk.model.tree.NodeState;
+import org.apache.jackrabbit.mk.model.tree.NodeStateDiff;
 import org.apache.jackrabbit.mk.model.PropertyState;
 import org.apache.jackrabbit.mk.model.StoredNode;
 
@@ -101,6 +101,8 @@ abstract class AbstractRevisionStore imp
 
     /**
      * Compares the child nodes of the given two node states.
+     * <p/>
+     * <b>Disclaimer:</b> very inefficient implementation for large sets of child node entries
      *
      * @param before node state before changes
      * @param after node state after changes
@@ -110,7 +112,7 @@ abstract class AbstractRevisionStore imp
             NodeState before, NodeState after, NodeStateDiff diff) {
         Set<String> beforeChildNodes = new HashSet<String>();
 
-        for (ChildNodeEntry beforeCNE : before.getChildNodeEntries(0, -1)) {
+        for (ChildNode beforeCNE : before.getChildNodeEntries(0, -1)) {
             String name = beforeCNE.getName();
             NodeState beforeChild = beforeCNE.getNode();
             NodeState afterChild = after.getChildNode(name);
@@ -124,7 +126,7 @@ abstract class AbstractRevisionStore imp
             }
         }
 
-        for (ChildNodeEntry afterChild : after.getChildNodeEntries(0, -1)) {
+        for (ChildNode afterChild : after.getChildNodeEntries(0, -1)) {
             String name = afterChild.getName();
             if (!beforeChildNodes.contains(name)) {
                 diff.childNodeAdded(name, afterChild.getNode());

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/DefaultRevisionStore.java Thu Jul  5 15:25:25 2012
@@ -31,15 +31,15 @@ import java.util.concurrent.atomic.Atomi
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
-import org.apache.jackrabbit.mk.model.ChildNode;
+import org.apache.jackrabbit.mk.model.ChildNodeEntry;
 import org.apache.jackrabbit.mk.model.ChildNodeEntriesMap;
 import org.apache.jackrabbit.mk.model.Id;
 import org.apache.jackrabbit.mk.model.MutableCommit;
 import org.apache.jackrabbit.mk.model.MutableNode;
 import org.apache.jackrabbit.mk.model.Node;
 import org.apache.jackrabbit.mk.model.NodeDiffHandler;
-import org.apache.jackrabbit.mk.model.NodeState;
-import org.apache.jackrabbit.mk.model.NodeStateDiff;
+import org.apache.jackrabbit.mk.model.tree.NodeState;
+import org.apache.jackrabbit.mk.model.tree.NodeStateDiff;
 import org.apache.jackrabbit.mk.model.StoredCommit;
 import org.apache.jackrabbit.mk.model.StoredNode;
 import org.apache.jackrabbit.mk.persistence.GCPersistence;
@@ -459,19 +459,19 @@ public class DefaultRevisionStore extend
             }
 
             @Override
-            public void childNodeAdded(ChildNode added) {
+            public void childNodeAdded(ChildNodeEntry added) {
                 String name = added.getName();
                 diff.childNodeAdded(name, after.getChildNode(name));
             }
 
             @Override
-            public void childNodeDeleted(ChildNode deleted) {
+            public void childNodeDeleted(ChildNodeEntry deleted) {
                 String name = deleted.getName();
                 diff.childNodeDeleted(name, before.getChildNode(name));
             }
 
             @Override
-            public void childNodeChanged(ChildNode changed, Id newId) {
+            public void childNodeChanged(ChildNodeEntry changed, Id newId) {
                 String name = changed.getName();
                 diff.childNodeChanged(name, before.getChildNode(name),
                         after.getChildNode(name));
@@ -638,9 +638,9 @@ public class DefaultRevisionStore extend
         if (!gcpm.markNode(node.getId())) {
             return;
         }
-        Iterator<ChildNode> iter = node.getChildNodeEntries(0, -1);
+        Iterator<ChildNodeEntry> iter = node.getChildNodeEntries(0, -1);
         while (iter.hasNext()) {
-            ChildNode c = iter.next();
+            ChildNodeEntry c = iter.next();
             markNode(getNode(c.getId()));
         }
     }

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/RevisionProvider.java Thu Jul  5 15:25:25 2012
@@ -18,8 +18,8 @@ package org.apache.jackrabbit.mk.store;
 
 import org.apache.jackrabbit.mk.model.ChildNodeEntriesMap;
 import org.apache.jackrabbit.mk.model.Id;
-import org.apache.jackrabbit.mk.model.NodeState;
-import org.apache.jackrabbit.mk.model.NodeStore;
+import org.apache.jackrabbit.mk.model.tree.NodeState;
+import org.apache.jackrabbit.mk.model.tree.NodeStore;
 import org.apache.jackrabbit.mk.model.StoredCommit;
 import org.apache.jackrabbit.mk.model.StoredNode;
 

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/StoredNodeAsState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/StoredNodeAsState.java?rev=1357678&r1=1357677&r2=1357678&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/StoredNodeAsState.java (original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/store/StoredNodeAsState.java Thu Jul  5 15:25:25 2012
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.mk.store;
 
-import org.apache.jackrabbit.mk.model.AbstractChildNodeEntry;
-import org.apache.jackrabbit.mk.model.AbstractNodeState;
-import org.apache.jackrabbit.mk.model.AbstractPropertyState;
-import org.apache.jackrabbit.mk.model.ChildNode;
 import org.apache.jackrabbit.mk.model.ChildNodeEntry;
+import org.apache.jackrabbit.mk.model.tree.AbstractChildNode;
+import org.apache.jackrabbit.mk.model.tree.AbstractNodeState;
+import org.apache.jackrabbit.mk.model.tree.AbstractPropertyState;
+import org.apache.jackrabbit.mk.model.tree.ChildNode;
 import org.apache.jackrabbit.mk.model.Id;
-import org.apache.jackrabbit.mk.model.NodeState;
+import org.apache.jackrabbit.mk.model.tree.NodeState;
 import org.apache.jackrabbit.mk.model.PropertyState;
 import org.apache.jackrabbit.mk.model.StoredNode;
 
@@ -115,7 +115,7 @@ class StoredNodeAsState extends Abstract
 
     @Override
     public NodeState getChildNode(String name) {
-        ChildNode entry = node.getChildNodeEntry(name);
+        ChildNodeEntry entry = node.getChildNodeEntry(name);
         if (entry != null) {
             return getChildNodeEntry(entry).getNode();
         } else {
@@ -129,25 +129,25 @@ class StoredNodeAsState extends Abstract
     }
 
     @Override
-    public Iterable<ChildNodeEntry> getChildNodeEntries(
+    public Iterable<ChildNode> getChildNodeEntries(
             final long offset, final int count) {
         if (count < -1) {
             throw new IllegalArgumentException("Illegal count: " + count);
         } else if (offset > Integer.MAX_VALUE) {
             return Collections.emptyList();
         } else {
-            return new Iterable<ChildNodeEntry>() {
+            return new Iterable<ChildNode>() {
                 @Override
-                public Iterator<ChildNodeEntry> iterator() {
-                    final Iterator<ChildNode> iterator =
+                public Iterator<ChildNode> iterator() {
+                    final Iterator<ChildNodeEntry> iterator =
                             node.getChildNodeEntries((int) offset, count);
-                    return new Iterator<ChildNodeEntry>() {
+                    return new Iterator<ChildNode>() {
                         @Override
                         public boolean hasNext() {
                             return iterator.hasNext();
                         }
                         @Override
-                        public ChildNodeEntry next() {
+                        public ChildNode next() {
                             return getChildNodeEntry(iterator.next());
                         }
                         @Override
@@ -160,9 +160,9 @@ class StoredNodeAsState extends Abstract
         }
     }
 
-    private ChildNodeEntry getChildNodeEntry(
-            final org.apache.jackrabbit.mk.model.ChildNode entry) {
-        return new AbstractChildNodeEntry() {
+    private ChildNode getChildNodeEntry(
+            final ChildNodeEntry entry) {
+        return new AbstractChildNode() {
             @Override
             public String getName() {
                 return entry.getName();



Mime
View raw message