directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r661471 - /directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
Date Thu, 29 May 2008 20:37:31 GMT
Author: akarasulu
Date: Thu May 29 13:37:31 2008
New Revision: 661471

URL: http://svn.apache.org/viewvc?rev=661471&view=rev
Log:
removing unncessary lookup operations in filter

Modified:
    directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java

Modified: directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=661471&r1=661470&r2=661471&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
(original)
+++ directory/apacheds/branches/bigbang/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
Thu May 29 13:37:31 2008
@@ -114,44 +114,35 @@
      * @param retAttrs array or attribute type to be specifically included in the result
entry(s)
      * @throws NamingException if there are problems accessing subentries
      */
-    private void addCollectiveAttributes( LdapDN normName, ServerEntry entry, String[] retAttrs
) throws Exception
+    private void addCollectiveAttributes( LdapDN normName, ClonedServerEntry entry, String[]
retAttrs ) throws Exception
     {
-        EntryAttribute caSubentries;
-
-        //noinspection StringEquality
-        if ( ( retAttrs == null ) || ( retAttrs.length != 1 ) || ( retAttrs[0] != SchemaConstants.ALL_USER_ATTRIBUTES
) )
-        {
-            ServerEntry entryWithCAS = nexus.lookup( new LookupOperationContext( registries,
normName, new String[] { 
-            	SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT_OID } ) );
-            caSubentries = entryWithCAS.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);
-        }
-        else
-        {
-            caSubentries = entry.get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);
-        }
+        EntryAttribute collectiveAttributeSubentries = 
+            entry.getOriginalEntry().get( SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT
);
         
         /*
-         * If there are no collective attribute subentries referenced
-         * then we have no collective attributes to inject to this entry.
+         * If there are no collective attribute subentries referenced then we 
+         * have no collective attributes to inject to this entry.
          */
-        if ( caSubentries == null )
+        if ( collectiveAttributeSubentries == null )
         {
             return;
         }
     
         /*
-         * Before we proceed we need to lookup the exclusions within the
-         * entry and build a set of exclusions for rapid lookup.  We use
-         * OID values in the exclusions set instead of regular names that
-         * may have case variance.
+         * Before we proceed we need to lookup the exclusions within the entry 
+         * and build a set of exclusions for rapid lookup.  We use OID values 
+         * in the exclusions set instead of regular names that may have case 
+         * variance.
          */
-        EntryAttribute collectiveExclusions = entry.get( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT
);
+        EntryAttribute collectiveExclusions = 
+            entry.getOriginalEntry().get( SchemaConstants.COLLECTIVE_EXCLUSIONS_AT );
         Set<String> exclusions = new HashSet<String>();
         
         if ( collectiveExclusions != null )
         {
             if ( collectiveExclusions.contains( SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT_OID
)
-                || collectiveExclusions.contains( SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT
 ) )
+                 || 
+                 collectiveExclusions.contains( SchemaConstants.EXCLUDE_ALL_COLLECTIVE_ATTRIBUTES_AT
 ) )
             {
                 /*
                  * This entry does not allow any collective attributes
@@ -202,7 +193,7 @@
          * attributes of the subentry and copy collective attributes from the
          * subentry into the entry.
          */
-        for ( Value<?> value:caSubentries )
+        for ( Value<?> value:collectiveAttributeSubentries )
         {
             String subentryDnStr = ( String ) value.get();
             LdapDN subentryDn = new LdapDN( subentryDnStr );



Mime
View raw message