jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1378900 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/ main/java/org/apache/jackrabbit/oak/security/authorization/ main/java/org/apache/jackrabbit/oak/security/privilege/ main/java/org/apache/jackrabbit/...
Date Thu, 30 Aug 2012 12:00:02 GMT
Author: jukka
Date: Thu Aug 30 12:00:01 2012
New Revision: 1378900

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

Avoid passing around CoreValueFactory instances when they're not needed

Modified:
    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/security/authorization/AccessControlContextImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlValidatorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeDefinitionReader.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidator.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidatorProvider.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContextImpl.java
    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/spi/security/authorization/AccessControlContext.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TestAcContext.java

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=1378900&r1=1378899&r2=1378900&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 Aug 30 12:00:01 2012
@@ -26,7 +26,6 @@ import javax.annotation.Nonnull;
 import org.apache.jackrabbit.oak.api.ChangeExtractor;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ConflictHandler;
-import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.TreeLocation;
 import org.apache.jackrabbit.oak.security.privilege.PrivilegeValidatorProvider;
@@ -254,16 +253,15 @@ public class RootImpl implements Root {
     }
 
     private CommitHook createCommitHook() {
-        CoreValueFactory valueFactory = store.getValueFactory();
         List<ValidatorProvider> providers = new ArrayList<ValidatorProvider>();
 
         // TODO: refactor once permissions are read from content (make sure we read from
an up to date store)
-        providers.add(accessControlContext.getPermissionValidatorProvider(valueFactory));
-        providers.add(accessControlContext.getAccessControlValidatorProvider(valueFactory));
+        providers.add(accessControlContext.getPermissionValidatorProvider());
+        providers.add(accessControlContext.getAccessControlValidatorProvider());
         // TODO the following v-providers could be initialized at ContentRepo level
         // FIXME: retrieve from user context
-        providers.add(new UserValidatorProvider(valueFactory, new UserConfig("admin")));
-        providers.add(new PrivilegeValidatorProvider(valueFactory));
+        providers.add(new UserValidatorProvider(new UserConfig("admin")));
+        providers.add(new PrivilegeValidatorProvider());
 
         return new ValidatingHook(new CompositeValidatorProvider(providers));
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlContextImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlContextImpl.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlContextImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlContextImpl.java
Thu Aug 30 12:00:01 2012
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.securi
 import java.security.Principal;
 import java.util.Set;
 
-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.spi.commit.ValidatorProvider;
@@ -56,13 +55,13 @@ public class AccessControlContextImpl im
     }
 
     @Override
-    public ValidatorProvider getPermissionValidatorProvider(CoreValueFactory valueFactory)
{
-        return new PermissionValidatorProvider(valueFactory, this);
+    public ValidatorProvider getPermissionValidatorProvider() {
+        return new PermissionValidatorProvider(this);
     }
 
     @Override
-    public ValidatorProvider getAccessControlValidatorProvider(CoreValueFactory valueFactory)
{
-        return new AccessControlValidatorProvider(valueFactory, this);
+    public ValidatorProvider getAccessControlValidatorProvider() {
+        return new AccessControlValidatorProvider(this);
     }
 
     //--------------------------------------------------------------------------

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlValidatorProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlValidatorProvider.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlValidatorProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/AccessControlValidatorProvider.java
Thu Aug 30 12:00:01 2012
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.oak.securi
 
 import javax.annotation.Nonnull;
 
-import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.spi.commit.Validator;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 import org.apache.jackrabbit.oak.spi.security.authorization.AccessControlContext;
@@ -36,7 +35,7 @@ class AccessControlValidatorProvider imp
      */
     private static final Logger log = LoggerFactory.getLogger(AccessControlValidatorProvider.class);
 
-    public AccessControlValidatorProvider(CoreValueFactory valueFactory, AccessControlContext
accessControlContext) {
+    public AccessControlValidatorProvider(AccessControlContext accessControlContext) {
         // TODO
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/authorization/PermissionValidatorProvider.java
Thu Aug 30 12:00:01 2012
@@ -18,9 +18,7 @@ package org.apache.jackrabbit.oak.securi
 
 import javax.annotation.Nonnull;
 
-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.authorization.AccessControlContext;
@@ -32,11 +30,9 @@ import org.apache.jackrabbit.oak.util.No
  */
 class PermissionValidatorProvider implements ValidatorProvider {
 
-    private final CoreValueFactory coreValueFactory;
     private final AccessControlContext accessControlContext;
 
-    public PermissionValidatorProvider(CoreValueFactory coreValueFactory, AccessControlContext
accessControlContext) {
-        this.coreValueFactory = coreValueFactory;
+    public PermissionValidatorProvider(AccessControlContext accessControlContext) {
         this.accessControlContext = accessControlContext;
     }
 
@@ -44,8 +40,8 @@ class PermissionValidatorProvider implem
     @Nonnull
     @Override
     public Validator getRootValidator(NodeState before, NodeState after) {
-        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before), coreValueFactory, NamePathMapper.DEFAULT);
-        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after), coreValueFactory, NamePathMapper.DEFAULT);
+        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before));
+        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after));
         return new PermissionValidator(accessControlContext.getPermissions(), rootBefore,
rootAfter);
     }
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeDefinitionReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeDefinitionReader.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeDefinitionReader.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeDefinitionReader.java
Thu Aug 30 12:00:01 2012
@@ -32,9 +32,7 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.jackrabbit.oak.api.ContentSession;
-import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.namepath.NamePathMapper;
 import org.apache.jackrabbit.oak.spi.security.privilege.PrivilegeDefinition;
 import org.apache.jackrabbit.oak.util.NodeUtil;
 import org.w3c.dom.Attr;
