You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by md...@apache.org on 2012/04/26 16:05:49 UTC

svn commit: r1330859 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: api/Root.java api/Tree.java core/RootImpl.java core/TreeImpl.java kernel/NodeState.java kernel/NodeStore.java

Author: mduerig
Date: Thu Apr 26 14:05:48 2012
New Revision: 1330859

URL: http://svn.apache.org/viewvc?rev=1330859&view=rev
Log:
OAK-18: Define Oak API
update javadoc to reflect earlier renaming of ContentTree to Tree

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java?rev=1330859&r1=1330858&r2=1330859&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Root.java Thu Apr 26 14:05:48 2012
@@ -50,12 +50,11 @@ public interface Root {
     boolean copy(String sourcePath, String destPath);
 
     /**
-     * Retrieve the {@code ContentTree} at the given {@code path}.
-     * The path must resolve to a content tree in this root.
+     * Retrieve the {@code Tree} at the given {@code path}. The path must resolve to
+     * a tree in this root.
      *
-     * @param path path to the content tree
-     * @return content tree at the given path or {@code null} if no
-     * such tree exists
+     * @param path  path to the tree
+     * @return  tree at the given path or {@code null} if no such tree exists
      */
     Tree getTree(String path);
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java?rev=1330859&r1=1330858&r2=1330859&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Tree.java Thu Apr 26 14:05:48 2012
@@ -22,7 +22,7 @@ import java.util.List;
 
 /**
  * A tree instance represents a snapshot of the {@code ContentRepository}
- * content tree at the time the instance was acquired. Tree instances may
+ * tree at the time the instance was acquired. Tree instances may
  * become invalid over time due to garbage collection of old content, at
  * which point an outdated snapshot will start throwing
  * {@code IllegalStateException}s to indicate that the snapshot is no
@@ -43,7 +43,7 @@ import java.util.List;
 public interface Tree {
 
     /**
-     * Status of an item in a {@code ContentTree}
+     * Status of an item in a {@code Tree}
      */
     enum Status {
         /**
@@ -69,17 +69,17 @@ public interface Tree {
     }
 
     /**
-     * @return  the name of this {@code ContentTree} instance.
+     * @return  the name of this {@code Tree} instance.
      */
     String getName();
 
     /**
-     * @return  path of this {@code ContentTree} instance.
+     * @return  path of this {@code Tree} instance.
      */
     String getPath();
 
     /**
-     * @return  the parent of this {@code ContentTree} instance.
+     * @return  the parent of this {@code Tree} instance.
      */
     Tree getParent();
 
@@ -115,7 +115,7 @@ public interface Tree {
 
     /**
      * All property states. The returned {@code Iterable} has snapshot semantics. That
-     * is, it reflect the state of this {@code ContentTree} instance at the time of the
+     * is, it reflect the state of this {@code Tree} instance at the time of the
      * call. Later changes to this instance are no visible to iterators obtained from
      * the returned iterable.
      * @return  An {@code Iterable} for all property states
@@ -123,7 +123,7 @@ public interface Tree {
     Iterable<? extends PropertyState> getProperties();
 
     /**
-     * Get a child of this {@code ContentTree} instance
+     * Get a child of this {@code Tree} instance
      * @param name  name of the child
      * @return  the child with the given {@code name} or {@code null} if no such child
      * exists.
@@ -139,7 +139,7 @@ public interface Tree {
     Status getChildStatus(String name);
 
     /**
-     * Determine if a child of this {@code ContentTree} instance exists.
+     * Determine if a child of this {@code Tree} instance exists.
      * @param name  name of the child
      * @return  {@code true} if and only if a child with the given {@code name}
      *          exists.
@@ -147,14 +147,14 @@ public interface Tree {
     boolean hasChild(String name);
 
     /**
-     * Determine the number of children of this {@code ContentTree} instance.
+     * Determine the number of children of this {@code Tree} instance.
      * @return  number of children
      */
     long getChildrenCount();
 
     /**
-     * All children of this {@code ContentTree} instance. The returned {@code Iterable}
-     * has snapshot semantics. That is, it reflect the state of this {@code ContentTree}
+     * All children of this {@code Tree} instance. The returned {@code Iterable}
+     * has snapshot semantics. That is, it reflect the state of this {@code Tree}
      * instance. instance at the time of the call. Later changes to this instance are no
      * visible to iterators obtained from the returned iterable.
      * @return  An {@code Iterable} for all children
@@ -166,7 +166,7 @@ public interface Tree {
      * already exists.
      *
      * @param name name of the child
-     * @return the {@code ContentTree} instance of the child with the given {@code name}.
+     * @return the {@code Tree} instance of the child with the given {@code name}.
      */
     Tree addChild(String name);
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1330859&r1=1330858&r2=1330859&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java Thu Apr 26 14:05:48 2012
@@ -46,7 +46,7 @@ public class RootImpl implements Root {
     /** The name of the workspace we are operating on */
     private final String workspaceName;
 
-    /** Listener for changes on the content tree */
+    /** Listener for changes on the tree */
     private TreeListener treeListener = new TreeListener();
 
     /** Base node state of this tree */
@@ -73,12 +73,12 @@ public class RootImpl implements Root {
 
     @Override
     public boolean move(String sourcePath, String destPath) {
-        TreeImpl source = getTransientState(sourcePath);
+        TreeImpl source = getChild(sourcePath);
         if (source == null) {
             return false;
         }
 
-        TreeImpl destParent = getTransientState(getParentPath(destPath));
+        TreeImpl destParent = getChild(getParentPath(destPath));
         String destName = getName(destPath);
         return destParent != null && source.move(destParent, destName);
 
@@ -86,12 +86,12 @@ public class RootImpl implements Root {
 
     @Override
     public boolean copy(String sourcePath, String destPath) {
-        TreeImpl sourceNode = getTransientState(sourcePath);
+        TreeImpl sourceNode = getChild(sourcePath);
         if (sourceNode == null) {
             return false;
         }
 
-        TreeImpl destParent = getTransientState(getParentPath(destPath));
+        TreeImpl destParent = getChild(getParentPath(destPath));
         String destName = getName(destPath);
         return destParent != null && sourceNode.copy(destParent, destName);
 
@@ -99,7 +99,7 @@ public class RootImpl implements Root {
 
     @Override
     public Tree getTree(String path) {
-        return getTransientState(path);
+        return getChild(path);
     }
 
     @Override
@@ -124,13 +124,12 @@ public class RootImpl implements Root {
     //------------------------------------------------------------< private >---
 
     /**
-     * Get a transient node state for the node identified by
-     * {@code path}
-     * @param path  the path to the node state
-     * @return  a {@link Tree} instance for the item
+     * Get a tree for the child identified by {@code path}
+     * @param path  the path to the child
+     * @return  a {@link Tree} instance for the child
      *          at {@code path} or {@code null} if no such item exits.
      */
-    private TreeImpl getTransientState(String path) {
+    private TreeImpl getChild(String path) {
         TreeImpl state = root;
         for (String name : elements(path)) {
             state = state.getChild(name);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1330859&r1=1330858&r2=1330859&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java Thu Apr 26 14:05:48 2012
@@ -47,19 +47,19 @@ public class TreeImpl implements Tree {
 
     /**
      * Underlying persistent state or {@code null} if this instance represents an
-     * added content tree
+     * added tree
      */
     private final NodeState baseState;
 
     private final NodeStateBuilder builder;
 
-    /** Listener for changes on this content tree */
+    /** Listener for changes on this tree */
     private final Listener listener;
 
-    /** Name of this content tree */
+    /** Name of this tree */
     private String name;
 
-    /** Parent of this content tree */
+    /** Parent of this tree */
     private TreeImpl parent;
 
     private TreeImpl(NodeStore store, NodeState baseState, NodeStateBuilder builder,
@@ -85,7 +85,7 @@ public class TreeImpl implements Tree {
     }
 
     /**
-     * Listener for changes on {@code ContentTree}s
+     * Listener for changes on {@code Tree}s
      */
     interface Listener {
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java?rev=1330859&r1=1330858&r2=1330859&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeState.java Thu Apr 26 14:05:48 2012
@@ -19,10 +19,10 @@ package org.apache.jackrabbit.oak.kernel
 import org.apache.jackrabbit.oak.api.PropertyState;
 
 /**
- * A content tree consists of nodes and properties, each of which
- * evolves through different states during its lifecycle. This interface
- * represents a specific, immutable state of a node in a content tree.
- * A node consists of an unordered set of name -&gt; item mappings, where
+ * A tree consists of nodes and properties, each of which evolves
+ * through different states during its lifecycle. This interface
+ * represents a specific, immutable state of a node in a tree. A node
+ * consists of an unordered set of name -&gt; item mappings, where
  * each item is either a property or a child node.
  * <p>
  * Depending on context, a NodeState instance can be interpreted as
@@ -73,7 +73,7 @@ import org.apache.jackrabbit.oak.api.Pro
  * persisted data. An implementation may want to provide derived data,
  * like for example the aggregate size of the entire subtree as an
  * extra virtual property. A virtualization, sharding or caching layer
- * could provide a composite view over multiple underlying content trees.
+ * could provide a composite view over multiple underlying trees.
  * Or a basic access control layer could decide to hide certain content
  * based on specific rules. All such features need to be implemented
  * according to the API contract of this interface. A separate higher level

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java?rev=1330859&r1=1330858&r2=1330859&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/NodeStore.java Thu Apr 26 14:05:48 2012
@@ -19,8 +19,8 @@ package org.apache.jackrabbit.oak.kernel
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 
 /**
- * Storage abstraction for content trees. At any given point in time
- * the stored content tree is rooted at a single immutable node state.
+ * Storage abstraction for trees. At any given point in time the stored
+ * tree is rooted at a single immutable node state.
  * <p>
  * This is a low-level interface that doesn't cover functionality like
  * merging concurrent changes or rejecting new tree states based on some
@@ -29,7 +29,7 @@ import org.apache.jackrabbit.oak.api.Com
 public interface NodeStore {
 
     /**
-     * Returns the latest state of the content tree.
+     * Returns the latest state of the tree.
      *
      * @return root node state
      */
@@ -46,7 +46,7 @@ public interface NodeStore {
     NodeStateBuilder getBuilder(NodeState base);
 
     /**
-     * Updates the state of the content tree.
+     * Updates the state of the tree.
      * @param builder  builder containing the new node state
      */
     void apply(NodeStateBuilder builder) throws CommitFailedException;