directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r966207 - in /directory/apacheds/trunk: core-integ/src/main/java/org/apache/directory/server/core/integ/ core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/ core-integ/src/test/java/org/apache/directory/server/core/auth...
Date Wed, 21 Jul 2010 12:29:03 GMT
Author: kayyagari
Date: Wed Jul 21 12:29:02 2010
New Revision: 966207

URL: http://svn.apache.org/viewvc?rev=966207&view=rev
Log:
o removed call to DN.normalize(oidMap) wherever possible

Modified:
    directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
    directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
    directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
    directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java

Modified: directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java (original)
+++ directory/apacheds/trunk/core-integ/src/main/java/org/apache/directory/server/core/integ/IntegrationUtils.java Wed Jul 21 12:29:02 2010
@@ -151,8 +151,7 @@ public class IntegrationUtils
             principalDn = "";
         }
 
-        DN userDn = new DN( principalDn );
-        userDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+        DN userDn = new DN( principalDn, service.getSchemaManager() );
         LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
 
         if ( dn == null )
@@ -174,8 +173,7 @@ public class IntegrationUtils
             principalDn = "";
         }
         
-        DN userDn = new DN( principalDn );
-        userDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+        DN userDn = new DN( principalDn, service.getSchemaManager() );
         LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
         
         if ( dn == null )

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authn/ppolicy/PasswordPolicyTest.java Wed Jul 21 12:29:02 2010
@@ -77,6 +77,8 @@ import org.junit.runner.RunWith;
         @CreateTransport( protocol = "LDAP" ), 
         @CreateTransport( protocol = "LDAPS" ) 
     })
+
+// disable changelog, for more info see DIRSERVER-1528
 @CreateDS( enableChangeLog=false)
 public class PasswordPolicyTest extends AbstractLdapTestUnit
 {
@@ -237,9 +239,9 @@ public class PasswordPolicyTest extends 
         modResp = connection.modify( modReq );
         assertEquals( ResultCodeEnum.SUCCESS, modResp.getLdapResult().getResultCode() );
         
-//        LdapConnection userConnection = getNetworkConnectionAs( ldapServer, userDn.getName(), "123456" );
-//        assertNotNull( userConnection );
-//        assertTrue( userConnection.isAuthenticated() );
+        LdapConnection userConnection = getNetworkConnectionAs( ldapServer, userDn.getName(), "123456" );
+        assertNotNull( userConnection );
+        assertTrue( userConnection.isAuthenticated() );
     }
 
     private PasswordPolicyResponseControl getPwdRespCtrl( AbstractResponseWithResult resp ) throws Exception
@@ -251,7 +253,6 @@ public class PasswordPolicyTest extends 
         }
 
         PasswordPolicyResponseControl respCtrl = new PasswordPolicyResponseControl();
-        //        System.out.println( StringTools.dumpBytes( ctrl.getValue() ) );
         decoder.decode( ctrl.getValue(), respCtrl );
 
         return respCtrl;

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/authz/AuthorizationServiceAsNonAdminIT.java Wed Jul 21 12:29:02 2010
@@ -141,8 +141,7 @@ public class AuthorizationServiceAsNonAd
         Modification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, attribute );
         mods.add( mod );
       
-        DN userDn = new DN( "uid=akarasulu,ou=users,ou=system" );
-        userDn.normalize( service.getSchemaManager().getAttributeTypeRegistry().getNormalizerMapping() );
+        DN userDn = new DN( "uid=akarasulu,ou=users,ou=system", service.getSchemaManager() );
         LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
         CoreSession akarasuluSession = service.getSession( principal );
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java Wed Jul 21 12:29:02 2010
@@ -64,8 +64,7 @@ public class PartitionConfigurationIT ex
         // Test AddContextPartition
         service.addPartition( partition );
 