@@ -57,16 +55,14 @@ import static org.apache.jackrabbit.oak.
  */
 class PrivilegeDefinitionReader {
 
-    private final CoreValueFactory valueFactory;
     private final Tree privilegesTree;
 
-    PrivilegeDefinitionReader(CoreValueFactory valueFactory, Tree privilegesTree) {
-        this.valueFactory = valueFactory;
+    PrivilegeDefinitionReader(Tree privilegesTree) {
         this.privilegesTree = privilegesTree;
     }
 
     PrivilegeDefinitionReader(ContentSession contentSession) {
-        this(contentSession.getCoreValueFactory(), contentSession.getCurrentRoot().getTree(PRIVILEGES_PATH));
+        this(contentSession.getCurrentRoot().getTree(PRIVILEGES_PATH));
     }
 
     Map<String, PrivilegeDefinition> readDefinitions() {
@@ -81,7 +77,7 @@ class PrivilegeDefinitionReader {
     }
 
     PrivilegeDefinition readDefinition(Tree definitionTree) {
-        NodeUtil n = new NodeUtil(definitionTree, valueFactory, NamePathMapper.DEFAULT);
+        NodeUtil n = new NodeUtil(definitionTree);
         String name = n.getName();
         boolean isAbstract = n.getBoolean(REP_IS_ABSTRACT);
         String[] declAggrNames = n.getStrings(REP_AGGREGATES);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeRegistry.java
Thu Aug 30 12:00:01 2012
@@ -24,7 +24,6 @@ import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.oak.api.CommitFailedException;
 import org.apache.jackrabbit.oak.api.ContentSession;
-import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.core.DefaultConflictHandler;
@@ -109,7 +108,6 @@ public class PrivilegeRegistry implement
     //------------------------------------------------------------< private >---
 
     private void internalRegisterDefinitions(PrivilegeDefinition toRegister) throws RepositoryException
{
-        CoreValueFactory vf = contentSession.getCoreValueFactory();
         Root root = contentSession.getCurrentRoot();
 
         try {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidator.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidator.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidator.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidator.java
Thu Aug 30 12:00:01 2012
@@ -23,7 +23,6 @@ import javax.jcr.RepositoryException;
 
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.oak.api.CommitFailedException;
-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.core.ReadOnlyTree;
@@ -41,7 +40,7 @@ class PrivilegeValidator implements Priv
     private final Map<String, PrivilegeDefinition> definitions;
     private final PrivilegeDefinitionReader reader;
 
-    PrivilegeValidator(CoreValueFactory valueFactory, Tree rootBefore) {
+    PrivilegeValidator(Tree rootBefore) {
         Tree privilegesBefore = null;
         Tree system = rootBefore.getChild(JcrConstants.JCR_SYSTEM);
         if (system != null) {
@@ -49,7 +48,7 @@ class PrivilegeValidator implements Priv
         }
 
         if (privilegesBefore != null) {
-            reader = new PrivilegeDefinitionReader(valueFactory, privilegesBefore);
+            reader = new PrivilegeDefinitionReader(privilegesBefore);
             definitions = PrivilegeRegistry.getAllDefinitions(reader);
         } else {
             reader = null;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidatorProvider.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidatorProvider.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidatorProvider.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/privilege/PrivilegeValidatorProvider.java
Thu Aug 30 12:00:01 2012
@@ -18,7 +18,6 @@ package org.apache.jackrabbit.oak.securi
 
 import javax.annotation.Nonnull;
 
-import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.core.ReadOnlyTree;
 import org.apache.jackrabbit.oak.spi.commit.SubtreeValidator;
 import org.apache.jackrabbit.oak.spi.commit.Validator;
@@ -35,15 +34,9 @@ import static org.apache.jackrabbit.oak.
  */
 public class PrivilegeValidatorProvider implements ValidatorProvider {
 
-    private final CoreValueFactory valueFactory;
-
-    public PrivilegeValidatorProvider(CoreValueFactory valueFactory) {
-        this.valueFactory = valueFactory;
-    }
-
     @Nonnull
     @Override
     public Validator getRootValidator(NodeState before, NodeState after) {
-        return new SubtreeValidator(new PrivilegeValidator(valueFactory, new ReadOnlyTree(before)),
JCR_SYSTEM, REP_PRIVILEGES);
+        return new SubtreeValidator(new PrivilegeValidator(new ReadOnlyTree(before)), JCR_SYSTEM,
REP_PRIVILEGES);
     }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContextImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContextImpl.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContextImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/security/user/UserContextImpl.java
Thu Aug 30 12:00:01 2012
@@ -58,6 +58,6 @@ public class UserContextImpl implements 
 
     @Override
     public ValidatorProvider getUserValidatorProvider(CoreValueFactory valueFactory) {
-        return new UserValidatorProvider(valueFactory, config);
+        return new UserValidatorProvider(config);
     }
 }
\ No newline at end of file

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=1378900&r1=1378899&r2=1378900&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
Thu Aug 30 12:00:01 2012
@@ -18,9 +18,7 @@ package org.apache.jackrabbit.oak.securi
 
 import javax.annotation.Nonnull;
 
-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.UserConfig;
@@ -32,14 +30,10 @@ import org.apache.jackrabbit.oak.util.No
  */
 public class UserValidatorProvider implements ValidatorProvider {
 
-    private final CoreValueFactory valueFactory;
     private final UserConfig config;
 
-    public UserValidatorProvider(CoreValueFactory valueFactory, UserConfig config) {
-        assert valueFactory != null;
+    public UserValidatorProvider(UserConfig config) {
         assert config != null;
-
-        this.valueFactory = valueFactory;
         this.config = config;
     }
     //--------------------------------------------------< ValidatorProvider >---
@@ -47,8 +41,8 @@ public class UserValidatorProvider imple
     @Override
     public Validator getRootValidator(NodeState before, NodeState after) {
 
-        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before), valueFactory, NamePathMapper.DEFAULT);
-        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after), valueFactory, NamePathMapper.DEFAULT);
+        NodeUtil rootBefore = new NodeUtil(new ReadOnlyTree(before));
+        NodeUtil rootAfter = new NodeUtil(new ReadOnlyTree(after));
 
         return new UserValidator(rootBefore, rootAfter, this);
     }
@@ -59,8 +53,4 @@ public class UserValidatorProvider imple
         return config;
     }
 
-    @Nonnull
-    CoreValueFactory getValueFactory() {
-        return valueFactory;
-    }
 }
\ No newline at end of file

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlContext.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlContext.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/authorization/AccessControlContext.java
Thu Aug 30 12:00:01 2012
@@ -19,7 +19,6 @@ package org.apache.jackrabbit.oak.spi.se
 import java.security.Principal;
 import java.util.Set;
 
-import org.apache.jackrabbit.oak.api.CoreValueFactory;
 import org.apache.jackrabbit.oak.spi.commit.ValidatorProvider;
 
 /**
@@ -32,7 +31,7 @@ public interface AccessControlContext {
     // TODO define how permissions eval is bound to a particular revision/branch. (passing
Tree?)
     CompiledPermissions getPermissions();
 
-    ValidatorProvider getPermissionValidatorProvider(CoreValueFactory valueFactory);
+    ValidatorProvider getPermissionValidatorProvider();
 
-    ValidatorProvider getAccessControlValidatorProvider(CoreValueFactory valueFactory);
+    ValidatorProvider getAccessControlValidatorProvider();
 }

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=1378900&r1=1378899&r2=1378900&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
Thu Aug 30 12:00:01 2012
@@ -37,6 +37,7 @@ import org.apache.jackrabbit.oak.api.Pro
 import org.apache.jackrabbit.oak.api.Tree;
 import org.apache.jackrabbit.oak.namepath.NameMapper;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
+import org.apache.jackrabbit.oak.plugins.memory.MemoryValueFactory;
 import org.apache.jackrabbit.util.ISO8601;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -61,15 +62,17 @@ public class NodeUtil {
     }
 
     public NodeUtil(Tree tree, CoreValueFactory factory) {
-        this.tree = tree;
-        this.factory = factory;
-        this.mapper = NamePathMapper.DEFAULT;
+        this(tree, factory, NamePathMapper.DEFAULT);
     }
 
     public NodeUtil(Tree tree, ContentSession contentSession) {
         this(tree, contentSession.getCoreValueFactory());
     }
 
+    public NodeUtil(Tree tree) {
+        this(tree, MemoryValueFactory.INSTANCE);
+    }
+
     @Nonnull
     public Tree getTree() {
         return tree;

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TestAcContext.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TestAcContext.java?rev=1378900&r1=1378899&r2=1378900&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TestAcContext.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/TestAcContext.java
Thu Aug 30 12:00:01 2012
@@ -71,12 +71,12 @@ public class TestAcContext implements Ac
     }
 
     @Override
-    public ValidatorProvider getPermissionValidatorProvider(CoreValueFactory valueFactory)
{
+    public ValidatorProvider getPermissionValidatorProvider() {
         return new DefaultValidatorProvider();
     }
 
     @Override
-    public ValidatorProvider getAccessControlValidatorProvider(CoreValueFactory valueFactory)
{
+    public ValidatorProvider getAccessControlValidatorProvider() {
         return new DefaultValidatorProvider();
     }
 }



Mime
View raw message