directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r544530 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Date Tue, 05 Jun 2007 16:00:42 GMT
Author: elecharny
Date: Tue Jun  5 09:00:41 2007
New Revision: 544530

URL: http://svn.apache.org/viewvc?view=rev&rev=544530
Log:
Slight optiomization : instead of normalizing the subschemaSubentryDn
for each search, declared it as a constant.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?view=diff&rev=544530&r1=544529&r2=544530
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Tue Jun  5 09:00:41 2007
@@ -150,6 +150,9 @@
      * subschemaSubentry attribute's value from Root DSE
      */
     private LdapDN subschemaSubentryDn;
+    
+    /** A normalized form for the SubschemaSubentry DN */
+    private String subschemaSubentryDnNorm;
 
     /**
      * the normalized name for the schema modification attributes
@@ -213,6 +216,7 @@
         String subschemaSubentry = ( String ) nexus.getRootDSE( null ).get( "subschemaSubentry"
).get();
         subschemaSubentryDn = new LdapDN( subschemaSubentry );
         subschemaSubentryDn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping()
);
+        subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
 
         schemaModificationAttributesDN = new LdapDN( "cn=schemaModifications,ou=schema" );
         schemaModificationAttributesDN.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping()
);
@@ -486,7 +490,7 @@
         filterAttributesToReturn( searchCtls );
 
         // Deal with the normal case : searching for a normal value (not subSchemaSubEntry
-        if ( !subschemaSubentryDn.toNormName().equals( base.toNormName() ) )
+        if ( !subschemaSubentryDnNorm.equals( base.toNormName() ) )
         {
             NamingEnumeration e = nextInterceptor.search( opContext );
             
@@ -1234,7 +1238,7 @@
 
         // handle operations against the schema subentry in the schema service
         // and never try to look it up in the nexus below
-        if ( name.getNormName().equalsIgnoreCase( subschemaSubentryDn.getNormName() ) )
+        if ( name.getNormName().equalsIgnoreCase( subschemaSubentryDnNorm ) )
         {
             entry = getSubschemaEntry( schemaSubentryReturnAttributes );
         }
@@ -1527,7 +1531,7 @@
         {
             schemaManager.modify( name, mods, entry, targetEntry );
         }
-        else if ( subschemaSubentryDn.getNormName().equals( name.getNormName() ) )
+        else if ( subschemaSubentryDnNorm.equals( name.getNormName() ) )
         {
             schemaManager.modifySchemaSubentry( name, mods, entry, targetEntry );
             return;



Mime
View raw message