jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1335171 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr: SessionDelegate.java SessionImpl.java security/user/UserManagerImpl.java
Date Mon, 07 May 2012 18:22:08 GMT
Author: mduerig
Date: Mon May  7 18:22:07 2012
New Revision: 1335171

URL: http://svn.apache.org/viewvc?rev=1335171&view=rev
Log:
OAK-84: Delegates for Session, Node, Property and Item
- make SessionDelegate.getTree() package private

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.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/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1335171&r1=1335170&r2=1335171&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Mon May  7 18:22:07 2012
@@ -102,6 +102,15 @@ public class SessionDelegate {
         }
     }
 
+    public NodeDelegate getRoot() {
+        return new NodeDelegate(this, getTree("/"));
+    }
+
+    public NodeDelegate getNode(String path) {
+        Tree tree = getTree(path);
+        return tree == null ? null : new NodeDelegate(this, tree);
+    }
+
     public ValueFactoryImpl getValueFactory() {
         return valueFactory;
     }
@@ -254,7 +263,7 @@ public class SessionDelegate {
 
     //------------------------------------------------------------< internal >---
 
-    public Tree getTree(String path) {  // FIXME: make this package private
+    Tree getTree(String path) {
         return root.getTree(path);
     }
 

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=1335171&r1=1335170&r2=1335171&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
Mon May  7 18:22:07 2012
@@ -96,7 +96,7 @@ public class SessionImpl extends Abstrac
     @Override
     public Node getRootNode() throws RepositoryException {
         ensureIsAlive();
-        return new NodeImpl(new NodeDelegate(dlg, dlg.getTree("/")));
+        return new NodeImpl(dlg.getRoot());
     }
 
     @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=1335171&r1=1335170&r2=1335171&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
Mon May  7 18:22:07 2012
@@ -334,16 +334,16 @@ public class UserManagerImpl implements 
 
     void setInternalProperty(Node userNode, String name, String value, int type) throws RepositoryException
{
         CoreValue cv = ValueConverter.toCoreValue(value, type, sessionDelegate);
-        sessionDelegate.getTree(getInternalPath(userNode)).setProperty(name, cv);
+        sessionDelegate.getNode(getInternalPath(userNode)).setProperty(name, cv);
     }
 
     void setInternalProperty(Node userNode, String name, String[] values, int type) throws
RepositoryException {
         List<CoreValue> cvs = ValueConverter.toCoreValues(values, type, sessionDelegate);
-        sessionDelegate.getTree(getInternalPath(userNode)).setProperty(name, cvs);
+        sessionDelegate.getNode(getInternalPath(userNode)).setProperty(name, cvs);
     }
 
     void removeInternalProperty(Node userNode, String name) throws RepositoryException {
-        sessionDelegate.getTree(getInternalPath(userNode)).removeProperty(name);
+        sessionDelegate.getNode(getInternalPath(userNode)).getProperty(name).remove();
     }
 
     Session getSession() {



Mime
View raw message