directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r577387 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java
Date Wed, 19 Sep 2007 17:14:08 GMT
Author: elecharny
Date: Wed Sep 19 10:14:07 2007
New Revision: 577387

URL: http://svn.apache.org/viewvc?rev=577387&view=rev
Log:
Added a speedup to avoid a DN normalization to be done if not necessary

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=577387&r1=577386&r2=577387&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
Wed Sep 19 10:14:07 2007
@@ -78,7 +78,12 @@
             throws NamingException
         {
             LdapDN name = ((ServerSearchResult)result).getDn();
-            name = LdapDN.normalize( name, attrTypeRegistry.getNormalizerMapping() );
+            
+            if ( !name.isNormalized() )
+            {
+            	name = LdapDN.normalize( name, attrTypeRegistry.getNormalizerMapping() );
+            }
+            
             Attributes entry = result.getAttributes();
             String[] retAttrs = controls.getReturningAttributes();
             addCollectiveAttributes( name, entry, retAttrs );
@@ -114,10 +119,12 @@
      */
     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
);
-
+        
         /*
          * If there are no collective attribute subentries referenced
          * then we have no collective attributes to inject to this entry.
@@ -318,6 +325,17 @@
 
     public NamingEnumeration<SearchResult> search( NextInterceptor nextInterceptor,
SearchOperationContext opContext ) throws NamingException
     {
+    	/*
+        SearchControls sc = opContext.getSearchControls();
+        String[] returnedAttrs = sc.getReturningAttributes();
+        
+        String[] newReturnedAttrs = new String[returnedAttrs.length + 1];
+        System.arraycopy( returnedAttrs, 0, newReturnedAttrs, 0, returnedAttrs.length );
+        newReturnedAttrs[returnedAttrs.length] = SchemaConstants.COLLECTIVE_ATTRIBUTE_SUBENTRIES_AT;
+        
+        sc.setReturningAttributes( newReturnedAttrs );
+        */
+        
         NamingEnumeration<SearchResult> result = nextInterceptor.search( opContext
);
         Invocation invocation = InvocationStack.getInstance().peek();
         



Mime
View raw message