jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1372781 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: security/user/UserValidatorProvider.java util/NodeUtil.java
Date Tue, 14 Aug 2012 08:45:42 GMT
Author: angela
Date: Tue Aug 14 08:45:42 2012
New Revision: 1372781

URL: http://svn.apache.org/viewvc?rev=1372781&view=rev
Log:
OAK-50 : Implement User Management (WIP)

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java?rev=1372781&r1=1372780&r2=1372781&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserValidatorProvider.java
Tue Aug 14 08:45:42 2012
@@ -21,7 +21,6 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.core.ReadOnlyTree;
-import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.spi.commit.Validator;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.oak.spi.security.user.UserManagerConfig;
@@ -40,11 +39,9 @@ public class UserValidatorProvider imple
     @Nonnull
     @Override
     public Validator getRootValidator(NodeState before, NodeState after) {
-        NamePathMapper mapper = new NamePathMapper.Default();
-        CoreValueFactory vf = contentSession.getCoreValueFactory();
 
-        NodeUtil rootBefore = new NodeUtil(vf, mapper, new ReadOnlyTree(before));
-        NodeUtil rootAfter = new NodeUtil(vf, mapper, new ReadOnlyTree(after));
+        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before), contentSession);
+        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after), contentSession);
 
         return new UserValidator(rootBefore, rootAfter, this);
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java?rev=1372781&r1=1372780&r2=1372781&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
Tue Aug 14 08:45:42 2012
@@ -28,11 +28,13 @@ import javax.jcr.ValueFactory;
 
 import com.google.common.collect.Lists;
 import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.oak.api.ContentSession;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NameMapper;
+import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,6 +57,12 @@ public class NodeUtil {
         this.tree = tree;
     }
 
+    public NodeUtil(Tree tree, ContentSession contentSession) {
+        this.tree = tree;
+        this.factory = contentSession.getCoreValueFactory();
+        this.mapper = new NamePathMapper.Default();
+    }
+
     @Nonnull
     public Tree getTree() {
         return tree;



Mime
View raw message