-        DN suffixDn = new DN( "ou=removable" );
-        suffixDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+        DN suffixDn = new DN( "ou=removable", service.getSchemaManager() );
         Entry ctxEntry = new DefaultEntry( service.getSchemaManager(), suffixDn );
         ctxEntry.put( "objectClass", "top" );
         ctxEntry.get( "objectClass" ).add( "organizationalUnit" );

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxHandlerIT.java Wed Jul 21 12:29:02 2010
@@ -600,8 +600,7 @@ public class MetaSyntaxHandlerIT extends
     
     private void modify( int op, List<String> descriptions, String opAttr ) throws Exception
     {
-        DN dn = new DN( getSubschemaSubentryDN() );
-        dn.normalize( service.getSchemaManager().getNormalizerMapping() );
+        DN dn = new DN( getSubschemaSubentryDN(), service.getSchemaManager() );
         Attribute attr = new BasicAttribute( opAttr );
         
         for ( String description : descriptions )

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/SubschemaSubentryIT.java Wed Jul 21 12:29:02 2010
@@ -1877,8 +1877,7 @@ public class SubschemaSubentryIT extends
         Attribute modifiersNameAttr = subentry.get( "modifiersName" );
         Attribute modifyTimestampAttr = subentry.get( "modifyTimestamp" );
         assertNotNull( modifiersNameAttr );
-        DN expectedDN = new DN( "uid=admin,ou=system" );
-        expectedDN.normalize( service.getSchemaManager().getNormalizerMapping() );
+        DN expectedDN = new DN( "uid=admin,ou=system", service.getSchemaManager() );
         assertEquals( expectedDN.getName(), modifiersNameAttr.get() );
         assertNotNull( modifyTimestampAttr );
 
@@ -1915,8 +1914,7 @@ public class SubschemaSubentryIT extends
         Attribute modifiersNameAttrAfter = subentry.get( "modifiersName" );
         Attribute modifiersTimestampAttrAfter = subentry.get( "modifyTimestamp" );
         assertNotNull( modifiersNameAttrAfter );
-        expectedDN = new DN( "uid=admin,ou=system" );
-        expectedDN.normalize( service.getSchemaManager().getNormalizerMapping() );
+        expectedDN = new DN( "uid=admin,ou=system", service.getSchemaManager() );
         assertEquals( expectedDN.getName(), modifiersNameAttrAfter.get() );
         assertNotNull( modifiersTimestampAttrAfter );
         

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Wed Jul 21 12:29:02 2010
@@ -1133,9 +1133,7 @@ public class DefaultDirectoryService imp
         // create system users area
         // -------------------------------------------------------------------
 
-        Map<String,OidNormalizer> oidsMap = schemaManager.getNormalizerMapping();
-        DN userDn = new DN( ServerDNConstants.USERS_SYSTEM_DN );
-        userDn.normalize( oidsMap );
+        DN userDn = new DN( ServerDNConstants.USERS_SYSTEM_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, userDn ) ) )
         {
@@ -1160,8 +1158,7 @@ public class DefaultDirectoryService imp
         // create system groups area
         // -------------------------------------------------------------------
 
-        DN groupDn = new DN( ServerDNConstants.GROUPS_SYSTEM_DN );
-        groupDn.normalize( oidsMap );
+        DN groupDn = new DN( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, groupDn ) ) )
         {
@@ -1186,8 +1183,7 @@ public class DefaultDirectoryService imp
         // create administrator group
         // -------------------------------------------------------------------
 
-        DN name = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
-        name.normalize( oidsMap );
+        DN name = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, name ) ) )
         {
@@ -1213,8 +1209,7 @@ public class DefaultDirectoryService imp
         // create system configuration area
         // -------------------------------------------------------------------
 
-        DN configurationDn = new DN( "ou=configuration,ou=system" );
-        configurationDn.normalize( oidsMap );
+        DN configurationDn = new DN( "ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, configurationDn ) ) )
         {
@@ -1236,8 +1231,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for partition information
         // -------------------------------------------------------------------
 
-        DN partitionsDn = new DN( "ou=partitions,ou=configuration,ou=system" );
-        partitionsDn.normalize( oidsMap );
+        DN partitionsDn = new DN( "ou=partitions,ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, partitionsDn ) ) )
         {
@@ -1258,8 +1252,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for services
         // -------------------------------------------------------------------
 
-        DN servicesDn = new DN( "ou=services,ou=configuration,ou=system" );
-        servicesDn.normalize( oidsMap );
+        DN servicesDn = new DN( "ou=services,ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, servicesDn ) ) )
         {
@@ -1281,8 +1274,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for interceptors
         // -------------------------------------------------------------------
 
-        DN interceptorsDn = new DN( "ou=interceptors,ou=configuration,ou=system" );
-        interceptorsDn.normalize( oidsMap );
+        DN interceptorsDn = new DN( "ou=interceptors,ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, interceptorsDn ) ) )
         {
@@ -1304,8 +1296,7 @@ public class DefaultDirectoryService imp
         // create system preferences area
         // -------------------------------------------------------------------
 
-        DN sysPrefRootDn = new DN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
-        sysPrefRootDn.normalize( oidsMap );
+        DN sysPrefRootDn = new DN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, sysPrefRootDn ) ) )
         {
@@ -1339,8 +1330,7 @@ public class DefaultDirectoryService imp
         // Warn if the default password is not changed.
         boolean needToChangeAdminPassword = false;
 
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
-        adminDn.normalize( schemaManager.getNormalizerMapping() );
+        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
         
         Entry adminEntry = partitionNexus.lookup( new LookupOperationContext( adminSession, adminDn ) );
         Value<?> userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
@@ -1406,8 +1396,7 @@ public class DefaultDirectoryService imp
         partitions.add( schemaService.getSchemaPartition() );
         systemPartition.getSuffix().normalize( schemaManager.getNormalizerMapping() );
 
-        adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN ).normalize( schemaManager.getNormalizerMapping() );
-        adminDn.normalize( schemaManager.getNormalizerMapping() );
+        adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
         adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), this );
         
         // @TODO - NOTE: Need to find a way to instantiate without dependency on DPN

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java Wed Jul 21 12:29:02 2010
@@ -161,8 +161,7 @@ public class ReferralManagerImpl impleme
         for ( String suffix:suffixes )
         {
             // We will store each entry's DN into the Referral tree
-            DN suffixDn = new DN( suffix );
-            suffixDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            DN suffixDn = new DN( suffix, directoryService.getSchemaManager() );
             
             SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffixDn, referralFilter, searchControl );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Wed Jul 21 12:29:02 2010
@@ -189,8 +189,7 @@ public class AciAuthorizationInterceptor
     {
         super.init( directoryService );
 
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
-        adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
         schemaManager = directoryService.getSchemaManager();
@@ -213,8 +212,7 @@ public class AciAuthorizationInterceptor
         // stuff for dealing with subentries (garbage for now)
         Value<?> subschemaSubentry = directoryService.getPartitionNexus().getRootDSE( null ).get(
             SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        DN subschemaSubentryDnName = new DN( subschemaSubentry.getString() );
-        subschemaSubentryDnName.normalize( schemaManager.getNormalizerMapping() );
+        DN subschemaSubentryDnName = new DN( subschemaSubentry.getString(), schemaManager );
         subschemaSubentryDn = subschemaSubentryDnName.getNormName();
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Wed Jul 21 12:29:02 2010
@@ -107,14 +107,11 @@ public class DefaultAuthorizationInterce
         nexus = directoryService.getPartitionNexus();
         SchemaManager schemaManager = directoryService.getSchemaManager();
 
-        ADMIN_SYSTEM_DN = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
-        ADMIN_SYSTEM_DN.normalize( schemaManager.getNormalizerMapping() );
+        ADMIN_SYSTEM_DN = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
 
-        GROUP_BASE_DN = new DN( ServerDNConstants.GROUPS_SYSTEM_DN );
-        GROUP_BASE_DN.normalize( schemaManager.getNormalizerMapping() );
+        GROUP_BASE_DN = new DN( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
 
-        ADMIN_GROUP_DN = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN );
-        ADMIN_GROUP_DN.normalize( schemaManager.getNormalizerMapping() );
+        ADMIN_GROUP_DN = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
 
         uniqueMemberAT = schemaManager.getAttributeType( SchemaConstants.UNIQUE_MEMBER_AT_OID );
 
@@ -126,8 +123,7 @@ public class DefaultAuthorizationInterce
     {
         // read in the administrators and cache their normalized names
         Set<String> newAdministrators = new HashSet<String>( 2 );
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-        adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
 
@@ -142,8 +138,7 @@ public class DefaultAuthorizationInterce
 
         for ( Value<?> value : uniqueMember )
         {
-            DN memberDn = new DN( value.getString() );
-            memberDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            DN memberDn = new DN( value.getString(), directoryService.getSchemaManager() );
             newAdministrators.add( memberDn.getNormName() );
         }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Wed Jul 21 12:29:02 2010
@@ -84,9 +84,9 @@ public class GroupCache
     private AttributeType UNIQUE_MEMBER_AT;
 
     /**
-     * The OIDs normalizer map
+     * the schema manager
      */
-    private Map<String, OidNormalizer> normalizerMap;
+    private SchemaManager schemaManager;
 
     /** the normalized dn of the administrators group */
     private DN administratorsGroupDn;
@@ -102,8 +102,7 @@ public class GroupCache
      */
     public GroupCache( CoreSession session ) throws LdapException
     {
-        SchemaManager schemaManager = session.getDirectoryService().getSchemaManager();
-        normalizerMap = schemaManager.getNormalizerMapping();
+        schemaManager = session.getDirectoryService().getSchemaManager();
         nexus = session.getDirectoryService().getPartitionNexus();
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
         MEMBER_AT = schemaManager.getAttributeType( SchemaConstants.MEMBER_AT );
@@ -118,8 +117,7 @@ public class GroupCache
 
     private DN parseNormalized( String name ) throws LdapException
     {
-        DN dn = new DN( name );
-        dn.normalize( normalizerMap );
+        DN dn = new DN( name, schemaManager );
         return dn;
     }
 
@@ -142,7 +140,7 @@ public class GroupCache
             filter.addNode( new EqualityNode<String>( OBJECT_CLASS_AT, new StringValue(
                 SchemaConstants.GROUP_OF_UNIQUE_NAMES_OC ) ) );
 
-            DN baseDn = new DN( suffix ).normalize( normalizerMap );
+            DN baseDn = new DN( suffix, schemaManager );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             
@@ -156,7 +154,7 @@ public class GroupCache
                 while ( results.next() )
                 {
                     Entry result = results.get();
-                    DN groupDn = result.getDn().normalize( normalizerMap );
+                    DN groupDn = result.getDn().normalize( schemaManager.getNormalizerMapping() );
                     EntryAttribute members = getMemberAttribute( result );
     
                     if ( members != null )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Wed Jul 21 12:29:02 2010
@@ -108,8 +108,7 @@ public class TupleCache
 
     private DN parseNormalized( SchemaManager schemaManager, String name ) throws LdapException
     {
-        DN dn = new DN( name );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( name, schemaManager );
         return dn;
     }
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Wed Jul 21 12:29:02 2010
@@ -119,8 +119,7 @@ public class ExceptionInterceptor extend
     {
         nexus = directoryService.getPartitionNexus();
         Value<?> attr = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemSubentryDn = new DN( attr.getString() );
-        subschemSubentryDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+        subschemSubentryDn = new DN( attr.getString(), directoryService.getSchemaManager() );
         schemaManager = directoryService.getSchemaManager();
 
         // look up some constant information

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Wed Jul 21 12:29:02 2010
@@ -137,12 +137,10 @@ public class OperationalAttributeInterce
         // stuff for dealing with subentries (garbage for now)
         Value<?> subschemaSubentry = service.getPartitionNexus().getRootDSE( null ).get(
             SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemaSubentryDn = new DN( subschemaSubentry.getString() );
-        subschemaSubentryDn.normalize( schemaManager.getNormalizerMapping() );
+        subschemaSubentryDn = new DN( subschemaSubentry.getString(), schemaManager );
 
         // Create the Admin DN 
-        adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
-        adminDn.normalize( schemaManager.getNormalizerMapping() );
+        adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
 
         MODIFIERS_NAME_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFIERS_NAME_AT );
         MODIFY_TIMESTAMP_ATTRIBUTE_TYPE = schemaManager.getAttributeType( SchemaConstants.MODIFY_TIMESTAMP_AT );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Wed Jul 21 12:29:02 2010
@@ -297,8 +297,7 @@ public class DefaultPartitionNexus exten
         system.initialize();
 
         // Add root context entry for system partition
-        DN systemSuffixDn = new DN( ServerDNConstants.SYSTEM_DN );
-        systemSuffixDn.normalize( schemaManager.getNormalizerMapping() );
+        DN systemSuffixDn = new DN( ServerDNConstants.SYSTEM_DN, schemaManager );
         Entry systemEntry = new DefaultEntry( schemaManager, systemSuffixDn );
 
         // Add the ObjectClasses
@@ -312,8 +311,7 @@ public class DefaultPartitionNexus exten
         systemEntry.add( SchemaConstants.ENTRY_UUID_AT, UUID.randomUUID().toString() );
         systemEntry.put( NamespaceTools.getRdnAttribute( ServerDNConstants.SYSTEM_DN ), NamespaceTools
             .getRdnValue( ServerDNConstants.SYSTEM_DN ) );
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-        adminDn.normalize( schemaManager.getNormalizerMapping() );
+        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
         AddOperationContext addOperationContext = new AddOperationContext( adminSession, systemEntry );
@@ -368,8 +366,7 @@ public class DefaultPartitionNexus exten
         {
             try
             {
-                DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-                adminDn.normalize( schemaManager.getNormalizerMapping() );
+                DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
 
                 removeContextPartition(  new DN( suffix ) );
             }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java Wed Jul 21 12:29:02 2010
@@ -115,8 +115,7 @@ public class ServerSystemPreferences ext
         DN parentDn = ( ( ServerSystemPreferences ) parent() ).dn;
         try
         {
-            dn = new DN( "prefNodeName=" + name + "," + parentDn.getName() );
-            dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            dn = new DN( "prefNodeName=" + name + "," + parentDn.getName(), directoryService.getSchemaManager() );
             
             if ( ! directoryService.getAdminSession().exists( dn ) )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Wed Jul 21 12:29:02 2010
@@ -211,8 +211,7 @@ public class ReferralInterceptor extends
         directoryService.setReferralManager( referralManager );
 
         Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemaSubentryDn = new DN( subschemaSubentry.getString() );
-        subschemaSubentryDn.normalize( schemaManager.getNormalizerMapping() );
+        subschemaSubentryDn = new DN( subschemaSubentry.getString(), schemaManager );
 
         // look up some constant information
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Wed Jul 21 12:29:02 2010
@@ -89,7 +89,7 @@ public class DefaultSchemaService implem
             return true;
         }
 
-        DN dn = new DN( dnString ).normalize( schemaPartition.getSchemaManager().getNormalizerMapping() );
+        DN dn = new DN( dnString, schemaPartition.getSchemaManager() );
         return dn.getNormName().equals( ServerDNConstants.CN_SCHEMA_DN_NORMALIZED );
     }
 
@@ -375,9 +375,7 @@ public class DefaultSchemaService implem
     {
         try
         {
-            schemaModificationAttributesDN = new DN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
-            schemaModificationAttributesDN.normalize( 
-                getSchemaManager().getNormalizerMapping() );
+            schemaModificationAttributesDN = new DN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN, getSchemaManager() );
         }
         catch ( LdapException e )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Wed Jul 21 12:29:02 2010
@@ -194,8 +194,7 @@ public class SchemaInterceptor extends B
         filters.add( binaryAttributeFilter );
         filters.add( topFilter );
 
-        schemaBaseDN = new DN( SchemaConstants.OU_SCHEMA );
-        schemaBaseDN.normalize( schemaManager.getNormalizerMapping() );
+        schemaBaseDN = new DN( SchemaConstants.OU_SCHEMA, schemaManager );
         schemaService = directoryService.getSchemaService();
 
         // stuff for dealing with subentries (garbage for now)

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java Wed Jul 21 12:29:02 2010
@@ -78,8 +78,7 @@ public class CoreKeyStoreSpi extends Key
 
     private Entry getTlsEntry() throws Exception
     {
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
-        adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
         LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.SIMPLE );
         CoreSession session = directoryService.getSession( principal );
         return session.lookup( adminDn );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java Wed Jul 21 12:29:02 2010
@@ -74,8 +74,7 @@ public class LdapClassLoader extends Cla
     {
         super( LdapClassLoader.class.getClassLoader() );
         this.directoryService = directoryService;
-        defaultSearchDn = new DN( DEFAULT_SEARCH_CONTEXTS_CONFIG );
-        defaultSearchDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+        defaultSearchDn = new DN( DEFAULT_SEARCH_CONTEXTS_CONFIG, directoryService.getSchemaManager() );
         
         OBJECT_CLASS_AT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
     }
@@ -163,8 +162,7 @@ public class LdapClassLoader extends Cla
                 
                 for ( Value<?> val : attr )
                 {
-                    DN dn = new DN( val.getString() );
-                    dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+                    DN dn = new DN( val.getString(), directoryService.getSchemaManager() );
                     searchContexts.add( dn );
                 }
                 
@@ -188,8 +186,7 @@ public class LdapClassLoader extends Cla
 
                 for ( String suffix:suffixes )
                 {
-                    DN dn = new DN( suffix );
-                    dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+                    DN dn = new DN( suffix, directoryService.getSchemaManager() );
                     namingContexts.add( dn );
                 }
                 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Wed Jul 21 12:29:02 2010
@@ -233,14 +233,12 @@ public class SubentryInterceptor extends
         controls.setReturningAttributes( new String[]
             { SchemaConstants.SUBTREE_SPECIFICATION_AT, SchemaConstants.OBJECT_CLASS_AT } );
 
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
-        adminDn.normalize( schemaManager.getNormalizerMapping() );
+        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
 
         // search each namingContext for subentries
         for ( String suffix : suffixes )
         {
-            DN suffixDn = new DN( suffix );
-            suffixDn.normalize( schemaManager.getNormalizerMapping() );
+            DN suffixDn = new DN( suffix, schemaManager );
 
             CoreSession adminSession = new DefaultCoreSession(
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java Wed Jul 21 12:29:02 2010
@@ -129,8 +129,7 @@ public class TriggerSpecCache
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             
-            DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-            adminDn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+            DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
             CoreSession adminSession = new DefaultCoreSession( 
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
 

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java (original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java Wed Jul 21 12:29:02 2010
@@ -478,7 +478,7 @@ public class SchemaCheckerTest
     {
         Map<String, OidNormalizer> oidNormalizers = schemaManager.getAttributeTypeRegistry().getNormalizerMapping();
         ModificationOperation mod = ModificationOperation.REMOVE_ATTRIBUTE;
-        DN name = new DN( "ou=user,dc=example,dc=com" ).normalize( oidNormalizers );
+        DN name = new DN( "ou=user,dc=example,dc=com", schemaManager );
         AttributeType cnAt = schemaManager.lookupAttributeTypeRegistry( "cn" );
         AttributeType ouAt = schemaManager.lookupAttributeTypeRegistry( "ou" );
         AttributeType snAt = schemaManager.lookupAttributeTypeRegistry( "sn" );

Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmStoreTest.java Wed Jul 21 12:29:02 2010
@@ -126,8 +126,7 @@ public class JdbmStoreTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        EXAMPLE_COM = new DN( "dc=example,dc=com" );
-        EXAMPLE_COM.normalize( schemaManager.getNormalizerMapping() );
+        EXAMPLE_COM = new DN( "dc=example,dc=com", schemaManager );
         
         OU_AT = schemaManager.getAttributeType( SchemaConstants.OU_AT );
         DC_AT = schemaManager.getAttributeType( SchemaConstants.DC_AT );
@@ -206,8 +205,7 @@ public class JdbmStoreTest
         store2.init( schemaManager );
 
         // inject context entry
-        DN suffixDn = new DN( "dc=example,dc=com" );
-        suffixDn.normalize( schemaManager.getNormalizerMapping() );
+        DN suffixDn = new DN( "dc=example,dc=com", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, suffixDn );
         entry.add( "objectClass", "top", "domain" );
         entry.add( "dc", "example" );
@@ -479,8 +477,7 @@ public class JdbmStoreTest
     @Test
     public void testFreshStore() throws Exception
     {
-        DN dn = new DN( "o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "o=Good Times Co.", schemaManager );
         assertEquals( 1L, ( long ) store.getEntryId( dn ) );
         assertEquals( 11, store.count() );
         assertEquals( "o=Good Times Co.", store.getEntryDn( 1L ).getName() );
@@ -514,8 +511,7 @@ public class JdbmStoreTest
         assertEquals( 10, store.count() );
 
         // add an alias and delete to test dropAliasIndices method
-        DN dn = new DN( "commonName=Jack Daniels,ou=Apache,ou=Board of Directors,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "commonName=Jack Daniels,ou=Apache,ou=Board of Directors,o=Good Times Co.", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "alias", "extensibleObject" );
         entry.add( "ou", "Apache" );
@@ -563,8 +559,7 @@ public class JdbmStoreTest
         assertFalse( cursor.next() );
 
         // dn id 12
-        DN martinDn = new DN( "cn=Marting King,ou=Sales,o=Good Times Co." );
-        martinDn.normalize( schemaManager.getNormalizerMapping() );
+        DN martinDn = new DN( "cn=Marting King,ou=Sales,o=Good Times Co.", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, martinDn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Sales" );
@@ -578,8 +573,7 @@ public class JdbmStoreTest
         assertTrue( cursor.previous() );
         assertEquals( 12, ( long ) cursor.get().getId() );
 
-        DN newParentDn = new DN( "ou=Board of Directors,o=Good Times Co." );
-        newParentDn.normalize( schemaManager.getNormalizerMapping() );
+        DN newParentDn = new DN( "ou=Board of Directors,o=Good Times Co.", schemaManager );
         
         DN newDn = ((DN)newParentDn.clone()).add( martinDn.getRdn() );
 
@@ -590,8 +584,7 @@ public class JdbmStoreTest
         assertEquals( 12, ( long ) cursor.get().getId() );
 
         // dn id 13
-        DN marketingDn = new DN( "ou=Marketing,ou=Sales,o=Good Times Co." );
-        marketingDn.normalize( schemaManager.getNormalizerMapping() );
+        DN marketingDn = new DN( "ou=Marketing,ou=Sales,o=Good Times Co.", schemaManager );
         entry = new DefaultEntry( schemaManager, marketingDn );
         entry.add( "objectClass", "top", "organizationalUnit" );
         entry.add( "ou", "Marketing" );
@@ -600,8 +593,7 @@ public class JdbmStoreTest
         store.add( entry );
 
         // dn id 14
-        DN jimmyDn = new DN( "cn=Jimmy Wales,ou=Marketing, ou=Sales,o=Good Times Co." );
-        jimmyDn.normalize( schemaManager.getNormalizerMapping() );
+        DN jimmyDn = new DN( "cn=Jimmy Wales,ou=Marketing, ou=Sales,o=Good Times Co.", schemaManager );
         entry = new DefaultEntry( schemaManager, jimmyDn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Marketing" );
@@ -664,8 +656,7 @@ public class JdbmStoreTest
     @Test(expected = LdapNoSuchObjectException.class)
     public void testAddWithoutParentId() throws Exception
     {
-        DN dn = new DN( "cn=Marting King,ou=Not Present,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=Marting King,ou=Not Present,o=Good Times Co.", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Not Present" );
@@ -677,8 +668,7 @@ public class JdbmStoreTest
     @Test(expected = LdapSchemaViolationException.class)
     public void testAddWithoutObjectClass() throws Exception
     {
-        DN dn = new DN( "cn=Martin King,ou=Sales,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=Martin King,ou=Sales,o=Good Times Co.", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "ou", "Sales" );
         entry.add( "cn", "Martin King" );
@@ -689,8 +679,7 @@ public class JdbmStoreTest
     @Test
     public void testModifyAddOUAttrib() throws Exception
     {
-        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co.", schemaManager );
 
         List<Modification> mods = new ArrayList<Modification>();
         EntryAttribute attrib = new DefaultEntryAttribute( SchemaConstants.OU_AT, OU_AT );
@@ -707,8 +696,7 @@ public class JdbmStoreTest
     @Test
     public void testRename() throws Exception
     {
-        DN dn = new DN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co.", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Engineering" );
@@ -727,8 +715,7 @@ public class JdbmStoreTest
     @Test
     public void testRenameEscaped() throws Exception
     {
-        DN dn = new DN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co.", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "ou", "Engineering" );
@@ -742,8 +729,7 @@ public class JdbmStoreTest
 
         store.rename( dn, rdn, true );
 
-        DN dn2 = new DN( "sn=Ja\\+es,ou=Engineering,o=Good Times Co." );
-        dn2.normalize( schemaManager.getNormalizerMapping() );
+        DN dn2 = new DN( "sn=Ja\\+es,ou=Engineering,o=Good Times Co.", schemaManager );
         Long id = store.getEntryId( dn2 );
         assertNotNull( id );
         Entry entry2 = store.lookup( id );
@@ -754,8 +740,7 @@ public class JdbmStoreTest
     @Test
     public void testMove() throws Exception
     {
-        DN childDn = new DN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co." );
-        childDn.normalize( schemaManager.getNormalizerMapping() );
+        DN childDn = new DN( "cn=Pivate Ryan,ou=Engineering,o=Good Times Co.", schemaManager );
         Entry childEntry = new DefaultEntry( schemaManager, childDn );
         childEntry.add( "objectClass", "top", "person", "organizationalPerson" );
         childEntry.add( "ou", "Engineering" );
@@ -765,19 +750,16 @@ public class JdbmStoreTest
 
         store.add( childEntry );
 
-        DN parentDn = new DN( "ou=Sales,o=Good Times Co." );
-        parentDn.normalize( schemaManager.getNormalizerMapping() );
+        DN parentDn = new DN( "ou=Sales,o=Good Times Co.", schemaManager );
 
         RDN rdn = new RDN( "cn=Ryan" );
 
         store.moveAndRename( childDn, parentDn, rdn, childEntry, true );
 
         // to drop the alias indices   
-        childDn = new DN( "commonName=Jim Bean,ou=Apache,ou=Board of Directors,o=Good Times Co." );
-        childDn.normalize( schemaManager.getNormalizerMapping() );
+        childDn = new DN( "commonName=Jim Bean,ou=Apache,ou=Board of Directors,o=Good Times Co.", schemaManager );
 
-        parentDn = new DN( "ou=Engineering,o=Good Times Co." );
-        parentDn.normalize( schemaManager.getNormalizerMapping() );
+        parentDn = new DN( "ou=Engineering,o=Good Times Co.", schemaManager );
 
         assertEquals( 3, store.getSubAliasIndex().count() );
 
@@ -792,8 +774,7 @@ public class JdbmStoreTest
     @Test
     public void testModifyAdd() throws Exception
     {
-        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co.", schemaManager );
 
         List<Modification> mods = new ArrayList<Modification>();
         EntryAttribute attrib = new DefaultEntryAttribute( SchemaConstants.SURNAME_AT, SN_AT );
@@ -823,8 +804,7 @@ public class JdbmStoreTest
     @Test
     public void testModifyReplace() throws Exception
     {
-        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co.", schemaManager );
 
         List<Modification> mods = new ArrayList<Modification>();
         EntryAttribute attrib = new DefaultEntryAttribute( SchemaConstants.SN_AT, SN_AT );
@@ -855,8 +835,7 @@ public class JdbmStoreTest
     @Test
     public void testModifyRemove() throws Exception
     {
-        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=JOhnny WAlkeR,ou=Sales,o=Good Times Co.", schemaManager );
 
         List<Modification> mods = new ArrayList<Modification>();
         EntryAttribute attrib = new DefaultEntryAttribute( SchemaConstants.SN_AT, SN_AT );
@@ -887,8 +866,7 @@ public class JdbmStoreTest
     @Test
     public void testModifyReplaceNonExistingIndexAttribute() throws Exception
     {
-        DN dn = new DN( "cn=Tim B,ou=Sales,o=Good Times Co." );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( "cn=Tim B,ou=Sales,o=Good Times Co.", schemaManager );
         Entry entry = new DefaultEntry( schemaManager, dn );
         entry.add( "objectClass", "top", "person", "organizationalPerson" );
         entry.add( "cn", "Tim B" );
@@ -947,8 +925,7 @@ public class JdbmStoreTest
         store.addIndex( new JdbmIndex( SchemaConstants.UID_AT_OID ) );
 
         
-        DN suffixDn = new DN( "o=Good Times Co." );
-        suffixDn.normalize( schemaManager.getNormalizerMapping() );
+        DN suffixDn = new DN( "o=Good Times Co.", schemaManager );
         store.setSuffixDn( suffixDn );
         // init the store to call deleteUnusedIndexFiles() method
         store.init( schemaManager );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/ModifyDnHandler.java Wed Jul 21 12:29:02 2010
@@ -26,6 +26,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.message.internal.InternalLdapResult;
 import org.apache.directory.shared.ldap.message.internal.InternalModifyDnRequest;
 import org.apache.directory.shared.ldap.name.DN;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -73,13 +74,10 @@ public class ModifyDnHandler extends Lda
         
         try
         {
-            DN newRdn = new DN( req.getNewRdn().getName() );
-            newRdn.normalize( session.getCoreSession().getDirectoryService()
-                .getSchemaManager().getNormalizerMapping() );
+            SchemaManager schemaManager = session.getCoreSession().getDirectoryService().getSchemaManager();
+            DN newRdn = new DN( req.getNewRdn().getName(), schemaManager );
             
-            DN oldRdn = new DN( req.getName().getRdn().getName() );
-            oldRdn.normalize( session.getCoreSession().getDirectoryService()
-                .getSchemaManager().getNormalizerMapping() );
+            DN oldRdn = new DN( req.getName().getRdn().getName(), schemaManager );
             
             boolean rdnChanged = req.getNewRdn() != null && 
                 ! newRdn.getNormName().equals( oldRdn.getNormName() );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Wed Jul 21 12:29:02 2010
@@ -1343,8 +1343,7 @@ public class SearchHandler extends LdapR
         DirectoryService ds = session.getCoreSession().getDirectoryService();
         PartitionNexus nexus = ds.getPartitionNexus();
         Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        DN subschemaSubentryDn = new DN( subschemaSubentry.getString() );
-        subschemaSubentryDn.normalize( ds.getSchemaManager().getNormalizerMapping() );
+        DN subschemaSubentryDn = new DN( subschemaSubentry.getString(), ds.getSchemaManager() );
         String subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
         
         return subschemaSubentryDnNorm.equals( baseNormForm );
@@ -1393,9 +1392,7 @@ public class SearchHandler extends LdapR
             }
             
             // Normalize the DN to check for same dn
-            DN urlDn = new DN( ldapUrl.getDn().getName() );
-            urlDn.normalize( session.getCoreSession().getDirectoryService().getSchemaManager()
-                .getNormalizerMapping() ); 
+            DN urlDn = new DN( ldapUrl.getDn().getName(), session.getCoreSession().getDirectoryService().getSchemaManager() );
             
             if ( urlDn.getNormName().equals( req.getBase().getNormName() ) )
             {
@@ -1474,9 +1471,7 @@ public class SearchHandler extends LdapR
                 LOG.error( I18n.err( I18n.ERR_165, ref, referralAncestor ) );
             }
             
-            DN urlDn = new DN( ldapUrl.getDn().getName() );
-            urlDn.normalize( session.getCoreSession().getDirectoryService().getSchemaManager()
-                .getNormalizerMapping() ); 
+            DN urlDn = new DN( ldapUrl.getDn().getName(), session.getCoreSession().getDirectoryService().getSchemaManager() );
             
             if ( urlDn.getNormName().equals( referralAncestor.getDn().getNormName() ) )
             {

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java Wed Jul 21 12:29:02 2010
@@ -198,8 +198,7 @@ public class SyncReplConsumer implements
         cookieModLst = new ArrayList<Modification>( 1 );
         cookieModLst.add( cookieMod );
 
-        configEntryDn = new DN( config.getConfigEntryDn() );
-        configEntryDn.normalize( schemaManager.getNormalizerMapping() );
+        configEntryDn = new DN( config.getConfigEntryDn(), schemaManager );
 
         prepareSyncSearchRequest();
     }
@@ -954,8 +953,7 @@ public class SyncReplConsumer implements
             }
         }
 
-        DN dn = new DN( config.getBaseDn() );
-        dn.normalize( schemaManager.getNormalizerMapping() );
+        DN dn = new DN( config.getBaseDn(), schemaManager );
 
         LOG.debug( "selecting entries to be deleted using filter {}", filter.toString() );
         EntryFilteringCursor cursor = session.search( dn, SearchScope.SUBTREE, filter,

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java (original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java Wed Jul 21 12:29:02 2010
@@ -744,8 +744,7 @@ public class AddIT extends AbstractLdapT
             principalDn = "";
         }
         
-        DN userDn = new DN( principalDn );
-        userDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+        DN userDn = new DN( principalDn, service.getSchemaManager() );
         LdapPrincipal principal = new LdapPrincipal( userDn, AuthenticationLevel.SIMPLE );
         
         if ( dn == null )

Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java (original)
+++ directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java Wed Jul 21 12:29:02 2010
@@ -389,10 +389,7 @@ public class ApacheDS
         }
 
 
-        DN dn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
-        
-        // Must normalize the dn or - IllegalStateException!
-        dn.normalize( directoryService.getSchemaManager().getNormalizerMapping() );
+        DN dn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
         
         ensureLdifFileBase();
 

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java?rev=966207&r1=966206&r2=966207&view=diff
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java (original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java Wed Jul 21 12:29:02 2010
@@ -91,8 +91,7 @@ public class LaunchDiagnosticUiHandler i
         requestor.getIoSession().write( new LaunchDiagnosticUiResponse( req.getMessageId() ) );
 
         PartitionNexus nexus = service.getPartitionNexus();
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
-        adminDn.normalize( service.getSchemaManager().getNormalizerMapping() );
+        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, service.getSchemaManager() );
         LdapPrincipal principal = new LdapPrincipal( adminDn, AuthenticationLevel.STRONG );
         Set<String> suffixes = nexus.listSuffixes();
         int launchedWindowCount = 0;



Mime
View raw message