jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1329583 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/ oak-jcr/src/main/java/org/apache/ja...
Date Tue, 24 Apr 2012 07:51:06 GMT
Author: angela
Date: Tue Apr 24 07:51:05 2012
New Revision: 1329583

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

- rename ContentTree to Tree


Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
      - copied, changed from r1329269, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentTree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelTree.java
      - copied, changed from r1329269, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelContentTree.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentTree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelContentTree.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Branch.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelBranch.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchFuzzIT.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchTest.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Branch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Branch.java?rev=1329583&r1=1329582&r2=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Branch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Branch.java
Tue Apr 24 07:51:05 2012
@@ -57,6 +57,6 @@ public interface Branch {
      * @return content tree at the given path or {@code null} if no
      * such tree exists
      */
-    ContentTree getContentTree(String path);
+    Tree getContentTree(String path);
 
 }

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
(from r1329269, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentTree.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentTree.java&r1=1329269&r2=1329583&rev=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/ContentTree.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java Tue
Apr 24 07:51:05 2012
@@ -41,7 +41,7 @@ import java.util.List;
  * reading clients see a coherent state.
  *
  */
-public interface ContentTree {
+public interface Tree {
 
     /**
      * Status of an item in a {@code ContentTree}
@@ -82,7 +82,7 @@ public interface ContentTree {
     /**
      * @return  the parent of this {@code ContentTree} instance.
      */
-    ContentTree getParent();
+    Tree getParent();
 
     /**
      * Get a property state
@@ -129,7 +129,7 @@ public interface ContentTree {
      * @return  the child with the given {@code name} or {@code null} if no such child
      * exists.
      */
-    ContentTree getChild(String name);
+    Tree getChild(String name);
 
     /**
      * Get the {@code Status} of a child tree
@@ -160,7 +160,7 @@ public interface ContentTree {
      * visible to iterators obtained from the returned iterable.
      * @return  An {@code Iterable} for all children
      */
-    Iterable<ContentTree> getChildren();
+    Iterable<Tree> getChildren();
 
     /**
      * Add a child with the given {@code name}. Does nothing if such a child
@@ -169,7 +169,7 @@ public interface ContentTree {
      * @param name name of the child
      * @return the {@code ContentTree} instance of the child with the given {@code name}.
      */
-    ContentTree addChild(String name);
+    Tree addChild(String name);
 
     /**
      * Remove a child with the given {@code name}. Does nothing if no such child exists.

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelBranch.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelBranch.java?rev=1329583&r1=1329582&r2=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelBranch.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelBranch.java
Tue Apr 24 07:51:05 2012
@@ -21,9 +21,9 @@ 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.Branch;
-import org.apache.jackrabbit.oak.api.ContentTree;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.Scalar;
-import org.apache.jackrabbit.oak.kernel.KernelContentTree.Listener;
+import org.apache.jackrabbit.oak.kernel.KernelTree.Listener;
 
 import java.util.List;
 
@@ -53,7 +53,7 @@ public class KernelBranch implements Bra
     private final NodeState base;
 
     /** Root state of this branch */
-    private final KernelContentTree root;
+    private final KernelTree root;
 
     /**
      * Create a new branch for the given base node state
@@ -61,17 +61,17 @@ public class KernelBranch implements Bra
      */
     KernelBranch(NodeState base) {
         this.base = base;
-        root = new KernelContentTree(base, changeLog);
+        root = new KernelTree(base, changeLog);
     }
 
     @Override
     public boolean move(String sourcePath, String destPath) {
-        KernelContentTree source = getTransientState(sourcePath);
+        KernelTree source = getTransientState(sourcePath);
         if (source == null) {
             return false;
         }
 
-        KernelContentTree destParent = getTransientState(getParentPath(destPath));
+        KernelTree destParent = getTransientState(getParentPath(destPath));
         String destName = getName(destPath);
         return destParent != null && source.move(destParent, destName);
 
@@ -79,19 +79,19 @@ public class KernelBranch implements Bra
 
     @Override
     public boolean copy(String sourcePath, String destPath) {
-        KernelContentTree sourceNode = getTransientState(sourcePath);
+        KernelTree sourceNode = getTransientState(sourcePath);
         if (sourceNode == null) {
             return false;
         }
 
-        KernelContentTree destParent = getTransientState(getParentPath(destPath));
+        KernelTree destParent = getTransientState(getParentPath(destPath));
         String destName = getName(destPath);
         return destParent != null && sourceNode.copy(destParent, destName);
 
     }
 
     @Override
-    public ContentTree getContentTree(String path) {
+    public Tree getContentTree(String path) {
         return getTransientState(path);
     }
 
@@ -124,11 +124,11 @@ public class KernelBranch implements Bra
      * Get a transient node state for the node identified by
      * {@code path}
      * @param path  the path to the node state
-     * @return  a {@link KernelContentTree} instance for the item
+     * @return  a {@link KernelTree} instance for the item
      *          at {@code path} or {@code null} if no such item exits.
      */
-    private KernelContentTree getTransientState(String path) {
-        KernelContentTree state = root;
+    private KernelTree getTransientState(String path) {
+        KernelTree state = root;
         for (String name : elements(path)) {
             state = state.getChild(name);
             if (state == null) {
@@ -145,7 +145,7 @@ public class KernelBranch implements Bra
      * @param name The item name.
      * @return relative path of the item {@code name}
      */
-    private static String path(ContentTree state, String name) {
+    private static String path(Tree state, String name) {
         String path = state.getPath();
         return path.isEmpty() ? name : path + '/' + name;
     }
@@ -184,38 +184,38 @@ public class KernelBranch implements Bra
         private final StringBuilder jsop = new StringBuilder();
 
         @Override
-        public void addChild(KernelContentTree tree, String name) {
+        public void addChild(KernelTree tree, String name) {
             jsop.append("+\"").append(path(tree, name)).append("\":{}");
         }
 
         @Override
-        public void removeChild(KernelContentTree tree, String name) {
+        public void removeChild(KernelTree tree, String name) {
             jsop.append("-\"").append(path(tree, name)).append('"');
         }
 
         @Override
-        public void setProperty(KernelContentTree tree, String name, Scalar value) {
+        public void setProperty(KernelTree tree, String name, Scalar value) {
             jsop.append("^\"").append(path(tree, name)).append("\":").append(encode(value));
         }
 
         @Override
-        public void setProperty(KernelContentTree tree, String name, List<Scalar> values)
{
+        public void setProperty(KernelTree tree, String name, List<Scalar> values)
{
             jsop.append("^\"").append(path(tree, name)).append("\":").append(encode(values));
         }
 
         @Override
-        public void removeProperty(KernelContentTree tree, String name) {
+        public void removeProperty(KernelTree tree, String name) {
             jsop.append("^\"").append(path(tree, name)).append("\":null");
         }
 
         @Override
-        public void move(KernelContentTree tree, String name, KernelContentTree moved) {
+        public void move(KernelTree tree, String name, KernelTree moved) {
             jsop.append(">\"").append(path(tree, name)).append("\":\"")
                     .append(moved.getPath()).append('"');
         }
 
         @Override
-        public void copy(KernelContentTree state, String name, KernelContentTree copied)
{
+        public void copy(KernelTree state, String name, KernelTree copied) {
             jsop.append("*\"").append(path(state, name)).append("\":\"")
                     .append(copied.getPath()).append('"');
         }

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelTree.java
(from r1329269, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelContentTree.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelTree.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelTree.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelContentTree.java&r1=1329269&r2=1329583&rev=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelContentTree.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelTree.java
Tue Apr 24 07:51:05 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
-import org.apache.jackrabbit.oak.api.ContentTree;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
 import org.apache.jackrabbit.oak.util.Function1;
@@ -40,7 +40,7 @@ import static org.apache.jackrabbit.oak.
 import static org.apache.jackrabbit.oak.util.Iterators.flatten;
 import static org.apache.jackrabbit.oak.util.Iterators.map;
 
-public class KernelContentTree implements ContentTree {
+public class KernelTree implements Tree {
 
     /**
      * Underlying persistent state or {@code null} if this instance represents an
@@ -49,7 +49,7 @@ public class KernelContentTree implement
     private final NodeState persistentState;
 
     /** Parent of this content tree */
-    private KernelContentTree parent;
+    private KernelTree parent;
 
     /** Name of this content tree */
     private String name;
@@ -58,12 +58,12 @@ public class KernelContentTree implement
     private final Listener listener;
 
     /** Children with underlying persistent child states */
-    private final Map<String, KernelContentTree> existingChildren =
-            new HashMap<String, KernelContentTree>();
+    private final Map<String, KernelTree> existingChildren =
+            new HashMap<String, KernelTree>();
 
     /** Transiently added children */
-    private final Map<String, KernelContentTree> addedTrees =
-            new HashMap<String, KernelContentTree>();
+    private final Map<String, KernelTree> addedTrees =
+            new HashMap<String, KernelTree>();
 
     /** Transiently removed children */
     private final Set<String> removedTrees = new HashSet<String>();
@@ -85,14 +85,14 @@ public class KernelContentTree implement
          * @param tree  parent to which a child was added
          * @param name  name of the added child
          */
-        void addChild(KernelContentTree tree, String name);
+        void addChild(KernelTree tree, String name);
 
         /**
          * The child of the given {@code name} has been removed from {@code tree}
          * @param tree  parent from which a child was removed
          * @param name  name of the removed child
          */
-        void removeChild(KernelContentTree tree, String name);
+        void removeChild(KernelTree tree, String name);
 
         /**
          * The property of the given {@code name} and {@code value} has been set.
@@ -100,7 +100,7 @@ public class KernelContentTree implement
          * @param name  name of the property
          * @param value  value of the property
          */
-        void setProperty(KernelContentTree tree, String name, Scalar value);
+        void setProperty(KernelTree tree, String name, Scalar value);
 
         /**
          * The property of the given {@code name} and {@code values} has been set.
@@ -108,14 +108,14 @@ public class KernelContentTree implement
          * @param name  name of the property
          * @param values  values of the property
          */
-        void setProperty(KernelContentTree tree, String name, List<Scalar> values);
+        void setProperty(KernelTree tree, String name, List<Scalar> values);
 
         /**
          * The property of the given {@code name} has been removed.
          * @param tree  parent on which the property was removed.
          * @param name  name of the property
          */
-        void removeProperty(KernelContentTree tree, String name);
+        void removeProperty(KernelTree tree, String name);
 
         /**
          * The child with the given {@code name} has been moved.
@@ -123,7 +123,7 @@ public class KernelContentTree implement
          * @param name  name of the moved child
          * @param moved  moved child
          */
-        void move(KernelContentTree tree, String name, KernelContentTree moved);
+        void move(KernelTree tree, String name, KernelTree moved);
 
         /**
          * The child with the given {@code name} been copied.
@@ -131,7 +131,7 @@ public class KernelContentTree implement
          * @param name  name of the copied child
          * @param copied  copied child
          */
-        void copy(KernelContentTree state, String name, KernelContentTree copied);
+        void copy(KernelTree state, String name, KernelTree copied);
     }
 
     /**
@@ -139,7 +139,7 @@ public class KernelContentTree implement
      * @param persistentState  underlying persistent state
      * @param listener  change listener
      */
-    KernelContentTree(NodeState persistentState, Listener listener) {
+    KernelTree(NodeState persistentState, Listener listener) {
         this(persistentState, null, "", listener);
     }
 
@@ -149,7 +149,7 @@ public class KernelContentTree implement
      * @param name  name of the child
      * @param listener  change listener
      */
-    private KernelContentTree(KernelContentTree parent, String name, Listener listener) {
+    private KernelTree(KernelTree parent, String name, Listener listener) {
         this(null, parent, name, listener);
     }
 
@@ -160,8 +160,8 @@ public class KernelContentTree implement
      * @param name  name of this content tree
      * @param listener  change listener
      */
-    private KernelContentTree(NodeState persistedState, KernelContentTree parent,
-            String name, Listener listener) {
+    private KernelTree(NodeState persistedState, KernelTree parent,
+                       String name, Listener listener) {
 
         this.persistentState = persistedState;
         this.parent = parent;
@@ -176,8 +176,8 @@ public class KernelContentTree implement
      * @param parent  parent of the copied tree
      * @param name  name of the copied tree
      */
-    private KernelContentTree(KernelContentTree tree, KernelContentTree parent,
-            String name) {
+    private KernelTree(KernelTree tree, KernelTree parent,
+                       String name) {
 
         listener = tree.listener;
         persistentState = tree.persistentState;
@@ -185,17 +185,17 @@ public class KernelContentTree implement
         this.name = name;
 
         // recursively copy all existing children
-        for (Entry<String, KernelContentTree> existing : tree.existingChildren.entrySet())
{
+        for (Entry<String, KernelTree> existing : tree.existingChildren.entrySet())
{
             String existingName = existing.getKey();
             this.existingChildren.put(existingName,
-                    new KernelContentTree(existing.getValue(), this, existingName));
+                    new KernelTree(existing.getValue(), this, existingName));
         }
         
         // recursively copy all added children
-        for (Entry<String, KernelContentTree> added : tree.addedTrees.entrySet()) {
+        for (Entry<String, KernelTree> added : tree.addedTrees.entrySet()) {
             String addedName = added.getKey();
             this.addedTrees.put(addedName,
-                    new KernelContentTree(added.getValue(), this, addedName));
+                    new KernelTree(added.getValue(), this, addedName));
         }
 
         this.removedTrees.addAll(tree.removedTrees);
@@ -222,7 +222,7 @@ public class KernelContentTree implement
     }
 
     @Override
-    public ContentTree getParent() {
+    public Tree getParent() {
         return parent;
     }
 
@@ -276,8 +276,8 @@ public class KernelContentTree implement
     }
 
     @Override
-    public KernelContentTree getChild(String name) {
-        KernelContentTree state = addedTrees.get(name);
+    public KernelTree getChild(String name) {
+        KernelTree state = addedTrees.get(name);
         if (state != null) {
             // Added or removed and re-added child
             return state;
@@ -298,7 +298,7 @@ public class KernelContentTree implement
             return Status.REMOVED;
         }
         else {
-            KernelContentTree child = getChild(name);
+            KernelTree child = getChild(name);
             if (child == null) {
                 return null;
             }
@@ -371,20 +371,20 @@ public class KernelContentTree implement
     }
 
     @Override
-    public Iterable<ContentTree> getChildren() {
+    public Iterable<Tree> getChildren() {
         // Copy of removed children
         final Set<String> removed = new HashSet<String>();
         removed.addAll(removedTrees);
 
         // Copy od added and re-added children
-        final Set<ContentTree> added = new HashSet<ContentTree>();
+        final Set<Tree> added = new HashSet<Tree>();
         added.addAll(addedTrees.values());
 
         // Filter removed child node entries from persisted child node entries,
         // map remaining child node entries to content trees and add added children.
-        return new Iterable<ContentTree>() {
+        return new Iterable<Tree>() {
             @Override
-            public Iterator<ContentTree> iterator() {
+            public Iterator<Tree> iterator() {
                 // persisted entries
                 final Iterator<? extends ChildNodeEntry> persisted =
                     getPersistedChildren(persistentState);
@@ -399,11 +399,11 @@ public class KernelContentTree implement
                     });
 
                 // persisted trees - removed trees
-                Iterator<ContentTree> persistedMinusRemoved =
+                Iterator<Tree> persistedMinusRemoved =
                     map(persistedMinusRemovedEntries,
-                        new Function1<ChildNodeEntry, ContentTree>() {
+                        new Function1<ChildNodeEntry, Tree>() {
                             @Override
-                            public ContentTree apply(ChildNodeEntry entry) {
+                            public Tree apply(ChildNodeEntry entry) {
                                 return getExistingChild(entry.getName());
                             }
                         });
@@ -415,9 +415,9 @@ public class KernelContentTree implement
     }
 
     @Override
-    public ContentTree addChild(String name) {
+    public Tree addChild(String name) {
         if (!hasChild(name)) {
-            addedTrees.put(name, new KernelContentTree(this, name, listener));
+            addedTrees.put(name, new KernelTree(this, name, listener));
             if (listener != null) {
                 listener.addChild(this, name);
             }
@@ -479,14 +479,14 @@ public class KernelContentTree implement
      * @return  {@code true} if successful, {@code false otherwise}. I.e.
      * when {@code destName} already exists at {@code destParent}
      */
-    public boolean move(KernelContentTree destParent, String destName) {
+    public boolean move(KernelTree destParent, String destName) {
         if (destParent.hasChild(destName)) {
             return false;
         }
 
         parent.markTreeRemoved(name);
 
-        KernelContentTree oldParent = parent;
+        KernelTree oldParent = parent;
         String oldName = name;
 
         name = destName;
@@ -507,12 +507,12 @@ public class KernelContentTree implement
      * @return  {@code true} if successful, {@code false otherwise}. I.e.
      * when {@code destName} already exists at {@code destParent}
      */
-    public boolean copy(KernelContentTree destParent, String destName) {
+    public boolean copy(KernelTree destParent, String destName) {
         if (destParent.hasChild(destName)) {
             return false;
         }
 
-        KernelContentTree copy = new KernelContentTree(this, destParent, destName);
+        KernelTree copy = new KernelTree(this, destParent, destName);
         destParent.addedTrees.put(destName, copy);
         if (listener != null) {
             listener.copy(parent, name, copy);
@@ -546,18 +546,18 @@ public class KernelContentTree implement
      *          does not have an underlying persistent state or the underlying
      *          persistent state does not have a child with the given {@code name}.
      */
-    private KernelContentTree getExistingChild(String name) {
+    private KernelTree getExistingChild(String name) {
         if (persistentState == null) {
             return null;
         }
 
-        KernelContentTree transientState = existingChildren.get(name);
+        KernelTree transientState = existingChildren.get(name);
         if (transientState == null) {
             NodeState state = persistentState.getChildNode(name);
             if (state == null) {
                 return null;
             }
-            transientState = new KernelContentTree(state, this, name, listener);
+            transientState = new KernelTree(state, this, name, listener);
             existingChildren.put(name, transientState);
         }
         return transientState;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchFuzzIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchFuzzIT.java?rev=1329583&r1=1329582&r2=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchFuzzIT.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchFuzzIT.java
Tue Apr 24 07:51:05 2012
@@ -21,7 +21,7 @@ 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.ContentTree;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
 import org.junit.Before;
@@ -411,7 +411,7 @@ public class KernelBranchFuzzIT {
         return ScalarImpl.stringScalar("V" + counter++);
     }
 
-    private static void checkEqual(ContentTree child2, ContentTree tree2) {
+    private static void checkEqual(Tree child2, Tree tree2) {
         assertEquals(child2.getPath(), tree2.getPath());
         assertEquals(child2.getChildrenCount(), tree2.getChildrenCount());
         assertEquals(child2.getPropertyCount(), tree2.getPropertyCount());
@@ -420,7 +420,7 @@ public class KernelBranchFuzzIT {
             assertEquals(property1, tree2.getProperty(property1.getName()));
         }
 
-        for (ContentTree child1 : child2.getChildren()) {
+        for (Tree child1 : child2.getChildren()) {
             checkEqual(child1, tree2.getChild(child1.getName()));
         }
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchTest.java?rev=1329583&r1=1329582&r2=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/KernelBranchTest.java
Tue Apr 24 07:51:05 2012
@@ -20,7 +20,7 @@ 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.ContentTree;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Scalar;
 import org.junit.Before;
@@ -57,8 +57,8 @@ public class KernelBranchTest {
     @Test
     public void getChild() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
-        ContentTree child = tree.getChild("any");
+        Tree tree = branch.getContentTree("/");
+        Tree child = tree.getChild("any");
         assertNull(child);
 
         child = tree.getChild("x");
@@ -68,7 +68,7 @@ public class KernelBranchTest {
     @Test
     public void getProperty() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
         PropertyState propertyState = tree.getProperty("any");
         assertNull(propertyState);
 
@@ -82,13 +82,13 @@ public class KernelBranchTest {
     @Test
     public void getChildren() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
-        Iterable<ContentTree> children = tree.getChildren();
+        Tree tree = branch.getContentTree("/");
+        Iterable<Tree> children = tree.getChildren();
 
         Set<String> expectedPaths = new HashSet<String>();
         Collections.addAll(expectedPaths, "x", "y", "z");
 
-        for (ContentTree child : children) {
+        for (Tree child : children) {
             assertTrue(expectedPaths.remove(child.getPath()));
         }
         assertTrue(expectedPaths.isEmpty());
@@ -99,7 +99,7 @@ public class KernelBranchTest {
     @Test
     public void getProperties() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         Map<String, Scalar> expectedProperties = new HashMap<String, Scalar>();
         expectedProperties.put("a", ScalarImpl.longScalar(1));
@@ -122,10 +122,10 @@ public class KernelBranchTest {
     @Test
     public void addChild() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         assertFalse(tree.hasChild("new"));
-        ContentTree added = tree.addChild("new");
+        Tree added = tree.addChild("new");
         assertNotNull(added);
         assertEquals("new", added.getName());
         assertTrue(tree.hasChild("new"));
@@ -137,7 +137,7 @@ public class KernelBranchTest {
     @Test
     public void addExistingChild() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         assertFalse(tree.hasChild("new"));
         tree.addChild("new");
@@ -146,7 +146,7 @@ public class KernelBranchTest {
         branch = new KernelBranch(newState);
         tree = branch.getContentTree("/");
         assertTrue(tree.hasChild("new"));
-        ContentTree added = tree.addChild("new");
+        Tree added = tree.addChild("new");
         assertNotNull(added);
         assertEquals("new", added.getName());
     }
@@ -154,7 +154,7 @@ public class KernelBranchTest {
     @Test
     public void removeChild() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         assertTrue(tree.hasChild("x"));
         tree.removeChild("x");
@@ -167,7 +167,7 @@ public class KernelBranchTest {
     @Test
     public void setProperty() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         assertFalse(tree.hasProperty("new"));
         Scalar value = ScalarImpl.stringScalar("value");
@@ -187,7 +187,7 @@ public class KernelBranchTest {
     @Test
     public void removeProperty() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         assertTrue(tree.hasProperty("a"));
         tree.removeProperty("a");
@@ -200,8 +200,8 @@ public class KernelBranchTest {
     @Test
     public void move() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
-        ContentTree y = tree.getChild("y");
+        Tree tree = branch.getContentTree("/");
+        Tree y = tree.getChild("y");
 
         assertTrue(tree.hasChild("x"));
         branch.move("x", "y/xx");
@@ -217,7 +217,7 @@ public class KernelBranchTest {
     @Test
     public void rename() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         assertTrue(tree.hasChild("x"));
         branch.move("x", "xx");
@@ -232,8 +232,8 @@ public class KernelBranchTest {
     @Test
     public void copy() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
-        ContentTree y = tree.getChild("y");
+        Tree tree = branch.getContentTree("/");
+        Tree y = tree.getChild("y");
 
         assertTrue(tree.hasChild("x"));
         branch.copy("x", "y/xx");
@@ -249,8 +249,8 @@ public class KernelBranchTest {
     @Test
     public void deepCopy() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
-        ContentTree y = tree.getChild("y");
+        Tree tree = branch.getContentTree("/");
+        Tree y = tree.getChild("y");
 
         branch.getContentTree("x").addChild("x1");
         branch.copy("x", "y/xx");
@@ -271,7 +271,7 @@ public class KernelBranchTest {
     @Test
     public void getChildrenCount() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
         assertEquals(3, tree.getChildrenCount());
 
         tree.removeChild("x");
@@ -287,7 +287,7 @@ public class KernelBranchTest {
     @Test
     public void getPropertyCount() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
         assertEquals(3, tree.getPropertyCount());
 
         Scalar value = ScalarImpl.stringScalar("foo");
@@ -307,7 +307,7 @@ public class KernelBranchTest {
     @Test
     public void largeChildList() {
         KernelBranch branch = new KernelBranch(state);
-        ContentTree tree = branch.getContentTree("/");
+        Tree tree = branch.getContentTree("/");
 
         tree.addChild("large");
         tree = tree.getChild("large");
@@ -321,7 +321,7 @@ public class KernelBranchTest {
         tree = tree.getChild("large");
 
         int c = 0;
-        for (ContentTree q : tree.getChildren()) {
+        for (Tree q : tree.getChildren()) {
             assertEquals("n" + c++, q.getName());
         }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1329583&r1=1329582&r2=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Tue Apr 24 07:51:05 2012
@@ -20,8 +20,8 @@ import org.apache.jackrabbit.JcrConstant
 import org.apache.jackrabbit.commons.iterator.NodeIteratorAdapter;
 import org.apache.jackrabbit.commons.iterator.PropertyIteratorAdapter;
 import org.apache.jackrabbit.oak.api.Branch;
-import org.apache.jackrabbit.oak.api.ContentTree;
-import org.apache.jackrabbit.oak.api.ContentTree.Status;
+import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.api.Tree.Status;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.jcr.util.ItemNameMatcher;
 import org.apache.jackrabbit.oak.jcr.util.LogUtil;
@@ -71,11 +71,11 @@ public class NodeImpl extends ItemImpl i
      */
     private static final Logger log = LoggerFactory.getLogger(NodeImpl.class);
 
-    private ContentTree contentTree;
+    private Tree tree;
 
-    NodeImpl(SessionContext<SessionImpl> sessionContext, ContentTree contentTree) {
+    NodeImpl(SessionContext<SessionImpl> sessionContext, Tree tree) {
         super(sessionContext);
-        this.contentTree = contentTree;
+        this.tree = tree;
     }
 
     //---------------------------------------------------------------< Item >---
@@ -108,11 +108,11 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public Node getParent() throws RepositoryException {
-        if (getContentTree().getParent() == null) {
+        if (getTree().getParent() == null) {
             throw new ItemNotFoundException("Root has no parent");
         }
 
-        return new NodeImpl(sessionContext, getContentTree().getParent());
+        return new NodeImpl(sessionContext, getTree().getParent());
     }
 
     /**
@@ -124,7 +124,7 @@ public class NodeImpl extends ItemImpl i
         if (depth < 0 || depth > current) {
             throw new ItemNotFoundException("ancestor at depth " + depth + " does not exist");
         }
-        ContentTree ancestor = getContentTree();
+        Tree ancestor = getTree();
         while (depth < current) {
             ancestor = ancestor.getParent();
             current -= 1;
@@ -145,7 +145,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public boolean isNew() {
-        return getContentTree().getParent().getChildStatus(name()) == Status.NEW;
+        return getTree().getParent().getChildStatus(name()) == Status.NEW;
     }
 
     /**
@@ -153,7 +153,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public boolean isModified() {
-        return getContentTree().getParent().getChildStatus(name()) == Status.MODIFIED;
+        return getTree().getParent().getChildStatus(name()) == Status.MODIFIED;
     }
 
     /**
@@ -161,7 +161,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public void remove() throws RepositoryException {
-        getContentTree().getParent().removeChild(getName());
+        getTree().getParent().removeChild(getName());
     }
 
     /**
@@ -182,7 +182,7 @@ public class NodeImpl extends ItemImpl i
         checkStatus();
 
         String parentPath = Paths.concat(path(), Paths.getParentPath(relPath));
-        ContentTree parentState = getBranch().getContentTree(parentPath);
+        Tree parentState = getBranch().getContentTree(parentPath);
         if (parentState == null) {
             throw new PathNotFoundException(relPath);
         }
@@ -380,7 +380,7 @@ public class NodeImpl extends ItemImpl i
     public NodeIterator getNodes() throws RepositoryException {
         checkStatus();
 
-        Iterable<ContentTree> children = getContentTree().getChildren();
+        Iterable<Tree> children = getTree().getChildren();
         return new NodeIteratorAdapter(nodeIterator(children.iterator()));
     }
 
@@ -388,10 +388,10 @@ public class NodeImpl extends ItemImpl i
     public NodeIterator getNodes(final String namePattern) throws RepositoryException {
         checkStatus();
 
-        Iterator<ContentTree> children = filter(getContentTree().getChildren().iterator(),
-                new Predicate<ContentTree>() {
+        Iterator<Tree> children = filter(getTree().getChildren().iterator(),
+                new Predicate<Tree>() {
                     @Override
-                    public boolean evaluate(ContentTree state) {
+                    public boolean evaluate(Tree state) {
                         return ItemNameMatcher.matches(state.getName(), namePattern);
                     }
                 });
@@ -403,10 +403,10 @@ public class NodeImpl extends ItemImpl i
     public NodeIterator getNodes(final String[] nameGlobs) throws RepositoryException {
         checkStatus();
 
-        Iterator<ContentTree> children = filter(getContentTree().getChildren().iterator(),
-                new Predicate<ContentTree>() {
+        Iterator<Tree> children = filter(getTree().getChildren().iterator(),
+                new Predicate<Tree>() {
                     @Override
-                    public boolean evaluate(ContentTree state) {
+                    public boolean evaluate(Tree state) {
                         return ItemNameMatcher.matches(state.getName(), nameGlobs);
                     }
                 });
@@ -430,7 +430,7 @@ public class NodeImpl extends ItemImpl i
     public PropertyIterator getProperties() throws RepositoryException {
         checkStatus();
 
-        Iterable<PropertyState> properties = getContentTree().getProperties();
+        Iterable<PropertyState> properties = getTree().getProperties();
         return new PropertyIteratorAdapter(propertyIterator(properties.iterator()));
     }
 
@@ -438,7 +438,7 @@ public class NodeImpl extends ItemImpl i
     public PropertyIterator getProperties(final String namePattern) throws RepositoryException
{
         checkStatus();
 
-        Iterator<PropertyState> properties = filter(getContentTree().getProperties().iterator(),
+        Iterator<PropertyState> properties = filter(getTree().getProperties().iterator(),
                 new Predicate<PropertyState>() {
                     @Override
                     public boolean evaluate(PropertyState entry) {
@@ -451,7 +451,7 @@ public class NodeImpl extends ItemImpl i
 
     @Override
     public PropertyIterator getProperties(final String[] nameGlobs) throws RepositoryException
{
-        Iterator<PropertyState> propertyNames = filter(getContentTree().getProperties().iterator(),
+        Iterator<PropertyState> propertyNames = filter(getTree().getProperties().iterator(),
                 new Predicate<PropertyState>() {
                     @Override
                     public boolean evaluate(PropertyState entry) {
@@ -559,14 +559,14 @@ public class NodeImpl extends ItemImpl i
     public boolean hasNodes() throws RepositoryException {
         checkStatus();
 
-        return getContentTree().getChildrenCount() != 0;
+        return getTree().getChildrenCount() != 0;
     }
 
     @Override
     public boolean hasProperties() throws RepositoryException {
         checkStatus();
 
-        return getContentTree().getPropertyCount() != 0;
+        return getTree().getPropertyCount() != 0;
     }
 
     /**
@@ -855,11 +855,11 @@ public class NodeImpl extends ItemImpl i
     //------------------------------------------------------------< package >---
 
     String name() {
-        return getContentTree().getName();
+        return getTree().getName();
     }
 
     String path() {
-        return '/' + getContentTree().getPath();
+        return '/' + getTree().getPath();
     }
 
     //------------------------------------------------------------< private >---
@@ -867,22 +867,22 @@ public class NodeImpl extends ItemImpl i
     /**
      * @return The node state associated with this node
      */
-    private ContentTree getState() {
-        return getContentTree();
+    private Tree getState() {
+        return getTree();
     }
 
     private Branch getBranch() {
         return sessionContext.getBranch();
     }
 
-    private synchronized ContentTree getContentTree() {
-        return contentTree = getBranch().getContentTree(contentTree.getPath());
+    private synchronized Tree getTree() {
+        return tree = getBranch().getContentTree(tree.getPath());
     }
 
-    private Iterator<Node> nodeIterator(Iterator<ContentTree> childNodeStates)
{
-        return Iterators.map(childNodeStates, new Function1<ContentTree, Node>() {
+    private Iterator<Node> nodeIterator(Iterator<Tree> childNodeStates) {
+        return Iterators.map(childNodeStates, new Function1<Tree, Node>() {
             @Override
-            public Node apply(ContentTree state) {
+            public Node apply(Tree state) {
                 return new NodeImpl(sessionContext, state);
             }
         });
@@ -892,14 +892,14 @@ public class NodeImpl extends ItemImpl i
         return Iterators.map(properties, new Function1<PropertyState, Property>() {
             @Override
             public Property apply(PropertyState propertyState) {
-                return new PropertyImpl(sessionContext, getContentTree(), propertyState);
+                return new PropertyImpl(sessionContext, getTree(), propertyState);
             }
         });
     }
 
     private NodeImpl getNodeOrNull(String relPath) {
         String absPath = Paths.concat(path(), relPath);
-        ContentTree tree = getBranch().getContentTree(absPath);
+        Tree tree = getBranch().getContentTree(absPath);
         return tree == null
             ? null
             : new NodeImpl(sessionContext, tree);
@@ -907,7 +907,7 @@ public class NodeImpl extends ItemImpl i
     
     private PropertyImpl getPropertyOrNull(String relPath) {
         String absPath = Paths.concat(path(), Paths.getParentPath(relPath));
-        ContentTree parent = getBranch().getContentTree(absPath);
+        Tree parent = getBranch().getContentTree(absPath);
         if (parent == null) {
             return null;
         }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java?rev=1329583&r1=1329582&r2=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyImpl.java
Tue Apr 24 07:51:05 2012
@@ -17,8 +17,8 @@
 package org.apache.jackrabbit.oak.jcr;
 
 import org.apache.jackrabbit.oak.api.Branch;
-import org.apache.jackrabbit.oak.api.ContentTree;
-import org.apache.jackrabbit.oak.api.ContentTree.Status;
+import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.api.Tree.Status;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.jcr.util.LogUtil;
 import org.apache.jackrabbit.oak.jcr.util.ValueConverter;
@@ -53,10 +53,10 @@ public class PropertyImpl extends ItemIm
      */
     private static final Logger log = LoggerFactory.getLogger(PropertyImpl.class);
 
-    private ContentTree parent;
+    private Tree parent;
     private PropertyState propertyState;
 
-    PropertyImpl(SessionContext<SessionImpl> sessionContext, ContentTree parent,
+    PropertyImpl(SessionContext<SessionImpl> sessionContext, Tree parent,
             PropertyState propertyState) {
 
         super(sessionContext);
@@ -610,7 +610,7 @@ public class PropertyImpl extends ItemIm
         return sessionContext.getBranch();
     }
 
-    private ContentTree getParentContentTree() {
+    private Tree getParentContentTree() {
         resolve();
         return parent;
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java?rev=1329583&r1=1329582&r2=1329583&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionContext.java
Tue Apr 24 07:51:05 2012
@@ -21,7 +21,7 @@ package org.apache.jackrabbit.oak.jcr;
 
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.Branch;
-import org.apache.jackrabbit.oak.api.ContentTree;
+import org.apache.jackrabbit.oak.api.Tree;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
@@ -40,5 +40,5 @@ public interface SessionContext<T extend
     NodeTypeManager getNodeTypeManager() throws RepositoryException;
     VersionManager getVersionManager() throws RepositoryException;
     Branch getBranch();
-    ContentTree getContentTree(NodeImpl node);
+    Tree getContentTree(NodeImpl node);
 }

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=1329583&r1=1329582&r2=1329583&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
Tue Apr 24 07:51:05 2012
@@ -23,7 +23,7 @@ import org.apache.jackrabbit.commons.Abs
 import org.apache.jackrabbit.oak.api.Branch;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
-import org.apache.jackrabbit.oak.api.ContentTree;
+import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.Paths;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -481,7 +481,7 @@ public class SessionImpl extends Abstrac
         }
 
         @Override
-        public ContentTree getContentTree(NodeImpl node) {
+        public Tree getContentTree(NodeImpl node) {
             return branch.getContentTree(node.path());
         }
     }



Mime
View raw message