directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r980194 [1/2] - in /directory/apacheds/branches/apacheds-dnfactory-experiment/core/src: main/java/org/apache/directory/server/core/ main/java/org/apache/directory/server/core/authz/ main/java/org/apache/directory/server/core/collective/ mai...
Date Wed, 28 Jul 2010 20:09:18 GMT
Author: kayyagari
Date: Wed Jul 28 20:09:16 2010
New Revision: 980194

URL: http://svn.apache.org/viewvc?rev=980194&view=rev
Log:
o replaced all the calls to the DN constructor (except for the default one) with DNFactory.create()
o currently a failing test (PreferencesUtilsTest) left un @Ignored to demonstrate the problem of returning a mutable DN from the cache

Modified:
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
    directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Wed Jul 28 20:09:16 2010
@@ -1156,7 +1156,7 @@ public class DefaultDirectoryService imp
         // create system users area
         // -------------------------------------------------------------------
 
-        DN userDn = new DN( ServerDNConstants.USERS_SYSTEM_DN, schemaManager );
+        DN userDn = DNFactory.create( ServerDNConstants.USERS_SYSTEM_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, userDn ) ) )
         {
@@ -1181,7 +1181,7 @@ public class DefaultDirectoryService imp
         // create system groups area
         // -------------------------------------------------------------------
 
-        DN groupDn = new DN( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
+        DN groupDn = DNFactory.create( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, groupDn ) ) )
         {
@@ -1206,7 +1206,7 @@ public class DefaultDirectoryService imp
         // create administrator group
         // -------------------------------------------------------------------
 
-        DN name = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
+        DN name = DNFactory.create( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, name ) ) )
         {
@@ -1232,7 +1232,7 @@ public class DefaultDirectoryService imp
         // create system configuration area
         // -------------------------------------------------------------------
 
-        DN configurationDn = new DN( "ou=configuration,ou=system", schemaManager );
+        DN configurationDn = DNFactory.create( "ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, configurationDn ) ) )
         {
@@ -1254,7 +1254,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for partition information
         // -------------------------------------------------------------------
 
-        DN partitionsDn = new DN( "ou=partitions,ou=configuration,ou=system", schemaManager );
+        DN partitionsDn = DNFactory.create( "ou=partitions,ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, partitionsDn ) ) )
         {
@@ -1275,7 +1275,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for services
         // -------------------------------------------------------------------
 
-        DN servicesDn = new DN( "ou=services,ou=configuration,ou=system", schemaManager );
+        DN servicesDn = DNFactory.create( "ou=services,ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, servicesDn ) ) )
         {
@@ -1297,7 +1297,7 @@ public class DefaultDirectoryService imp
         // create system configuration area for interceptors
         // -------------------------------------------------------------------
 
-        DN interceptorsDn = new DN( "ou=interceptors,ou=configuration,ou=system", schemaManager );
+        DN interceptorsDn = DNFactory.create( "ou=interceptors,ou=configuration,ou=system", schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, interceptorsDn ) ) )
         {
@@ -1319,7 +1319,7 @@ public class DefaultDirectoryService imp
         // create system preferences area
         // -------------------------------------------------------------------
 
-        DN sysPrefRootDn = new DN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN, schemaManager );
+        DN sysPrefRootDn = DNFactory.create( ServerDNConstants.SYSPREFROOT_SYSTEM_DN, schemaManager );
         
         if ( !partitionNexus.hasEntry( new EntryOperationContext( adminSession, sysPrefRootDn ) ) )
         {
@@ -1353,7 +1353,7 @@ public class DefaultDirectoryService imp
         // Warn if the default password is not changed.
         boolean needToChangeAdminPassword = false;
 
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
         
         Entry adminEntry = partitionNexus.lookup( new LookupOperationContext( adminSession, adminDn ) );
         Value<?> userPassword = adminEntry.get( SchemaConstants.USER_PASSWORD_AT ).get();
@@ -1419,7 +1419,7 @@ public class DefaultDirectoryService imp
         partitions.add( schemaService.getSchemaPartition() );
         systemPartition.getSuffix().normalize( schemaManager.getNormalizerMapping() );
 
-        adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        adminDn = DNFactory.create( 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
@@ -1546,7 +1546,7 @@ public class DefaultDirectoryService imp
         try
         {
             Entry entry = readEntry( ldif );
-            DN newDn = new DN( dn );
+            DN newDn = DNFactory.create( dn );
             
             entry.setDn( newDn );
             

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/ReferralManagerImpl.java Wed Jul 28 20:09:16 2010
@@ -161,7 +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, directoryService.getSchemaManager() );
+            DN suffixDn = DNFactory.create( suffix, directoryService.getSchemaManager() );
             
             SearchOperationContext searchOperationContext = new SearchOperationContext( adminSession, suffixDn, referralFilter, searchControl );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java Wed Jul 28 20:09:16 2010
@@ -32,6 +32,7 @@ import javax.naming.directory.SearchCont
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -189,7 +190,7 @@ public class AciAuthorizationInterceptor
     {
         super.init( directoryService );
 
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
+        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
         schemaManager = directoryService.getSchemaManager();
@@ -212,7 +213,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(), schemaManager );
+        DN subschemaSubentryDnName = DNFactory.create( subschemaSubentry.getString(), schemaManager );
         subschemaSubentryDn = subschemaSubentryDnName.getNormName();
     }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationInterceptor.java Wed Jul 28 20:09:16 2010
@@ -27,6 +27,7 @@ import javax.naming.NoPermissionExceptio
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -107,11 +108,11 @@ public class DefaultAuthorizationInterce
         nexus = directoryService.getPartitionNexus();
         SchemaManager schemaManager = directoryService.getSchemaManager();
 
-        ADMIN_SYSTEM_DN = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        ADMIN_SYSTEM_DN = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
 
-        GROUP_BASE_DN = new DN( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
+        GROUP_BASE_DN = DNFactory.create( ServerDNConstants.GROUPS_SYSTEM_DN, schemaManager );
 
-        ADMIN_GROUP_DN = new DN( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
+        ADMIN_GROUP_DN = DNFactory.create( ServerDNConstants.ADMINISTRATORS_GROUP_DN, schemaManager );
 
         uniqueMemberAT = schemaManager.getAttributeType( SchemaConstants.UNIQUE_MEMBER_AT_OID );
 
@@ -123,7 +124,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, directoryService.getSchemaManager() );
+        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
 
@@ -138,7 +139,7 @@ public class DefaultAuthorizationInterce
 
         for ( Value<?> value : uniqueMember )
         {
-            DN memberDn = new DN( value.getString(), directoryService.getSchemaManager() );
+            DN memberDn = DNFactory.create( value.getString(), directoryService.getSchemaManager() );
             newAdministrators.add( memberDn.getNormName() );
         }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java Wed Jul 28 20:09:16 2010
@@ -30,6 +30,7 @@ import javax.naming.directory.SearchCont
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -117,7 +118,7 @@ public class GroupCache
 
     private DN parseNormalized( String name ) throws LdapException
     {
-        DN dn = new DN( name, schemaManager );
+        DN dn = DNFactory.create( name, schemaManager );
         return dn;
     }
 
@@ -140,7 +141,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, schemaManager );
+            DN baseDn = DNFactory.create( suffix, schemaManager );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java Wed Jul 28 20:09:16 2010
@@ -31,6 +31,7 @@ import java.util.Set;
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.partition.PartitionNexus;
@@ -108,7 +109,7 @@ public class TupleCache
 
     private DN parseNormalized( SchemaManager schemaManager, String name ) throws LdapException
     {
-        DN dn = new DN( name, schemaManager );
+        DN dn = DNFactory.create( name, schemaManager );
         return dn;
     }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Wed Jul 28 20:09:16 2010
@@ -24,6 +24,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
@@ -416,7 +417,7 @@ public class CollectiveAttributeIntercep
         for ( Value<?> value : collectiveAttributeSubentries )
         {
             String subentryDnStr = value.getString();
-            DN subentryDn = new DN( subentryDnStr );
+            DN subentryDn = DNFactory.create( subentryDnStr );
 
             /*
              * TODO - Instead of hitting disk here can't we leverage the 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java Wed Jul 28 20:09:16 2010
@@ -23,6 +23,7 @@ package org.apache.directory.server.core
 import java.util.List;
 
 import org.apache.commons.collections.map.LRUMap;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
@@ -119,7 +120,7 @@ public class ExceptionInterceptor extend
     {
         nexus = directoryService.getPartitionNexus();
         Value<?> attr = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemSubentryDn = new DN( attr.getString(), directoryService.getSchemaManager() );
+        subschemSubentryDn = DNFactory.create( attr.getString(), directoryService.getSchemaManager() );
         schemaManager = directoryService.getSchemaManager();
 
         // look up some constant information
@@ -197,7 +198,7 @@ public class ExceptionInterceptor extend
             {
                 String msg = I18n.err( I18n.ERR_252, name.getName() );
                 LdapAliasException e = new LdapAliasException( msg );
-                //e.setResolvedName( new DN( parentDn.getName() ) );
+                //e.setResolvedName( DNFactory.create( parentDn.getName() ) );
                 throw e;
             }
             else
@@ -369,7 +370,7 @@ public class ExceptionInterceptor extend
         {
             LdapEntryAlreadyExistsException e;
             e = new LdapEntryAlreadyExistsException( I18n.err( I18n.ERR_250_ENTRY_ALREADY_EXISTS, newDn.getName() ) );
-            //e.setResolvedName( new DN( newDn.getName() ) );
+            //e.setResolvedName( DNFactory.create( newDn.getName() ) );
             throw e;
         }
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Wed Jul 28 20:09:16 2010
@@ -28,6 +28,7 @@ import java.util.UUID;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilter;
@@ -137,10 +138,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(), schemaManager );
+        subschemaSubentryDn = DNFactory.create( subschemaSubentry.getString(), schemaManager );
 
         // Create the Admin DN 
-        adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
+        adminDn = DNFactory.create( 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 );
@@ -483,7 +484,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN creatorsName = new DN( attr.getString() );
+                DN creatorsName = DNFactory.create( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( creatorsName ).getName() );
@@ -493,7 +494,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN modifiersName = new DN( attr.getString() );
+                DN modifiersName = DNFactory.create( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getName() );
@@ -503,7 +504,7 @@ public class OperationalAttributeInterce
 
             if ( attr != null )
             {
-                DN modifiersName = new DN( attr.getString() );
+                DN modifiersName = DNFactory.create( attr.getString() );
 
                 attr.clear();
                 attr.add( denormalizeTypes( modifiersName ).getName() );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Wed Jul 28 20:09:16 2010
@@ -37,6 +37,7 @@ import javax.naming.directory.SearchCont
 
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -222,7 +223,7 @@ public class DefaultPartitionNexus exten
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
 
         // Initialize and normalize the localy used DNs
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN );
+        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN );
         adminDn.normalize( schemaManager.getNormalizerMapping() );
 
         initializeSystemPartition( directoryService );
@@ -297,7 +298,7 @@ public class DefaultPartitionNexus exten
         system.initialize();
 
         // Add root context entry for system partition
-        DN systemSuffixDn = new DN( ServerDNConstants.SYSTEM_DN, schemaManager );
+        DN systemSuffixDn = DNFactory.create( ServerDNConstants.SYSTEM_DN, schemaManager );
         Entry systemEntry = new DefaultEntry( schemaManager, systemSuffixDn );
 
         // Add the ObjectClasses
@@ -311,7 +312,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, schemaManager );
+        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
         CoreSession adminSession = new DefaultCoreSession( new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ),
             directoryService );
         AddOperationContext addOperationContext = new AddOperationContext( adminSession, systemEntry );
@@ -366,9 +367,9 @@ public class DefaultPartitionNexus exten
         {
             try
             {
-                DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
+                DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
 
-                removeContextPartition(  new DN( suffix ) );
+                removeContextPartition(  DNFactory.create( suffix ) );
             }
             catch ( Exception e )
             {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java Wed Jul 28 20:09:16 2010
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
  
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
 
@@ -42,7 +43,7 @@ class PreferencesUtils
      */
     public static DN toSysDn( String absPrefPath ) throws LdapInvalidDnException
     {
-        DN dn = new DN( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
+        DN dn = DNFactory.create( ServerDNConstants.SYSPREFROOT_SYSTEM_DN );
 
         String[] comps = absPrefPath.split( "/" );
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/prefs/ServerSystemPreferences.java Wed Jul 28 20:09:16 2010
@@ -29,6 +29,7 @@ import java.util.prefs.BackingStoreExcep
 import java.util.prefs.Preferences;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
@@ -85,7 +86,7 @@ public class ServerSystemPreferences ext
         
         try
         {
-            dn = new DN( "prefNodeName=sysPrefRoot,ou=system" );
+            dn = DNFactory.create( "prefNodeName=sysPrefRoot,ou=system" );
         }
         catch ( LdapInvalidDnException e )
         {
@@ -115,7 +116,7 @@ public class ServerSystemPreferences ext
         DN parentDn = ( ( ServerSystemPreferences ) parent() ).dn;
         try
         {
-            dn = new DN( "prefNodeName=" + name + "," + parentDn.getName(), directoryService.getSchemaManager() );
+            dn = DNFactory.create( "prefNodeName=" + name + "," + parentDn.getName(), directoryService.getSchemaManager() );
             
             if ( ! directoryService.getAdminSession().exists( dn ) )
             {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/referral/ReferralInterceptor.java Wed Jul 28 20:09:16 2010
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import javax.naming.Context;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.ReferralManager;
 import org.apache.directory.server.core.ReferralManagerImpl;
@@ -211,7 +212,7 @@ public class ReferralInterceptor extends
         directoryService.setReferralManager( referralManager );
 
         Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemaSubentryDn = new DN( subschemaSubentry.getString(), schemaManager );
+        subschemaSubentryDn = DNFactory.create( subschemaSubentry.getString(), schemaManager );
 
         // look up some constant information
         OBJECT_CLASS_AT = schemaManager.getAttributeType( SchemaConstants.OBJECT_CLASS_AT );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/DefaultSchemaService.java Wed Jul 28 20:09:16 2010
@@ -24,6 +24,7 @@ import java.util.Set;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.DefaultEntry;
@@ -89,7 +90,7 @@ public class DefaultSchemaService implem
             return true;
         }
 
-        DN dn = new DN( dnString, schemaPartition.getSchemaManager() );
+        DN dn = DNFactory.create( dnString, schemaPartition.getSchemaManager() );
         return dn.getNormName().equals( ServerDNConstants.CN_SCHEMA_DN_NORMALIZED );
     }
 
@@ -375,7 +376,7 @@ public class DefaultSchemaService implem
     {
         try
         {
-            schemaModificationAttributesDN = new DN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN, getSchemaManager() );
+            schemaModificationAttributesDN = DNFactory.create( ServerDNConstants.SCHEMA_MODIFICATIONS_DN, getSchemaManager() );
         }
         catch ( LdapException e )
         {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java Wed Jul 28 20:09:16 2010
@@ -35,6 +35,7 @@ import java.util.concurrent.ConcurrentHa
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
@@ -194,16 +195,16 @@ public class SchemaInterceptor extends B
         filters.add( binaryAttributeFilter );
         filters.add( topFilter );
 
-        schemaBaseDN = new DN( SchemaConstants.OU_SCHEMA, schemaManager );
+        schemaBaseDN = DNFactory.create( SchemaConstants.OU_SCHEMA, schemaManager );
         schemaService = directoryService.getSchemaService();
 
         // stuff for dealing with subentries (garbage for now)
         Value<?> subschemaSubentry = nexus.getRootDSE( null ).get( SchemaConstants.SUBSCHEMA_SUBENTRY_AT ).get();
-        subschemaSubentryDn = new DN( subschemaSubentry.getString() );
+        subschemaSubentryDn = DNFactory.create( subschemaSubentry.getString() );
         subschemaSubentryDn.normalize( schemaManager.getNormalizerMapping() );
         subschemaSubentryDnNorm = subschemaSubentryDn.getNormName();
 
-        schemaModificationAttributesDN = new DN( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
+        schemaModificationAttributesDN = DNFactory.create( ServerDNConstants.SCHEMA_MODIFICATIONS_DN );
         schemaModificationAttributesDN.normalize( schemaManager.getNormalizerMapping() );
 
         computeSuperiors();

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Wed Jul 28 20:09:16 2010
@@ -25,6 +25,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
 import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
@@ -133,14 +134,14 @@ public class SchemaSubentryModifier
         }
 
         buf.append( ",cn=" ).append( obj.getSchemaName() ).append( ",ou=schema" );
-        return new DN( buf.toString() );
+        return DNFactory.create( buf.toString() );
     }
     
 
     public void add( OperationContext opContext, LdapComparatorDescription comparatorDescription ) throws LdapException
     {
         String schemaName = getSchema( comparatorDescription );   
-        DN dn = new DN( 
+        DN dn = DNFactory.create( 
             "m-oid=" + comparatorDescription.getOid(),
             SchemaConstants.COMPARATORS_PATH,
             "cn=" + schemaName,
@@ -155,7 +156,7 @@ public class SchemaSubentryModifier
     public void add( OperationContext opContext, NormalizerDescription normalizerDescription ) throws LdapException
     {
         String schemaName = getSchema( normalizerDescription );
-        DN dn = new DN( 
+        DN dn = DNFactory.create( 
             "m-oid=" + normalizerDescription.getOid(),
             SchemaConstants.NORMALIZERS_PATH , 
             "cn=" + schemaName,
@@ -170,7 +171,7 @@ public class SchemaSubentryModifier
     public void add( OperationContext opContext, SyntaxCheckerDescription syntaxCheckerDescription ) throws LdapException
     {
         String schemaName = getSchema( syntaxCheckerDescription );
-        DN dn = new DN( 
+        DN dn = DNFactory.create( 
             "m-oid=" + syntaxCheckerDescription.getOid(),
             SchemaConstants.SYNTAX_CHECKERS_PATH,
             "cn=" + schemaName, 
@@ -202,7 +203,7 @@ public class SchemaSubentryModifier
     public void delete( OperationContext opContext, NormalizerDescription normalizerDescription ) throws LdapException
     {
         String schemaName = getSchema( normalizerDescription );
-        DN dn = new DN( 
+        DN dn = DNFactory.create( 
             "m-oid=" + normalizerDescription.getOid(),
             SchemaConstants.NORMALIZERS_PATH,
             "cn=" + schemaName, 
@@ -215,7 +216,7 @@ public class SchemaSubentryModifier
     public void delete( OperationContext opContext, SyntaxCheckerDescription syntaxCheckerDescription ) throws LdapException
     {
         String schemaName = getSchema( syntaxCheckerDescription );
-        DN dn = new DN( 
+        DN dn = DNFactory.create( 
             "m-oid=" + syntaxCheckerDescription.getOid(), 
             SchemaConstants.SYNTAX_CHECKERS_PATH,
             "cn=" + schemaName,
@@ -227,7 +228,7 @@ public class SchemaSubentryModifier
     public void delete( OperationContext opContext, LdapComparatorDescription comparatorDescription ) throws LdapException
     {
         String schemaName = getSchema( comparatorDescription );
-        DN dn = new DN( 
+        DN dn = DNFactory.create( 
             "m-oid=" + comparatorDescription.getOid(),
             SchemaConstants.COMPARATORS_PATH,
             "cn=" + schemaName,

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/security/CoreKeyStoreSpi.java Wed Jul 28 20:09:16 2010
@@ -39,6 +39,7 @@ import org.apache.commons.lang.ArrayUtil
 import org.apache.commons.lang.NotImplementedException;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.i18n.I18n;
@@ -78,7 +79,7 @@ public class CoreKeyStoreSpi extends Key
 
     private Entry getTlsEntry() throws Exception
     {
-        DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN, directoryService.getSchemaManager() );
+        DN adminDn = DNFactory.create( 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/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/LdapClassLoader.java Wed Jul 28 20:09:16 2010
@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.i18n.I18n;
@@ -74,7 +75,7 @@ public class LdapClassLoader extends Cla
     {
         super( LdapClassLoader.class.getClassLoader() );
         this.directoryService = directoryService;
-        defaultSearchDn = new DN( DEFAULT_SEARCH_CONTEXTS_CONFIG, directoryService.getSchemaManager() );
+        defaultSearchDn = DNFactory.create( DEFAULT_SEARCH_CONTEXTS_CONFIG, directoryService.getSchemaManager() );
         
         OBJECT_CLASS_AT = directoryService.getSchemaManager().getAttributeType( SchemaConstants.OBJECT_CLASS_AT );
     }
@@ -162,7 +163,7 @@ public class LdapClassLoader extends Cla
                 
                 for ( Value<?> val : attr )
                 {
-                    DN dn = new DN( val.getString(), directoryService.getSchemaManager() );
+                    DN dn = DNFactory.create( val.getString(), directoryService.getSchemaManager() );
                     searchContexts.add( dn );
                 }
                 
@@ -186,7 +187,7 @@ public class LdapClassLoader extends Cla
 
                 for ( String suffix:suffixes )
                 {
-                    DN dn = new DN( suffix, directoryService.getSchemaManager() );
+                    DN dn = DNFactory.create( suffix, directoryService.getSchemaManager() );
                     namingContexts.add( dn );
                 }
                 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java Wed Jul 28 20:09:16 2010
@@ -27,6 +27,7 @@ import java.util.Set;
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.i18n.I18n;
@@ -89,7 +90,7 @@ public class StoredProcExecutionManager
         AttributeType storeProcUnitNamAT = session.getDirectoryService()
             .getSchemaManager().lookupAttributeTypeRegistry( "storedProcUnitName" );
         ExprNode filter = new EqualityNode<String>( storeProcUnitNamAT, new StringValue( storeProcUnitNamAT, spUnitName ) );
-        DN dn = new DN( storedProcContainer );
+        DN dn = DNFactory.create( storedProcContainer );
         EntryFilteringCursor results = session.search( dn, SearchScope.SUBTREE, filter, 
             AliasDerefMode.DEREF_ALWAYS, EMPTY_ATTRIBS );
         if ( results.first() )

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/subtree/SubentryInterceptor.java Wed Jul 28 20:09:16 2010
@@ -30,6 +30,7 @@ import javax.naming.directory.SearchCont
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -233,12 +234,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, schemaManager );
+        DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN, schemaManager );
 
         // search each namingContext for subentries
         for ( String suffix : suffixes )
         {
-            DN suffixDn = new DN( suffix, schemaManager );
+            DN suffixDn = DNFactory.create( suffix, schemaManager );
 
             CoreSession adminSession = new DefaultCoreSession(
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AbstractStoredProcedureParameterInjector.java Wed Jul 28 20:09:16 2010
@@ -27,6 +27,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.shared.ldap.exception.LdapException;
@@ -54,7 +55,7 @@ public abstract class AbstractStoredProc
     protected DN getOperationPrincipal() throws LdapInvalidDnException
     {
         Principal principal = opContext.getSession().getEffectivePrincipal();
-        DN userName = new DN( principal.getName() );
+        DN userName = DNFactory.create( principal.getName() );
         return userName;
     }
     

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/AddStoredProcedureParameterInjector.java Wed Jul 28 20:09:16 2010
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import java.util.Map;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
@@ -53,7 +54,7 @@ public class AddStoredProcedureParameter
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( addedEntryName.getName() );
+            return DNFactory.create( addedEntryName.getName() );
         }
     };
     

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/DeleteStoredProcedureParameterInjector.java Wed Jul 28 20:09:16 2010
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import java.util.Map;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
@@ -52,7 +53,7 @@ public class DeleteStoredProcedureParame
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( deletedEntryName.getName() );
+            return DNFactory.create( deletedEntryName.getName() );
         }
     };
     

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyDNStoredProcedureParameterInjector.java Wed Jul 28 20:09:16 2010
@@ -22,6 +22,7 @@ package org.apache.directory.server.core
 
 import java.util.Map;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.name.DN;
@@ -70,7 +71,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( oldDN.getName() );
+            return DNFactory.create( oldDN.getName() );
         }
     };
 
@@ -82,7 +83,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( newRDN.getName() );
+            return DNFactory.create( newRDN.getName() );
         }
     };
 
@@ -106,7 +107,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( newSuperiorDN.getName() );
+            return DNFactory.create( newSuperiorDN.getName() );
         }
     };
     
@@ -118,7 +119,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( oldRDN.getName() );
+            return DNFactory.create( oldRDN.getName() );
         }
     };
     
@@ -130,7 +131,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( oldSuperiorDN.getName() );
+            return DNFactory.create( oldSuperiorDN.getName() );
         }
     };
     
@@ -142,7 +143,7 @@ public class ModifyDNStoredProcedurePara
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( newDN.getName() );
+            return DNFactory.create( newDN.getName() );
         }
     };
     

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/ModifyStoredProcedureParameterInjector.java Wed Jul 28 20:09:16 2010
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
@@ -61,7 +62,7 @@ public class ModifyStoredProcedureParame
         public Object inject( OperationContext opContext, StoredProcedureParameter param ) throws LdapInvalidDnException
         {
             // Return a safe copy constructed with user provided name.
-            return new DN( modifiedEntryName.getName() );
+            return DNFactory.create( modifiedEntryName.getName() );
         }
     };
     

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/SimpleTriggerExecutionAuthorizer.java Wed Jul 28 20:09:16 2010
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.interceptor.context.OperationContext;
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.exception.LdapInvalidDnException;
@@ -35,7 +36,7 @@ public class SimpleTriggerExecutionAutho
     {
         try
         {
-            adminName = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
+            adminName = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
         }
         catch ( LdapInvalidDnException e )
         {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/trigger/TriggerSpecCache.java Wed Jul 28 20:09:16 2010
@@ -33,6 +33,7 @@ import javax.naming.directory.SearchCont
 import org.apache.directory.server.constants.ApacheSchemaConstants;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -123,13 +124,13 @@ public class TriggerSpecCache
         
         for ( String suffix:suffixes )
         {
-            DN baseDn = new DN( suffix );
+            DN baseDn = DNFactory.create( suffix );
             ExprNode filter = new EqualityNode<String>( objectClassAt, 
                     new StringValue( ApacheSchemaConstants.TRIGGER_EXECUTION_SUBENTRY_OC ) );
             SearchControls ctls = new SearchControls();
             ctls.setSearchScope( SearchControls.SUBTREE_SCOPE );
             
-            DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
+            DN adminDn = DNFactory.create( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, directoryService.getSchemaManager() );
             CoreSession adminSession = new DefaultCoreSession( 
                 new LdapPrincipal( adminDn, AuthenticationLevel.STRONG ), directoryService );
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java Wed Jul 28 20:09:16 2010
@@ -31,6 +31,7 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.MockOperation;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -92,7 +93,7 @@ public class MaxImmSubFilterTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        ENTRY_NAME = new DN( "ou=test, ou=system" );
+        ENTRY_NAME = DNFactory.create( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new MaxImmSubItem( 2 ) );
         ENTRY = new DefaultEntry( schemaManager, ENTRY_NAME );
     }

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/MaxValueCountFilterTest.java Wed Jul 28 20:09:16 2010
@@ -31,6 +31,7 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -90,7 +91,7 @@ public class MaxValueCountFilterTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        DN entryName = new DN( "ou=test, ou=system" );
+        DN entryName = DNFactory.create( "ou=test, ou=system" );
         ENTRY = new DefaultEntry( schemaManager, entryName );
         FULL_ENTRY = new DefaultEntry( schemaManager, entryName );
         

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilterTest.java Wed Jul 28 20:09:16 2010
@@ -31,6 +31,7 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.event.ExpressionEvaluator;
 import org.apache.directory.server.core.subtree.RefinementEvaluator;
 import org.apache.directory.server.core.subtree.RefinementLeafEvaluator;
@@ -111,8 +112,8 @@ public class RelatedProtectedItemFilterT
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        GROUP_NAME = new DN( "ou=test,ou=groups,ou=system" );
-        USER_NAME = new DN( "ou=test, ou=users, ou=system" );
+        GROUP_NAME = DNFactory.create( "ou=test,ou=groups,ou=system" );
+        USER_NAME = DNFactory.create( "ou=test, ou=users, ou=system" );
         
         filterA = new RelatedProtectedItemFilter( new RefinementEvaluator( new RefinementLeafEvaluator(
             schemaManager ) ), new ExpressionEvaluator( schemaManager ), schemaManager );
@@ -392,11 +393,11 @@ public class RelatedProtectedItemFilterT
         Collection<ACITuple> tuples = getTuples( new ProtectedItem.RangeOfValues( new PresenceNode( "cn" ) ) );
 
         Assert.assertEquals( 1, filterA.filter( tuples, OperationScope.ENTRY, null, null, USER_NAME, null, null,
-            new DN( "ou=testEntry" ), null, null, entry, null ).size() );
+            DNFactory.create( "ou=testEntry" ), null, null, entry, null ).size() );
 
         entry.remove( "cn" );
         Assert.assertEquals( 0, filterA.filter( service.getRegistries(), tuples, OperationScope.ATTRIBUTE_TYPE_AND_VALUE, null, null, USER_NAME,
-            null, null, new DN( "ou=testEntry" ), null, null, entry, null ).size() );
+            null, null, DNFactory.create( "ou=testEntry" ), null, null, entry, null ).size() );
     }
     */
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilterTest.java Wed Jul 28 20:09:16 2010
@@ -30,6 +30,7 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.subtree.SubtreeEvaluator;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
@@ -75,8 +76,8 @@ public class RelatedUserClassFilterTest
         
         try
         {
-            GROUP_NAME = new DN( "ou=test,ou=groups,ou=system" );
-            USER_NAME = new DN( "ou=test, ou=users, ou=system" );
+            GROUP_NAME = DNFactory.create( "ou=test,ou=groups,ou=system" );
+            USER_NAME = DNFactory.create( "ou=test, ou=users, ou=system" );
         }
         catch ( LdapInvalidDnException e )
         {
@@ -127,7 +128,7 @@ public class RelatedUserClassFilterTest
         aciContext.setAciTuples( tuples );
         aciContext.setUserDn( USER_NAME );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
-        aciContext.setEntryDn( new DN( "ou=unrelated" ) );
+        aciContext.setEntryDn( DNFactory.create( "ou=unrelated" ) );
 
         assertEquals( 0, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
     }
@@ -142,7 +143,7 @@ public class RelatedUserClassFilterTest
         aciContext.setAciTuples( tuples );
         aciContext.setUserDn( USER_NAME );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
-        aciContext.setEntryDn( new DN( "ou=phoneBook, ou=test, ou=users, ou=system" ) );
+        aciContext.setEntryDn( DNFactory.create( "ou=phoneBook, ou=test, ou=users, ou=system" ) );
 
         assertEquals( 1, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
 
@@ -150,7 +151,7 @@ public class RelatedUserClassFilterTest
         aciContext.setAciTuples( tuples );
         aciContext.setUserDn( USER_NAME );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
-        aciContext.setEntryDn( new DN( "ou=unrelated" ) );
+        aciContext.setEntryDn( DNFactory.create( "ou=unrelated" ) );
 
         assertEquals( 0, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
     }
@@ -170,7 +171,7 @@ public class RelatedUserClassFilterTest
 
         aciContext = new AciContext( null, null );
         aciContext.setAciTuples( tuples );
-        aciContext.setUserDn( new DN( "ou=unrelateduser, ou=users" ) );
+        aciContext.setUserDn( DNFactory.create( "ou=unrelateduser, ou=users" ) );
         aciContext.setAuthenticationLevel( AuthenticationLevel.NONE );
         aciContext.setEntryDn( USER_NAME );
 
@@ -192,7 +193,7 @@ public class RelatedUserClassFilterTest
         assertEquals( 1, filter.filter( aciContext, OperationScope.ENTRY, null ).size() );
 
         Set<DN> wrongGroupNames = new HashSet<DN>();
-        wrongGroupNames.add( new DN( "ou=unrelatedgroup" ) );
+        wrongGroupNames.add( DNFactory.create( "ou=unrelatedgroup" ) );
 
         aciContext = new AciContext( null, null );
         aciContext.setAciTuples( tuples );
@@ -286,7 +287,7 @@ public class RelatedUserClassFilterTest
             
             try
             {
-                names.add( new DN( "dummy=dummy" ) );
+                names.add( DNFactory.create( "dummy=dummy" ) );
             }
             catch ( LdapInvalidDnException e )
             {

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/authz/support/RestrictedByFilterTest.java Wed Jul 28 20:09:16 2010
@@ -31,6 +31,7 @@ import java.util.Set;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.shared.ldap.aci.ACITuple;
 import org.apache.directory.shared.ldap.aci.MicroOperation;
 import org.apache.directory.shared.ldap.aci.ProtectedItem;
@@ -94,7 +95,7 @@ public class RestrictedByFilterTest
             fail( "Schema load failed : " + LdapExceptionUtils.printErrors( schemaManager.getErrors() ) );
         }
 
-        DN entryName = new DN( "ou=test, ou=system" );
+        DN entryName = DNFactory.create( "ou=test, ou=system" );
         PROTECTED_ITEMS.add( new MaxImmSubItem( 2 ) );
         ENTRY = new DefaultEntry( schemaManager, entryName );
 

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/changelog/MemoryChangeLogStoreTest.java Wed Jul 28 20:09:16 2010
@@ -34,6 +34,7 @@ import java.util.Map;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
@@ -107,7 +108,7 @@ public class MemoryChangeLogStoreTest
         forward.putAttribute( "objectClass", "organizationalUnit" );
         forward.putAttribute( "ou", "system" );
 
-        LdifEntry reverse = LdifRevertor.reverseAdd( new DN( forward.getDn() ) );
+        LdifEntry reverse = LdifRevertor.reverseAdd( DNFactory.create( forward.getDn() ) );
         assertEquals( 1, store.log( new LdapPrincipal(), forward, reverse ).getRevision() );
         assertEquals( 1, store.getCurrentRevision() );
     }
@@ -116,10 +117,10 @@ public class MemoryChangeLogStoreTest
     @Test
     public void testChangeLogSerialization() throws LdapException, IOException, ClassNotFoundException
     {
-        DN systemDn = new DN( "ou=system" );
+        DN systemDn = DNFactory.create( "ou=system" );
         systemDn.normalize( oidsMap );
         
-        DN adminDn = new DN( "uid=admin, ou=system" );
+        DN adminDn = DNFactory.create( "uid=admin, ou=system" );
         adminDn.normalize( oidsMap );
 
         LdifEntry forward = new LdifEntry();
@@ -128,7 +129,7 @@ public class MemoryChangeLogStoreTest
         forward.putAttribute( "objectClass", "organizationalUnit" );
         forward.putAttribute( "ou", "system" );
         
-        DN reverseDn = new DN( forward.getDn() );
+        DN reverseDn = DNFactory.create( forward.getDn() );
         reverseDn.normalize( oidsMap );
 
         LdifEntry reverse = LdifRevertor.reverseAdd( reverseDn );

Modified: directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=980194&r1=980193&r2=980194&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java (original)
+++ directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java Wed Jul 28 20:09:16 2010
@@ -28,6 +28,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.directory.server.core.DNFactory;
 import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.LdapPrincipal;
@@ -86,7 +87,7 @@ public class InterceptorChainTest
     @Test
     public void testNoBypass() throws Exception
     {
-        DN dn = new DN( "ou=system" );
+        DN dn = DNFactory.create( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
             ds );
@@ -112,7 +113,7 @@ public class InterceptorChainTest
     @Test
     public void testSingleBypass() throws Exception
     {
-        DN dn = new DN( "ou=system" );
+        DN dn = DNFactory.create( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
             ds );
@@ -139,7 +140,7 @@ public class InterceptorChainTest
     @Test
     public void testAdjacentDoubleBypass() throws Exception
     {
-        DN dn = new DN( "ou=system" );
+        DN dn = DNFactory.create( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
             ds );
@@ -169,7 +170,7 @@ public class InterceptorChainTest
     @Test
     public void testFrontAndBackDoubleBypass() throws Exception
     {
-        DN dn = new DN( "ou=system" );
+        DN dn = DNFactory.create( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
             ds );
@@ -198,7 +199,7 @@ public class InterceptorChainTest
     @Test
     public void testDoubleBypass() throws Exception
     {
-        DN dn = new DN( "ou=system" );
+        DN dn = DNFactory.create( "ou=system" );
         DirectoryService ds = new MockDirectoryService();
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
             ds );
@@ -227,7 +228,7 @@ public class InterceptorChainTest
     @Test
     public void testCompleteBypass() throws Exception
     {
-        DN dn = new DN( "ou=system" );
+        DN dn = DNFactory.create( "ou=system" );
         DirectoryService ds = new MockDirectoryService( 0 );
         DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( new DN(), AuthenticationLevel.STRONG ),
             ds );



Mime
View raw message