directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r578130 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
Date Fri, 21 Sep 2007 14:12:16 GMT
Author: elecharny
Date: Fri Sep 21 07:12:15 2007
New Revision: 578130

URL: http://svn.apache.org/viewvc?rev=578130&view=rev
Log:
Implemented a speed improvement :
 if the user don't use any returnAttributes, then the second lookup which was done in the
addCollectiveAttributes method is not done anymore.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java?rev=578130&r1=578129&r2=578130&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
Fri Sep 21 07:12:15 2007
@@ -119,11 +119,18 @@
      */
     private void addCollectiveAttributes( LdapDN normName, Attributes entry, String[] retAttrs
) throws NamingException
     {
-        //Attribute caSubentries = entry.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);
-
-        Attributes entryWithCAS = nexus.lookup( new LookupOperationContext( normName, new
String[] { 
-        	SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT } ) );
-        Attribute caSubentries = entryWithCAS.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);
+        Attribute caSubentries = null;
+        
+        if ( ( retAttrs == null ) || ( retAttrs.length != 1 ) || ( retAttrs[0] != SchemaConstants.ALL_USER_ATTRIBUTES
) )
+        {
+            Attributes entryWithCAS = nexus.lookup( new LookupOperationContext( normName,
new String[] { 
+            	SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT } ) );
+            caSubentries = entryWithCAS.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);
+        }
+        else
+        {
+            caSubentries = entry.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);
+        }
         
         /*
          * If there are no collective attribute subentries referenced
@@ -133,7 +140,7 @@
         {
             return;
         }
-        
+    
         /*
          * Before we proceed we need to lookup the exclusions within the
          * entry and build a set of exclusions for rapid lookup.  We use



Mime
View raw message