jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1330737 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: NodeImpl.java PropertyDelegate.java PropertyImpl.java SessionContext.java SessionImpl.java security/user/UserManagerImpl.java
Date Thu, 26 Apr 2012 09:54:59 GMT
Author: reschke
Date: Thu Apr 26 09:54:59 2012
New Revision: 1330737

URL: http://svn.apache.org/viewvc?rev=1330737&view=rev
Log:
OAK-61: split NodeImpl into NodeImpl and NodeDelegate

Modified:
    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/PropertyDelegate.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
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java

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=1330737&r1=1330736&r2=1330737&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
Thu Apr 26 09:54:59 2012
@@ -58,6 +58,7 @@ import java.io.InputStream;
 import java.math.BigDecimal;
 import java.util.Calendar;
 import java.util.Iterator;
+import java.util.List;
 
 import static org.apache.jackrabbit.oak.util.Iterators.filter;
 
@@ -71,13 +72,24 @@ public class NodeImpl extends ItemImpl i
      */
     private static final Logger log = LoggerFactory.getLogger(NodeImpl.class);
 
-    private Tree tree;
-
+    // private Tree tree;
+    private final NodeDelegate dlg;
+    
     NodeImpl(SessionContext<SessionImpl> sessionContext, Tree tree) {
         super(sessionContext);
-        this.tree = tree;
+        this.dlg = new NodeDelegate(sessionContext, tree);
+    }
+
+    NodeImpl(NodeDelegate dlg) {
+        super(dlg.getSessionContext());
+        this.dlg = dlg;
     }
 
+    // TODO
+    public String getOakPath() {
+        return dlg.getPath();
+    }
+    
     //---------------------------------------------------------------< Item >---
     /**
      * @see javax.jcr.Item#isNode()
@@ -92,15 +104,17 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public String getName() throws RepositoryException {
-        return name();
+        String oakName = dlg.getName();
+        // special case name of root node
+        return oakName.isEmpty() ? "" : toJcrPath(dlg.getName());
     }
 
     /**
-     * @see javax.jcr.Item#getPath()
+     * @see javax.jcr.Property#getPath()
      */
     @Override
     public String getPath() throws RepositoryException {
-        return path();
+        return toJcrPath(dlg.getPath());
     }
 
     /**
@@ -108,11 +122,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public Node getParent() throws RepositoryException {
-        if (getTree().getParent() == null) {
-            throw new ItemNotFoundException("Root has no parent");
-        }
-
-        return new NodeImpl(sessionContext, getTree().getParent());
+        return new NodeImpl(dlg.getParent());
     }
 
     /**
@@ -120,16 +130,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public Item getAncestor(int depth) throws RepositoryException {
-        int current = getDepth();
-        if (depth < 0 || depth > current) {
-            throw new ItemNotFoundException("ancestor at depth " + depth + " does not exist");
-        }
-        Tree ancestor = getTree();
-        while (depth < current) {
-            ancestor = ancestor.getParent();
-            current -= 1;
-        }
-        return new NodeImpl(sessionContext, ancestor);
+        return new NodeImpl(dlg.getAncestor(depth));
     }
 
     /**
@@ -137,7 +138,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public int getDepth() throws RepositoryException {
-        return Paths.getDepth(getPath());
+        return dlg.getDepth();
     }
 
     /**
@@ -145,7 +146,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public boolean isNew() {
-        return getTree().getParent().getChildStatus(name()) == Status.NEW;
+        return dlg.getNodeStatus() == Status.NEW;
     }
 
     /**
@@ -153,7 +154,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public boolean isModified() {
-        return getTree().getParent().getChildStatus(name()) == Status.MODIFIED;
+        return dlg.getNodeStatus() == Status.MODIFIED;
     }
 
     /**
@@ -161,7 +162,7 @@ public class NodeImpl extends ItemImpl i
      */
     @Override
     public void remove() throws RepositoryException {
-        getTree().getParent().removeChild(getName());
+        dlg.remove();
     }
 
     /**
@@ -178,18 +179,10 @@ public class NodeImpl extends ItemImpl i
      * @see Node#addNode(String)
      */
     @Override
