jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1329617 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/api/ oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/test/java/org/apache/jac...
Date Tue, 24 Apr 2012 09:57:46 GMT
Author: angela
Date: Tue Apr 24 09:57:46 2012
New Revision: 1329617

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

- rename ContentTree to Tree


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/core/KernelContentRepository.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/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=1329617&r1=1329616&r2=1329617&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 09:57:46 2012
@@ -57,6 +57,6 @@ public interface Branch {
      * @return content tree at the given path or {@code null} if no
      * such tree exists
      */
-    Tree getContentTree(String path);
+    Tree getTree(String path);
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java?rev=1329617&r1=1329616&r2=1329617&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/KernelContentRepository.java
Tue Apr 24 09:57:46 2012
@@ -58,7 +58,7 @@ public class KernelContentRepository imp
         NodeState wspNode = root.getChildNode(DEFAULT_WORKSPACE_NAME);
         if (wspNode == null) {
             Branch branch = nodeStore.branch(root);
-            branch.getContentTree("/").addChild(DEFAULT_WORKSPACE_NAME);
+            branch.getTree("/").addChild(DEFAULT_WORKSPACE_NAME);
             nodeStore.merge(branch);
         }
     }

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=1329617&r1=1329616&r2=1329617&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 09:57:46 2012
@@ -91,7 +91,7 @@ public class KernelBranch implements Bra
     }
 
     @Override
