Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 37084 invoked from network); 19 Sep 2007 17:14:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Sep 2007 17:14:31 -0000 Received: (qmail 20792 invoked by uid 500); 19 Sep 2007 17:14:23 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 20752 invoked by uid 500); 19 Sep 2007 17:14:23 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 20741 invoked by uid 99); 19 Sep 2007 17:14:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 10:14:23 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2007 17:16:27 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9C3521A983A; Wed, 19 Sep 2007 10:14:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@directory.apache.org From: elecharny@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20070919171408.9C3521A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 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 result = nextInterceptor.search( opContext ); Invocation invocation = InvocationStack.getInstance().peek();