directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r577656 - in /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz: AuthorizationService.java GroupCache.java
Date Thu, 20 Sep 2007 09:44:39 GMT
Author: elecharny
Date: Thu Sep 20 02:44:38 2007
New Revision: 577656

URL: http://svn.apache.org/viewvc?rev=577656&view=rev
Log:
Change from LdapDN to Name in generic Set

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?rev=577656&r1=577655&r2=577656&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
Thu Sep 20 02:44:38 2007
@@ -26,6 +26,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.naming.Name;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.Attribute;
@@ -432,7 +433,7 @@
         }
 
         // Assemble all the information required to make an access control decision
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toNormName() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
 
         // Build the total collection of tuples to be considered for add rights
@@ -496,7 +497,7 @@
             return;
         }
 
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toString() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toString() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, name, entry );
         addEntryAciTuples( tuples, entry );
@@ -545,7 +546,7 @@
             return;
         }
 
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toString() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toString() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, name, entry );
         addEntryAciTuples( tuples, entry );
@@ -633,7 +634,7 @@
             }
         }
 
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toNormName() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, name, entry );
         addEntryAciTuples( tuples, entry );
@@ -672,7 +673,7 @@
 
         PartitionNexusProxy proxy = InvocationStack.getInstance().peek().getProxy();
         LdapDN userName = principal.getJndiName();
-        Set<LdapDN> userGroups = groupCache.getGroups( userName.toNormName() );
+        Set<Name> userGroups = groupCache.getGroups( userName.toNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, dn, entry );
         addEntryAciTuples( tuples, entry );
@@ -752,7 +753,7 @@
             return;
         }
 
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toString() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toString() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, name, entry );
         addEntryAciTuples( tuples, entry );
@@ -799,7 +800,7 @@
             return;
         }
 
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toString() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toString() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, oriChildName, entry );
         addEntryAciTuples( tuples, entry );
@@ -875,7 +876,7 @@
             return;
         }
 
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toString() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toString() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, oriChildName, entry );
         addEntryAciTuples( tuples, entry );
@@ -985,7 +986,7 @@
             return next.compare( opContext );
         }
 
-        Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toNormName() );
+        Set<Name> userGroups = groupCache.getGroups( principalDn.toNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( proxy, tuples, name, entry );
         addEntryAciTuples( tuples, entry );
@@ -1023,7 +1024,7 @@
         while ( matched.size() > 0 )
         {
             entry = proxy.lookup( new LookupOperationContext( matched ), PartitionNexusProxy.GETMATCHEDDN_BYPASS
);
-            Set<LdapDN> userGroups = groupCache.getGroups( principalDn.toString() );
+            Set<Name> userGroups = groupCache.getGroups( principalDn.toString() );
             Collection<ACITuple> tuples = new HashSet<ACITuple>();
             addPerscriptiveAciTuples( proxy, tuples, matched, entry );
             addEntryAciTuples( tuples, entry );
@@ -1058,7 +1059,7 @@
         Attributes entry = invocation.getProxy().lookup( new LookupOperationContext( normName
), PartitionNexusProxy.LOOKUP_BYPASS );
         ServerLdapContext ctx = ( ServerLdapContext ) invocation.getCaller();
         LdapDN userDn = ctx.getPrincipal().getJndiName();
-        Set<LdapDN> userGroups = groupCache.getGroups( userDn.toNormName() );
+        Set<Name> userGroups = groupCache.getGroups( userDn.toNormName() );
         Collection<ACITuple> tuples = new HashSet<ACITuple>();
         addPerscriptiveAciTuples( invocation.getProxy(), tuples, normName, entry );
         addEntryAciTuples( tuples, entry );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=577656&r1=577655&r2=577656&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
Thu Sep 20 02:44:38 2007
@@ -43,6 +43,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.naming.Name;
 import javax.naming.NamingException;
 import javax.naming.NamingEnumeration;
 import javax.naming.directory.Attribute;
@@ -93,7 +94,7 @@
     /** the normalized dn of the administrators group */
     private LdapDN administratorsGroupDn;
     
-    private static final Set<LdapDN> EMPTY_GROUPS = new HashSet<LdapDN>();
+    private static final Set<Name> EMPTY_GROUPS = new HashSet<Name>();
     
     /**
      * Creates a static group cache.
@@ -489,7 +490,7 @@
      * @return a Set of Name objects representing the groups
      * @throws NamingException if there are problems accessing attribute  values
      */
-    public Set<LdapDN> getGroups( String member ) throws NamingException
+    public Set<Name> getGroups( String member ) throws NamingException
     {
     	LdapDN normMember = null;
     	
@@ -503,7 +504,7 @@
             return EMPTY_GROUPS;
         }
 
-        Set<LdapDN> memberGroups = null;
+        Set<Name> memberGroups = null;
 
         for ( String group:groups.keySet() )
         {
@@ -518,7 +519,7 @@
             {
                 if ( memberGroups == null )
                 {
-                    memberGroups = new HashSet<LdapDN>();
+                    memberGroups = new HashSet<Name>();
                 }
 
                 memberGroups.add( parseNormalized( group ) );



Mime
View raw message