-    public Tree getContentTree(String path) {
+    public Tree getTree(String path) {
         return getTransientState(path);
     }
 

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=1329617&r1=1329616&r2=1329617&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 09:57:46 2012
@@ -90,7 +90,7 @@ public class KernelBranchFuzzIT {
             log.info("{}", op);
             op.apply(branch1);
             op.apply(branch2);
-            checkEqual(branch1.getContentTree("/"), branch2.getContentTree("/"));
+            checkEqual(branch1.getTree("/"), branch2.getTree("/"));
 
             state1 = branch1.mergeInto(mk1, state1);
             branch1 = new KernelBranch(state1);
@@ -142,7 +142,7 @@ public class KernelBranchFuzzIT {
 
             @Override
             void apply(KernelBranch branch) {
-                branch.getContentTree(parentPath).addChild(name);
+                branch.getTree(parentPath).addChild(name);
             }
 
             @Override
@@ -162,7 +162,7 @@ public class KernelBranchFuzzIT {
             void apply(KernelBranch branch) {
                 String parentPath = PathUtils.getParentPath(path);
                 String name = PathUtils.getName(path);
-                branch.getContentTree(parentPath).removeChild(name);
+                branch.getTree(parentPath).removeChild(name);
             }
 
             @Override
@@ -224,7 +224,7 @@ public class KernelBranchFuzzIT {
 
             @Override
             void apply(KernelBranch branch) {
-                branch.getContentTree(parentPath).setProperty(propertyName, propertyValue);
+                branch.getTree(parentPath).setProperty(propertyName, propertyValue);
             }
 
             @Override
@@ -245,7 +245,7 @@ public class KernelBranchFuzzIT {
 
             @Override
             void apply(KernelBranch branch) {
-                branch.getContentTree(parentPath).removeProperty(name);
+                branch.getTree(parentPath).removeProperty(name);
             }
 
             @Override

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=1329617&r1=1329616&r2=1329617&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 09:57:46 2012
@@ -57,7 +57,7 @@ public class KernelBranchTest {
     @Test
     public void getChild() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         Tree child = tree.getChild("any");
         assertNull(child);
 
@@ -68,7 +68,7 @@ public class KernelBranchTest {
     @Test
     public void getProperty() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         PropertyState propertyState = tree.getProperty("any");
         assertNull(propertyState);
 
@@ -82,7 +82,7 @@ public class KernelBranchTest {
     @Test
     public void getChildren() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         Iterable<Tree> children = tree.getChildren();
 
         Set<String> expectedPaths = new HashSet<String>();
@@ -99,7 +99,7 @@ public class KernelBranchTest {
     @Test
     public void getProperties() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         Map<String, Scalar> expectedProperties = new HashMap<String, Scalar>();
         expectedProperties.put("a", ScalarImpl.longScalar(1));
@@ -122,7 +122,7 @@ public class KernelBranchTest {
     @Test
     public void addChild() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         assertFalse(tree.hasChild("new"));
         Tree added = tree.addChild("new");
@@ -137,14 +137,14 @@ public class KernelBranchTest {
     @Test
     public void addExistingChild() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         assertFalse(tree.hasChild("new"));
         tree.addChild("new");
         NodeState newState = branch.mergeInto(microkernel, state);
 
         branch = new KernelBranch(newState);
-        tree = branch.getContentTree("/");
+        tree = branch.getTree("/");
         assertTrue(tree.hasChild("new"));
         Tree added = tree.addChild("new");
         assertNotNull(added);
@@ -154,7 +154,7 @@ public class KernelBranchTest {
     @Test
     public void removeChild() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         assertTrue(tree.hasChild("x"));
         tree.removeChild("x");
@@ -167,7 +167,7 @@ public class KernelBranchTest {
     @Test
     public void setProperty() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         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);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         assertTrue(tree.hasProperty("a"));
         tree.removeProperty("a");
@@ -200,7 +200,7 @@ public class KernelBranchTest {
     @Test
     public void move() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         Tree y = tree.getChild("y");
 
         assertTrue(tree.hasChild("x"));
@@ -217,7 +217,7 @@ public class KernelBranchTest {
     @Test
     public void rename() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         assertTrue(tree.hasChild("x"));
         branch.move("x", "xx");
@@ -232,7 +232,7 @@ public class KernelBranchTest {
     @Test
     public void copy() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         Tree y = tree.getChild("y");
 
         assertTrue(tree.hasChild("x"));
@@ -249,10 +249,10 @@ public class KernelBranchTest {
     @Test
     public void deepCopy() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         Tree y = tree.getChild("y");
 
-        branch.getContentTree("x").addChild("x1");
+        branch.getTree("x").addChild("x1");
         branch.copy("x", "y/xx");
         assertTrue(y.hasChild("xx"));
         assertTrue(y.getChild("xx").hasChild("x1"));
@@ -271,7 +271,7 @@ public class KernelBranchTest {
     @Test
     public void getChildrenCount() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         assertEquals(3, tree.getChildrenCount());
 
         tree.removeChild("x");
@@ -287,7 +287,7 @@ public class KernelBranchTest {
     @Test
     public void getPropertyCount() {
         KernelBranch branch = new KernelBranch(state);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
         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);
-        Tree tree = branch.getContentTree("/");
+        Tree tree = branch.getTree("/");
 
         tree.addChild("large");
         tree = tree.getChild("large");
@@ -317,7 +317,7 @@ public class KernelBranchTest {
 
         KernelNodeState newState = branch.mergeInto(microkernel, state);
         branch = new KernelBranch(newState);
-        tree = branch.getContentTree("/");
+        tree = branch.getTree("/");
         tree = tree.getChild("large");
 
         int c = 0;

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=1329617&r1=1329616&r2=1329617&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 09:57:46 2012
@@ -182,7 +182,7 @@ public class NodeImpl extends ItemImpl i
         checkStatus();
 
         String parentPath = Paths.concat(path(), Paths.getParentPath(relPath));
-        Tree parentState = getBranch().getContentTree(parentPath);
+        Tree parentState = getBranch().getTree(parentPath);
         if (parentState == null) {
             throw new PathNotFoundException(relPath);
         }
@@ -876,7 +876,7 @@ public class NodeImpl extends ItemImpl i
     }
 
     private synchronized Tree getTree() {
-        return tree = getBranch().getContentTree(tree.getPath());
+        return tree = getBranch().getTree(tree.getPath());
     }
 
     private Iterator<Node> nodeIterator(Iterator<Tree> childNodeStates) {
@@ -899,7 +899,7 @@ public class NodeImpl extends ItemImpl i
 
     private NodeImpl getNodeOrNull(String relPath) {
         String absPath = Paths.concat(path(), relPath);
-        Tree tree = getBranch().getContentTree(absPath);
+        Tree tree = getBranch().getTree(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));
-        Tree parent = getBranch().getContentTree(absPath);
+        Tree parent = getBranch().getTree(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=1329617&r1=1329616&r2=1329617&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 09:57:46 2012
@@ -629,7 +629,7 @@ public class PropertyImpl extends ItemIm
     }
 
     private synchronized void resolve() {
-        parent = getBranch().getContentTree(parent.getPath());
+        parent = getBranch().getTree(parent.getPath());
         String path = Paths.concat(parent.getPath(), propertyState.getName());
 
         if (parent == null) {

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=1329617&r1=1329616&r2=1329617&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 09:57:46 2012
@@ -124,7 +124,7 @@ public class SessionImpl extends Abstrac
     @Override
     public Node getRootNode() throws RepositoryException {
         ensureIsAlive();
-        return new NodeImpl(sessionContext, branch.getContentTree("/"));
+        return new NodeImpl(sessionContext, branch.getTree("/"));
     }
 
     @Override
@@ -482,7 +482,7 @@ public class SessionImpl extends Abstrac
 
         @Override
         public Tree getContentTree(NodeImpl node) {
-            return branch.getContentTree(node.path());
+            return branch.getTree(node.path());
         }
     }
 }
\ No newline at end of file



Mime
View raw message