jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1368830 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user: MembershipManager.java UserManagerImpl.java
Date Fri, 03 Aug 2012 08:24:31 GMT
Author: angela
Date: Fri Aug  3 08:24:31 2012
New Revision: 1368830

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

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/MembershipManager.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/security/user/MembershipManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/MembershipManager.java?rev=1368830&r1=1368829&r2=1368830&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/MembershipManager.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/security/user/MembershipManager.java
Fri Aug  3 08:24:31 2012
@@ -25,7 +25,6 @@ import org.apache.jackrabbit.commons.fla
 import org.apache.jackrabbit.commons.flat.Rank;
 import org.apache.jackrabbit.commons.flat.TreeManager;
 import org.apache.jackrabbit.commons.iterator.RangeIteratorAdapter;
-import org.apache.jackrabbit.oak.jcr.SessionDelegate;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -36,6 +35,7 @@ import javax.jcr.Property;
 import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
+import javax.jcr.ValueFactory;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Comparator;
@@ -50,14 +50,14 @@ class MembershipManager {
     private static final Logger log = LoggerFactory.getLogger(MembershipManager.class);
 
     private final UserManagerImpl userManager;
-    private final SessionDelegate sessionDelegate;
+    private final ValueFactory valueFactory;
     private final int memberSplitSize;
 
     private final String repMembers;
 
-    MembershipManager(UserManagerImpl userManager, int memberSplitSize, SessionDelegate sessionDelegate)
{
+    MembershipManager(UserManagerImpl userManager, int memberSplitSize, ValueFactory valueFactory)
{
         this.userManager = userManager;
-        this.sessionDelegate = sessionDelegate;
+        this.valueFactory = valueFactory;
         this.memberSplitSize = memberSplitSize;
 
         repMembers = userManager.getJcrName(UserConstants.REP_MEMBERS);
@@ -153,7 +153,7 @@ class MembershipManager {
         } else {
             Node memberNode = authorizable.getNode();
             Value[] values;
-            Value toAdd = sessionDelegate.getValueFactory().createValue(memberNode, true);
+            Value toAdd = valueFactory.createValue(memberNode, true);
             if (node.hasProperty(repMembers)) {
                 Value[] old = node.getProperty(repMembers).getValues();
                 values = new Value[old.length + 1];
@@ -185,7 +185,7 @@ class MembershipManager {
             }
         } else {
             if (node.hasProperty(repMembers)) {
-                Value toRemove = sessionDelegate.getValueFactory().createValue((authorizable).getNode(),
true);
+                Value toRemove = valueFactory.createValue((authorizable).getNode(), true);
                 Property property = node.getProperty(repMembers);
                 List<Value> valList = new ArrayList<Value>(Arrays.asList(property.getValues()));
 

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=1368830&r1=1368829&r2=1368830&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
Fri Aug  3 08:24:31 2012
@@ -372,7 +372,7 @@ public class UserManagerImpl implements 
                 log.warn("Invalid value {} for {}. Expected integer >= 4", splitSize,
UserManagerConfig.PARAM_GROUP_MEMBERSHIP_SPLIT_SIZE);
                 splitSize = 0;
             }
-            membershipManager = new MembershipManager(this, splitSize, sessionDelegate);
+            membershipManager = new MembershipManager(this, splitSize, sessionDelegate.getValueFactory());
         }
         return membershipManager;
     }



Mime
View raw message