directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1513795 - /directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
Date Wed, 14 Aug 2013 10:06:41 GMT
Author: elecharny
Date: Wed Aug 14 10:06:41 2013
New Revision: 1513795

URL: http://svn.apache.org/r1513795
Log:
Hack to set the NormalizingComparator server flag to true at startup

Modified:
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?rev=1513795&r1=1513794&r2=1513795&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
(original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
Wed Aug 14 10:06:41 2013
@@ -25,7 +25,10 @@ import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.api.ldap.model.constants.SchemaConstants;
+import org.apache.directory.api.ldap.model.schema.LdapComparator;
 import org.apache.directory.api.ldap.model.schema.SchemaManager;
+import org.apache.directory.api.ldap.model.schema.comparators.NormalizingComparator;
+import org.apache.directory.api.ldap.model.schema.registries.ComparatorRegistry;
 import org.apache.directory.api.ldap.model.schema.registries.SchemaLoader;
 import org.apache.directory.api.ldap.schemaextractor.SchemaLdifExtractor;
 import org.apache.directory.api.ldap.schemaextractor.impl.DefaultSchemaLdifExtractor;
@@ -174,6 +177,17 @@ public class DefaultDirectoryServiceFact
         // and normalize their suffix Dn
         schemaManager.loadAllEnabled();
 
+        // Tell all the normalizer comparators that they should not normalize anything
+        ComparatorRegistry comparatorRegistry = schemaManager.getComparatorRegistry();
+
+        for ( LdapComparator<?> comparator : comparatorRegistry )
+        {
+            if ( comparator instanceof NormalizingComparator )
+            {
+                ( ( NormalizingComparator ) comparator ).setOnServer();
+            }
+        }
+
         directoryService.setSchemaManager( schemaManager );
 
         // Init the LdifPartition
@@ -229,7 +243,7 @@ public class DefaultDirectoryServiceFact
         cacheService.initialize( directoryService.getInstanceLayout() );
 
         directoryService.setCacheService( cacheService );
-        
+
         // Init the service now
         initSchema();
         initSystemPartition();



Mime
View raw message