-    public Node addNode(String relPath) throws RepositoryException {
+    public Node addNode(String relJcrPath) throws RepositoryException {
         checkStatus();
-
-        String parentPath = Paths.concat(path(), Paths.getParentPath(relPath));
-        Tree parentState = getBranch().getTree(parentPath);
-        if (parentState == null) {
-            throw new PathNotFoundException(relPath);
-        }
-
-        String name = Paths.getName(relPath);
-        parentState.addChild(name);
-        return new NodeImpl(sessionContext, parentState.getChild(name));
+        NodeDelegate added = dlg.addNode(toOakPath(relJcrPath));
+        return new NodeImpl(added);
     }
 
     @Override
@@ -203,8 +196,7 @@ public class NodeImpl extends ItemImpl i
     @Override
     public void orderBefore(String srcChildRelPath, String destChildRelPath) throws RepositoryException
{
         checkStatus();
-
-        // TODO
+        throw new UnsupportedRepositoryOperationException("TODO: ordering not supported");
     }
 
     /**
@@ -223,13 +215,16 @@ public class NodeImpl extends ItemImpl i
      * @see Node#setProperty(String, javax.jcr.Value, int)
      */
     @Override
-    public Property setProperty(String name, Value value, int type) throws RepositoryException
{
+    public Property setProperty(String jcrName, Value value, int type)
+            throws RepositoryException {
         checkStatus();
 
-        int targetType = getTargetType(value,  type);
-        Value targetValue = ValueHelper.convert(value, targetType, getValueFactory());
-        getState().setProperty(name, ValueConverter.toCoreValue(targetValue, sessionContext));
-        return getProperty(name);
+        int targetType = getTargetType(value, type);
+        Value targetValue = ValueHelper.convert(value, targetType,
+                getValueFactory());
+        CoreValue oakValue = ValueConverter.toCoreValue(targetValue,
+                sessionContext);
+        return new PropertyImpl(dlg.setProperty(toOakPath(jcrName), oakValue));
     }
 
     /**
@@ -247,13 +242,16 @@ public class NodeImpl extends ItemImpl i
     }
 
     @Override
-    public Property setProperty(String name, Value[] values, int type) throws RepositoryException
{
+    public Property setProperty(String jcrName, Value[] values, int type)
+            throws RepositoryException {
         checkStatus();
 
         int targetType = getTargetType(values, type);
-        Value[] targetValues = ValueHelper.convert(values, targetType, getValueFactory());
-        getState().setProperty(name, ValueConverter.toCoreValues(targetValues, sessionContext));
-        return getProperty(name);
+        Value[] targetValue = ValueHelper.convert(values, targetType,
+                getValueFactory());
+        List<CoreValue> oakValue = ValueConverter.toCoreValues(targetValue,
+                sessionContext);
+        return new PropertyImpl(dlg.setProperty(toOakPath(jcrName), oakValue));
     }
 
     /**
@@ -384,19 +382,21 @@ public class NodeImpl extends ItemImpl i
     public NodeIterator getNodes() throws RepositoryException {
         checkStatus();
 
-        Iterable<Tree> children = getTree().getChildren();
-        return new NodeIteratorAdapter(nodeIterator(children.iterator()));
+        Iterator<NodeDelegate> children = dlg.getChildren();
+        return new NodeIteratorAdapter(nodeIterator(children));
     }
 
     @Override
-    public NodeIterator getNodes(final String namePattern) throws RepositoryException {
+    public NodeIterator getNodes(final String namePattern)
+            throws RepositoryException {
         checkStatus();
 
-        Iterator<Tree> children = filter(getTree().getChildren().iterator(),
-                new Predicate<Tree>() {
+        Iterator<NodeDelegate> children = filter(dlg.getChildren(),
+                new Predicate<NodeDelegate>() {
                     @Override
-                    public boolean evaluate(Tree state) {
-                        return ItemNameMatcher.matches(state.getName(), namePattern);
+                    public boolean evaluate(NodeDelegate state) {
+                        return ItemNameMatcher.matches(
+                                toJcrPath(state.getName()), namePattern);
                     }
                 });
 
@@ -407,11 +407,11 @@ public class NodeImpl extends ItemImpl i
     public NodeIterator getNodes(final String[] nameGlobs) throws RepositoryException {
         checkStatus();
 
-        Iterator<Tree> children = filter(getTree().getChildren().iterator(),
-                new Predicate<Tree>() {
+        Iterator<NodeDelegate> children = filter(dlg.getChildren(),
+                new Predicate<NodeDelegate>() {
                     @Override
-                    public boolean evaluate(Tree state) {
-                        return ItemNameMatcher.matches(state.getName(), nameGlobs);
+                    public boolean evaluate(NodeDelegate state) {
+                        return ItemNameMatcher.matches(toJcrPath(state.getName()), nameGlobs);
                     }
                 });
 
@@ -434,19 +434,20 @@ public class NodeImpl extends ItemImpl i
     public PropertyIterator getProperties() throws RepositoryException {
         checkStatus();
 
-        Iterable<PropertyState> properties = getTree().getProperties();
-        return new PropertyIteratorAdapter(propertyIterator(properties.iterator()));
+        Iterator<PropertyDelegate> properties = dlg.getProperties();
+        return new PropertyIteratorAdapter(propertyIterator(properties));
     }
 
     @Override
     public PropertyIterator getProperties(final String namePattern) throws RepositoryException
{
         checkStatus();
 
-        Iterator<PropertyState> properties = filter(getTree().getProperties().iterator(),
-                new Predicate<PropertyState>() {
+        Iterator<PropertyDelegate> properties = filter(dlg.getProperties(),
+                new Predicate<PropertyDelegate>() {
                     @Override
-                    public boolean evaluate(PropertyState entry) {
-                        return ItemNameMatcher.matches(entry.getName(), namePattern);
+                    public boolean evaluate(PropertyDelegate entry) {
+                        return ItemNameMatcher.matches(
+                                toJcrPath(entry.getName()), namePattern);
                     }
                 });
 
@@ -455,11 +456,12 @@ public class NodeImpl extends ItemImpl i
 
     @Override
     public PropertyIterator getProperties(final String[] nameGlobs) throws RepositoryException
{
-        Iterator<PropertyState> propertyNames = filter(getTree().getProperties().iterator(),
-                new Predicate<PropertyState>() {
+        Iterator<PropertyDelegate> propertyNames = filter(dlg.getProperties(),
+                new Predicate<PropertyDelegate>() {
                     @Override
-                    public boolean evaluate(PropertyState entry) {
-                        return ItemNameMatcher.matches(entry.getName(), nameGlobs);
+                    public boolean evaluate(PropertyDelegate entry) {
+                        return ItemNameMatcher.matches(
+                                toJcrPath(entry.getName()), nameGlobs);
                     }
                 });
 
@@ -507,13 +509,13 @@ public class NodeImpl extends ItemImpl i
             return getProperty(JcrConstants.JCR_UUID).getString();
         } else {
             // TODO
-            return path();
+            return getPath();
         }
     }
 
     @Override
     public int getIndex() throws RepositoryException {
-        // as long as we don not support same name siblings, index always is 1
+        // as long as we do not support same name siblings, index always is 1
         return 1;
     }
 
@@ -563,14 +565,14 @@ public class NodeImpl extends ItemImpl i
     public boolean hasNodes() throws RepositoryException {
         checkStatus();
 
-        return getTree().getChildrenCount() != 0;
+        return dlg.getChildrenCount() != 0;
     }
 
     @Override
     public boolean hasProperties() throws RepositoryException {
         checkStatus();
 
-        return getTree().getPropertyCount() != 0;
+        return dlg.getPropertyCount() != 0;
     }
 
     /**
@@ -632,7 +634,7 @@ public class NodeImpl extends ItemImpl i
         checkStatus();
 
         CoreValue cv = ValueConverter.toCoreValue(nodeTypeName, PropertyType.NAME, sessionContext);
-        getState().setProperty(JcrConstants.JCR_PRIMARYTYPE, cv);
+        dlg.setProperty(toOakPath(JcrConstants.JCR_PRIMARYTYPE), cv);
     }
 
     @Override
@@ -852,79 +854,51 @@ public class NodeImpl extends ItemImpl i
 
     }
 
-    //------------------------------------------------------------< package >---
-
-    String name() {
-        return getTree().getName();
-    }
-
-    String path() {
-        return '/' + getTree().getPath();
-    }
-
     //------------------------------------------------------------< private >---
 
-    /**
-     * @return The node state associated with this node
-     */
-    private Tree getState() {
-        return getTree();
-    }
-
-    private Root getBranch() {
-        return sessionContext.getBranch();
-    }
 
-    private synchronized Tree getTree() {
-        return tree = getBranch().getTree(tree.getPath());
-    }
-
-    private Iterator<Node> nodeIterator(Iterator<Tree> childNodeStates) {
-        return Iterators.map(childNodeStates, new Function1<Tree, Node>() {
+    private Iterator<Node> nodeIterator(Iterator<NodeDelegate> childNodes) {
+        return Iterators.map(childNodes, new Function1<NodeDelegate, Node>() {
             @Override
-            public Node apply(Tree state) {
-                return new NodeImpl(sessionContext, state);
+            public Node apply(NodeDelegate state) {
+                return new NodeImpl(state);
             }
         });
     }
 
-    private Iterator<Property> propertyIterator(Iterator<PropertyState> properties)
{
-        return Iterators.map(properties, new Function1<PropertyState, Property>() {
-            @Override
-            public Property apply(PropertyState propertyState) {
-                return new PropertyImpl(sessionContext, getTree(), propertyState);
-            }
-        });
+    private Iterator<Property> propertyIterator(
+            Iterator<PropertyDelegate> properties) {
+        return Iterators.map(properties,
+                new Function1<PropertyDelegate, Property>() {
+                    @Override
+                    public Property apply(PropertyDelegate propertyDelegate) {
+                        return new PropertyImpl(propertyDelegate);
+                    }
+                });
     }
 
-    private NodeImpl getNodeOrNull(String relPath) {
-        String absPath = Paths.concat(path(), relPath);
-        Tree tree = getBranch().getTree(absPath);
-        return tree == null
-            ? null
-            : new NodeImpl(sessionContext, tree);
+    private NodeImpl getNodeOrNull(String relJcrPath)
+            throws RepositoryException {
+
+        String relOakPath = toOakPath(relJcrPath);
+
+        NodeDelegate nd = dlg.getNodeOrNull(relOakPath);
+        return nd == null ? null : new NodeImpl(nd);
     }
-    
-    private PropertyImpl getPropertyOrNull(String relJcrPath) throws RepositoryException
{
-        
+
+    private PropertyImpl getPropertyOrNull(String relJcrPath)
+            throws RepositoryException {
+
         String relOakPath = toOakPath(relJcrPath);
-        
-        String absPath = Paths.concat(path(), Paths.getParentPath(relOakPath));
-        Tree parent = getBranch().getTree(absPath);
-        if (parent == null) {
-            return null;
-        }
 
-        String name = Paths.getName(relOakPath);
-        PropertyState propertyState = parent.getProperty(name);
-        return propertyState == null
-            ? null
-            : new PropertyImpl(sessionContext, parent, propertyState);
+        PropertyDelegate pd = dlg.getPropertyOrNull(relOakPath);
+        return pd == null ? null : new PropertyImpl(pd);
     }
 
     private int getTargetType(Value value, int type) {
         if (value == null) {
-            return PropertyType.STRING; // TODO: review again. rather use property definition
+            return PropertyType.STRING; // TODO: review again. rather use
+                                        // property definition
         } else {
             return value.getType();
         }
@@ -932,9 +906,11 @@ public class NodeImpl extends ItemImpl i
 
     private int getTargetType(Value[] values, int type) {
         if (values == null || values.length == 0) {
-            return PropertyType.STRING; // TODO: review again. rather use property definition
+            return PropertyType.STRING; // TODO: review again. rather use
+                                        // property definition
         } else {
-            // TODO deal with values array containing a null value in the first position
+            // TODO deal with values array containing a null value in the first
+            // position
             return getTargetType(values[0], type);
         }
     }

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java?rev=1330737&r1=1330736&r2=1330737&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java
Thu Apr 26 09:54:59 2012
@@ -79,6 +79,10 @@ public class PropertyDelegate {
         return '/' + getParentContentTree().getPath() + '/' + getName();
     }
 
+    SessionContext<SessionImpl> getSessionContext() {
+        return sessionContext;
+    }
+
     //------------------------------------------------------------< private >---
 
     private Root getBranch() {

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=1330737&r1=1330736&r2=1330737&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
Thu Apr 26 09:54:59 2012
@@ -53,13 +53,19 @@ public class PropertyImpl extends ItemIm
      */
     private static final Logger log = LoggerFactory.getLogger(PropertyImpl.class);
 
-    private final PropertyDelegate pd;
+    private final PropertyDelegate dlg;
     
     PropertyImpl(SessionContext<SessionImpl> sessionContext, Tree parent,
             PropertyState propertyState) {
 
         super(sessionContext);
-        this.pd = new PropertyDelegate(sessionContext, parent, propertyState);
+        this.dlg = new PropertyDelegate(sessionContext, parent, propertyState);
+    }
+
+    PropertyImpl(PropertyDelegate dlg) {
+
+        super(dlg.getSessionContext());
+        this.dlg = dlg;
     }
 
     //---------------------------------------------------------------< Item >---
@@ -76,7 +82,7 @@ public class PropertyImpl extends ItemIm
      */
     @Override
     public String getName() throws RepositoryException {
-        return toJcrPath(pd.getName());
+        return toJcrPath(dlg.getName());
     }
 
     /**
@@ -84,7 +90,7 @@ public class PropertyImpl extends ItemIm
      */
     @Override
     public String getPath() throws RepositoryException {
-        return toJcrPath(pd.getPath());
+        return toJcrPath(dlg.getPath());
     }
 
     /**
@@ -92,7 +98,7 @@ public class PropertyImpl extends ItemIm
      */
     @Override
     public Node getParent() throws RepositoryException {
-        return new NodeImpl(sessionContext, pd.getParentContentTree());
+        return new NodeImpl(sessionContext, dlg.getParentContentTree());
     }
 
     /**
@@ -120,7 +126,7 @@ public class PropertyImpl extends ItemIm
      */
     @Override
     public boolean isNew() {
-        return pd.getPropertyStatus() == Status.NEW;
+        return dlg.getPropertyStatus() == Status.NEW;
     }
 
     /**
@@ -128,7 +134,7 @@ public class PropertyImpl extends ItemIm
      */
     @Override
     public boolean isModified() {
-        return pd.getPropertyStatus() == Status.MODIFIED;
+        return dlg.getPropertyStatus() == Status.MODIFIED;
     }
 
     /**
@@ -136,7 +142,7 @@ public class PropertyImpl extends ItemIm
      */
     @Override
     public void remove() throws RepositoryException {
-        pd.remove();
+        dlg.remove();
     }
 
     /**
@@ -497,7 +503,7 @@ public class PropertyImpl extends ItemIm
 
     @Override
     public PropertyDefinition getDefinition() throws RepositoryException {
-        return pd.getDefinition();
+        return dlg.getDefinition();
     }
 
     /**
@@ -520,7 +526,7 @@ public class PropertyImpl extends ItemIm
 
     @Override
     public boolean isMultiple() throws RepositoryException {
-        return pd.getPropertyState().isArray();
+        return dlg.getPropertyState().isArray();
     }
 
     /**
@@ -560,7 +566,7 @@ public class PropertyImpl extends ItemIm
    }
 
     private PropertyState getPropertyState() {
-        return pd.getPropertyState();
+        return dlg.getPropertyState();
     }
 
     /**
@@ -574,10 +580,10 @@ public class PropertyImpl extends ItemIm
        assert(requiredType != PropertyType.UNDEFINED);
        
        if (value == null) {
-           pd.remove();
+           dlg.remove();
        } else {
            Value targetValue = ValueHelper.convert(value, requiredType, sessionContext.getValueFactory());
-           pd.setValue(ValueConverter.toCoreValue(targetValue, sessionContext));
+           dlg.setValue(ValueConverter.toCoreValue(targetValue, sessionContext));
        }
    }
 
@@ -595,7 +601,7 @@ public class PropertyImpl extends ItemIm
           remove();
       } else {
           Value[] targetValues = ValueHelper.convert(values, requiredType, sessionContext.getValueFactory());
-          pd.setValues(ValueConverter.toCoreValues(targetValues, sessionContext));
+          dlg.setValues(ValueConverter.toCoreValues(targetValues, sessionContext));
       }
   }
 

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=1330737&r1=1330736&r2=1330737&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
Thu Apr 26 09:54:59 2012
@@ -42,7 +42,7 @@ public interface SessionContext<T extend
     NodeTypeManager getNodeTypeManager() throws RepositoryException;
     VersionManager getVersionManager() throws RepositoryException;
     Root getBranch();
-    Tree getContentTree(NodeImpl node);
+    Tree getContentTree(String path);
     String toOakPath(String jcrPath) throws RepositoryException;
     String toJcrPath(String oakPath);
 }

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=1330737&r1=1330736&r2=1330737&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
Thu Apr 26 09:54:59 2012
@@ -524,8 +524,8 @@ public class SessionImpl extends Abstrac
         }
 
         @Override
-        public Tree getContentTree(NodeImpl node) {
-            return root.getTree(node.path());
+        public Tree getContentTree(String oakPath) {
+            return root.getTree(oakPath);
         }
 
         @Override

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java?rev=1330737&r1=1330736&r2=1330737&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/UserManagerImpl.java
Thu Apr 26 09:54:59 2012
@@ -328,16 +328,16 @@ public class UserManagerImpl implements 
 
     void setInternalProperty(NodeImpl userNode, String name, String value, int type) throws
RepositoryException {
         CoreValue cv = ValueConverter.toCoreValue(value, type, sessionContext);
-        sessionContext.getContentTree(userNode).setProperty(name, cv);
+        sessionContext.getContentTree(userNode.getOakPath()).setProperty(name, cv);
     }
 
     void setInternalProperty(NodeImpl userNode, String name, String[] values, int type) throws
RepositoryException {
         List<CoreValue> cvs = ValueConverter.toCoreValues(values, type, sessionContext);
-        sessionContext.getContentTree(userNode).setProperty(name, cvs);
+        sessionContext.getContentTree(userNode.getOakPath()).setProperty(name, cvs);
     }
 
     void removeInternalProperty(NodeImpl userNode, String name) {
-        sessionContext.getContentTree(userNode).removeProperty(name);
+        sessionContext.getContentTree(userNode.getOakPath()).removeProperty(name);
     }
 
     private Authorizable getAuthorizable(NodeImpl node) throws RepositoryException {



Mime
View raw message