directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r980948 [2/3] - in /directory/apacheds/trunk: all/ core-annotations/ core-api/ core-api/src/main/java/org/apache/directory/server/core/ core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ core-api/src/main/java/org/...
Date Fri, 30 Jul 2010 20:45:00 GMT
Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaObjectClassHandlerIT.java Fri Jul 30 20:44:57 2010
@@ -89,7 +89,7 @@ public class MetaObjectClassHandlerIT ex
             "m-may: ou" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         return dn;
@@ -136,7 +136,7 @@ public class MetaObjectClassHandlerIT ex
             "m-may: ou" );
 
         DN dn = getObjectClassContainer( "notloaded" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -158,7 +158,7 @@ public class MetaObjectClassHandlerIT ex
     public void testDeleteObjectClassFromEnabledSchema() throws Exception
     {
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         addObjectClass();
 
         assertTrue( "objectClass should be removed from the registry after being deleted", 
@@ -187,7 +187,7 @@ public class MetaObjectClassHandlerIT ex
     public void testDeleteObjectClassFromDisabledSchema() throws Exception
     {
         DN dn = getObjectClassContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         addObjectClassToDisabledSchema();
         
         assertFalse( "objectClass should be removed from the registry after being deleted", 
@@ -217,11 +217,11 @@ public class MetaObjectClassHandlerIT ex
     public void testRenameObjectClassType() throws Exception
     {
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         addObjectClass();
         
         DN newdn = getObjectClassContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
         assertFalse( "old objectClass OID should be removed from the registry after being renamed", 
@@ -248,10 +248,10 @@ public class MetaObjectClassHandlerIT ex
         addObjectClass();
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getObjectClassContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -270,10 +270,10 @@ public class MetaObjectClassHandlerIT ex
         addObjectClass();
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getObjectClassContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -299,7 +299,7 @@ public class MetaObjectClassHandlerIT ex
         assertEquals( oc.getName(), NAME );
 
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         ModificationItem[] mods = new ModificationItem[2];
         Attribute attr = new BasicAttribute( "m-description", DESCRIPTION1 );
@@ -331,7 +331,7 @@ public class MetaObjectClassHandlerIT ex
         assertEquals( oc.getName(), NAME );
 
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         Attributes mods = new BasicAttributes( true );
         mods.put( "m-description", DESCRIPTION1 );
@@ -369,7 +369,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( "m-supObjectClass", OID );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + DEPENDEE_OID );
+        dn = dn.add( "m-oid" + "=" + DEPENDEE_OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( getObjectClassRegistry().contains( DEPENDEE_OID ) );
@@ -381,7 +381,7 @@ public class MetaObjectClassHandlerIT ex
     public void testDeleteObjectClassWhenInUse() throws Exception
     {
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         addObjectClass();
         addDependeeObjectClass();
         
@@ -407,10 +407,10 @@ public class MetaObjectClassHandlerIT ex
         addDependeeObjectClass();
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getObjectClassContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -434,10 +434,10 @@ public class MetaObjectClassHandlerIT ex
         addDependeeObjectClass();
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getObjectClassContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         try
         {
@@ -458,12 +458,12 @@ public class MetaObjectClassHandlerIT ex
     public void testRenameObjectClassWhenInUse() throws Exception
     {
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         addObjectClass();
         addDependeeObjectClass();
         
         DN newdn = getObjectClassContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         try
         {
@@ -489,7 +489,7 @@ public class MetaObjectClassHandlerIT ex
         addObjectClass();
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN top = new DN();
         top.add( "m-oid" + "=" + OID );
@@ -515,10 +515,10 @@ public class MetaObjectClassHandlerIT ex
         addObjectClass();
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = new DN( "ou=comparators,cn=apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -548,7 +548,7 @@ public class MetaObjectClassHandlerIT ex
             "m-may: ou" );
 
         DN dn = getObjectClassContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         return dn;
@@ -562,11 +562,11 @@ public class MetaObjectClassHandlerIT ex
         addObjectClass();
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         // nis is inactive by default
         DN newdn = getObjectClassContainer( "nis" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -583,13 +583,13 @@ public class MetaObjectClassHandlerIT ex
         
         // nis is inactive by default
         DN dn = getObjectClassContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         assertFalse( "objectClass OID should NOT be present when added to disabled nis schema", 
             getObjectClassRegistry().contains( OID ) );
 
         DN newdn = getObjectClassContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -624,7 +624,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( "m-may", "ou" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( getObjectClassRegistry().contains( OID ) );
@@ -657,7 +657,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( sup );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -696,7 +696,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( sup );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -731,7 +731,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( "m-may", "ou" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + NEW_OID );
+        dn = dn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( getObjectClassRegistry().contains( NEW_OID ) );
@@ -764,7 +764,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( sup );
 
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + NEW_OID );
+        dn = dn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( getObjectClassRegistry().contains( NEW_OID ) );
@@ -797,7 +797,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( sup );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -832,7 +832,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( "m-may", "ou" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + NEW_OID );
+        dn = dn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( getObjectClassRegistry().contains( NEW_OID ) );
@@ -865,7 +865,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( sup );
 
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + NEW_OID );
+        dn = dn.add( "m-oid" + "=" + NEW_OID );
         
         try
         {
@@ -904,7 +904,7 @@ public class MetaObjectClassHandlerIT ex
         attrs.put( sup );
 
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + NEW_OID );
+        dn = dn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( getObjectClassRegistry().contains( NEW_OID ) );

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaSyntaxCheckerHandlerIT.java Fri Jul 30 20:44:57 2010
@@ -86,7 +86,7 @@ public class MetaSyntaxCheckerHandlerIT 
             "m-description: A test syntaxChecker" );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertTrue( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
@@ -106,7 +106,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         // nis is by default inactive
         DN dn = getSyntaxCheckerContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertFalse( "adding new syntaxChecker to disabled schema should not register it into the registries",
@@ -124,7 +124,7 @@ public class MetaSyntaxCheckerHandlerIT 
 
         // nis is by default inactive
         DN dn = getSyntaxCheckerContainer( "notloaded" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         try
         {
@@ -159,7 +159,7 @@ public class MetaSyntaxCheckerHandlerIT 
                 .toByteArray(), "m-oid", OID, "m-description: A test syntaxChecker" );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertTrue( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
@@ -187,7 +187,7 @@ public class MetaSyntaxCheckerHandlerIT 
                 .toByteArray(), "m-oid", OID, "m-description: A test syntaxChecker" );
 
         DN dn = getSyntaxCheckerContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
 
         assertFalse( schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
@@ -199,7 +199,7 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testDeleteSyntaxCheckerFromEnabledSchema() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
 
         assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
@@ -228,7 +228,7 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testDeleteSyntaxCheckerFromDisabledSchema() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
 
         assertTrue( "syntaxChecker should be removed from the registry after being deleted", schemaManager
@@ -258,11 +258,11 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testRenameSyntaxChecker() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
 
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
         assertFalse( "old syntaxChecker OID should be removed from the registry after being renamed", schemaManager
@@ -291,10 +291,10 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -316,10 +316,10 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -344,7 +344,7 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         ModificationItem[] mods = new ModificationItem[1];
         Attribute attr = new BasicAttribute( "m-fqcn", BogusSyntaxChecker.class.getName() );
@@ -369,7 +369,7 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         Attributes mods = new BasicAttributes( true );
         mods.put( "m-fqcn", BogusSyntaxChecker.class.getName() );
@@ -393,7 +393,7 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testDeleteSyntaxCheckerWhenInUse() throws Exception
     {
         DN scDn = getSyntaxCheckerContainer( "apachemeta" );
-        scDn.add( "m-oid" + "=" + OID );
+        scDn = scDn.add( "m-oid" + "=" + OID );
 
         // Create a new SyntaxChecker
         testAddSyntaxCheckerToEnabledSchema();
@@ -405,7 +405,7 @@ public class MetaSyntaxCheckerHandlerIT 
             "objectClass: metaSyntax", "m-oid", OID, "m-description: test" );
 
         DN sDn = getSyntaxContainer( "apachemeta" );
-        sDn.add( "m-oid" + "=" + OID );
+        sDn = sDn.add( "m-oid" + "=" + OID );
 
         // Pre-checks
         assertFalse( isOnDisk( sDn ) );
@@ -440,10 +440,10 @@ public class MetaSyntaxCheckerHandlerIT 
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         try
         {
@@ -469,10 +469,10 @@ public class MetaSyntaxCheckerHandlerIT 
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxCheckerContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
 
         try
         {
@@ -495,12 +495,12 @@ public class MetaSyntaxCheckerHandlerIT 
     public void testRenameSyntaxCheckerWhenInUse() throws Exception
     {
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxCheckerToEnabledSchema();
         schemaManager.getLdapSyntaxRegistry().register( new DummySyntax() );
 
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
 
         try
         {
@@ -529,7 +529,7 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN top = new DN();
         top.add( "m-oid" + "=" + OID );
@@ -555,10 +555,10 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = new DN( "ou=comparators,cn=apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         try
         {
@@ -581,11 +581,11 @@ public class MetaSyntaxCheckerHandlerIT 
         testAddSyntaxCheckerToEnabledSchema();
 
         DN dn = getSyntaxCheckerContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         // nis is inactive by default
         DN newdn = getSyntaxCheckerContainer( "nis" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -602,13 +602,13 @@ public class MetaSyntaxCheckerHandlerIT 
 
         // nis is inactive by default
         DN dn = getSyntaxCheckerContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         assertFalse( "syntaxChecker OID should NOT be present when added to disabled nis schema", schemaManager
             .getSyntaxCheckerRegistry().contains( OID ) );
 
         DN newdn = getSyntaxCheckerContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
 
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 

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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 2010
@@ -102,7 +102,7 @@ public class MetaSyntaxHandlerIT extends
             "m-description", DESCRIPTION0 );
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         createDummySyntaxChecker( OID, "apachemeta" );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
@@ -125,7 +125,7 @@ public class MetaSyntaxHandlerIT extends
         
         // nis is by default inactive
         DN dn = getSyntaxContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         createDummySyntaxChecker( OID, "nis" );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
@@ -147,7 +147,7 @@ public class MetaSyntaxHandlerIT extends
         
         // nis is by default inactive
         DN dn = getSyntaxContainer( "notloaded" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         createDummySyntaxChecker( OID, "nis" );
         
         try
@@ -170,7 +170,7 @@ public class MetaSyntaxHandlerIT extends
     public void testDeleteSyntaxFromEnabledSchema() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         
         assertTrue( isOnDisk( dn ) );
@@ -199,7 +199,7 @@ public class MetaSyntaxHandlerIT extends
     public void testDeleteSyntaxFromDisabledSchema() throws Exception
     {
         DN dn = getSyntaxContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToDisabledSchema();
 
         assertTrue( isOnDisk( dn ) );
@@ -229,11 +229,11 @@ public class MetaSyntaxHandlerIT extends
     public void testRenameSyntax() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         
         DN newdn = getSyntaxContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
         assertFalse( "old syntax OID should be removed from the registry after being renamed", 
@@ -260,10 +260,10 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -282,10 +282,10 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -310,7 +310,7 @@ public class MetaSyntaxHandlerIT extends
         assertEquals( syntax.getDescription(), DESCRIPTION0 );
 
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         ModificationItem[] mods = new ModificationItem[1];
         Attribute attr = new BasicAttribute( "m-description", DESCRIPTION1 );
@@ -338,7 +338,7 @@ public class MetaSyntaxHandlerIT extends
         assertEquals( syntax.getDescription(), DESCRIPTION0 );
 
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         
         Attributes mods = new BasicAttributes( true );
         mods.put( "m-description", DESCRIPTION1 );
@@ -364,7 +364,7 @@ public class MetaSyntaxHandlerIT extends
     public void testDeleteSyntaxWhenInUse() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         addDependeeMatchingRule( OID );
         
@@ -390,10 +390,10 @@ public class MetaSyntaxHandlerIT extends
         addDependeeMatchingRule( OID );
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -418,10 +418,10 @@ public class MetaSyntaxHandlerIT extends
         addDependeeMatchingRule( OID );
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = getSyntaxContainer( "apache" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         try
         {
@@ -449,7 +449,7 @@ public class MetaSyntaxHandlerIT extends
             "m-description", MR_DESCRIPTION );
         
         DN dn = getMatchingRuleContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + MR_OID );
+        dn = dn.add( "m-oid" + "=" + MR_OID );
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attrs );
         
         assertTrue( schemaManager.getMatchingRuleRegistry().contains( MR_OID ) );
@@ -462,12 +462,12 @@ public class MetaSyntaxHandlerIT extends
     public void testRenameNormalizerWhenInUse() throws Exception
     {
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
         testAddSyntaxToEnabledSchema();
         addDependeeMatchingRule( OID );
         
         DN newdn = getSyntaxContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + NEW_OID );
+        newdn = newdn.add( "m-oid" + "=" + NEW_OID );
         
         try
         {
@@ -496,7 +496,7 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN top = new DN();
         top.add( "m-oid" + "=" + OID );
@@ -523,10 +523,10 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         DN newdn = new DN( "ou=comparators,cn=apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         try
         {
@@ -550,11 +550,11 @@ public class MetaSyntaxHandlerIT extends
         testAddSyntaxToEnabledSchema();
         
         DN dn = getSyntaxContainer( "apachemeta" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         // nis is inactive by default
         DN newdn = getSyntaxContainer( "nis" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 
@@ -571,13 +571,13 @@ public class MetaSyntaxHandlerIT extends
         
         // nis is inactive by default
         DN dn = getSyntaxContainer( "nis" );
-        dn.add( "m-oid" + "=" + OID );
+        dn = dn.add( "m-oid" + "=" + OID );
 
         assertFalse( "syntax OID should NOT be present when added to disabled nis schema", 
             schemaManager.getLdapSyntaxRegistry().contains( OID ) );
 
         DN newdn = getSyntaxContainer( "apachemeta" );
-        newdn.add( "m-oid" + "=" + OID );
+        newdn = newdn.add( "m-oid" + "=" + OID );
         
         getSchemaContext( service ).rename( DN.toName( dn ), DN.toName( newdn ) );
 

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/schema/ObjectClassCreateIT.java Fri Jul 30 20:44:57 2010
@@ -103,7 +103,7 @@ public class ObjectClassCreateIT extends
         
         // Inject the AT
         DN dn = new DN( "ou=attributeTypes,cn=apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22.249" );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22.249" );
         
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
         
@@ -141,7 +141,7 @@ public class ObjectClassCreateIT extends
         
         // Inject the OC
         dn = new DN( "ou=objectClasses,cn=apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22" );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=2.16.840.1.113730.3.2.22" );
         
         getSchemaContext( service ).createSubcontext( DN.toName( dn ), attributes );
     }
@@ -180,7 +180,7 @@ public class ObjectClassCreateIT extends
         attributes.put( "m-name", "http://example.com/users/accounts/L0" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
         
         try
         {
@@ -215,7 +215,7 @@ public class ObjectClassCreateIT extends
         attributes.put( "m-name", "no-objectClasses" );
         
         DN dn = getObjectClassContainer( "apachemeta" );
-        dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
+        dn = dn.add( MetaSchemaConstants.M_OID_AT + "=" + testOID );
         
         try
         {

Modified: directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java (original)
+++ directory/apacheds/trunk/core-integ/src/test/java/org/apache/directory/server/core/trigger/BackupUtilitiesSP.java Fri Jul 30 20:44:57 2010
@@ -53,7 +53,7 @@ public class BackupUtilitiesSP
         DN backupDn = new DN ( "ou=backupContext,ou=system" );
         String deletedEntryRdn = deletedEntry.getDn().get( deletedEntry.getDn().size() - 1 );
         Entry entry = ( Entry ) deletedEntry.getOriginalEntry().clone();
-        backupDn.add( deletedEntryRdn );
+        backupDn = backupDn.add( deletedEntryRdn );
         entry.setDn( backupDn );
         session.add( deletedEntry );
         LOG.info( "Backed up deleted entry to \"" + backupDn + "\"" );

Propchange: directory/apacheds/trunk/core-jndi/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Jul 30 20:44:57 2010
@@ -0,0 +1,2 @@
+/directory/apacheds/branches/apacheds-dnfactory-experiment/core-jndi:980138-980935
+/directory/apacheds/trunk/core-jndi:980025-980137

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java (original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java Fri Jul 30 20:44:57 2010
@@ -202,7 +202,7 @@ public abstract class ServerContext impl
     public ServerContext( DirectoryService service, LdapPrincipal principal, Name name ) throws Exception
     {
         this.service = service;
-        this.dn = (DN)(DN.fromName( name ).clone());
+        this.dn = DN.fromName( name );
 
         this.env = new Hashtable<String, Object>();
         this.env.put( PROVIDER_URL, dn.toString() );
@@ -225,7 +225,7 @@ public abstract class ServerContext impl
     public ServerContext( DirectoryService service, CoreSession session, Name name ) throws Exception
     {
         this.service = service;
-        this.dn = (DN)(DN.fromName( name ).clone());
+        this.dn = DN.fromName( name );
         this.env = new Hashtable<String, Object>();
         this.env.put( PROVIDER_URL, dn.toString() );
         this.env.put( DirectoryService.JNDI_KEY, service );
@@ -1042,22 +1042,22 @@ public abstract class ServerContext impl
         }
 
         // calculate parents
-        DN oldParent = (DN)oldDn.clone();
+        DN oldParent = oldDn;
         
         try
         {
-            oldParent.remove( oldDn.size() - 1 );
+            oldParent = oldParent.remove( oldDn.size() - 1 );
         }
         catch ( LdapInvalidDnException lide )
         {
             throw new NamingException( I18n.err( I18n.ERR_313, lide.getMessage() ) );
         }
         
-        DN newParent = ( DN ) newDn.clone();
+        DN newParent = newDn;
         
         try
         {
-            newParent.remove( newDn.size() - 1 );
+            newParent = newParent.remove( newDn.size() - 1 );
         }
         catch ( LdapInvalidDnException lide )
         {
@@ -1459,7 +1459,7 @@ public abstract class ServerContext impl
             {
                 try
                 {
-                    fqn.remove( 0 );
+                    fqn = fqn.remove( 0 );
                 }
                 catch ( LdapInvalidDnException lide )
                 {
@@ -1556,12 +1556,12 @@ public abstract class ServerContext impl
      */
     DN buildTarget( DN relativeName ) throws NamingException
     {
-        DN target = ( DN ) dn.clone();
+        DN target = dn;
 
         // Add to left hand side of cloned DN the relative name arg
         try
         {
-            target.addAllNormalized( target.size(), relativeName );
+            target = target.addAllNormalized( target.size(), relativeName );
         }
         catch (LdapInvalidDnException lide )
         {

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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 2010
@@ -735,10 +735,10 @@ public class DefaultDirectoryService imp
         }
 
         // calculate parents
-        DN oldBase = ( DN ) oldDn.clone();
-        oldBase.remove( oldDn.size() - 1 );
-        DN newBase = ( DN ) newDn.clone();
-        newBase.remove( newDn.size() - 1 );
+        DN oldBase = oldDn;
+        oldBase = oldBase.remove( oldDn.size() - 1 );
+        DN newBase = newDn;
+        newBase = newBase.remove( newDn.size() - 1 );
 
         // Compute the RDN for each of the DN
         RDN newRdn = newDn.getRdn( newDn.size() - 1 );
@@ -758,8 +758,8 @@ public class DefaultDirectoryService imp
         }
         else
         {
-            DN target = ( DN ) newDn.clone();
-            target.remove( newDn.size() - 1 );
+            DN target = newDn;
+            target = target.remove( newDn.size() - 1 );
 
             if ( newRdn.equals( oldRdn ) )
             {
@@ -1159,7 +1159,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 ) ) )
         {
@@ -1184,7 +1184,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 ) ) )
         {
@@ -1209,7 +1209,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 ) ) )
         {
@@ -1235,7 +1235,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 ) ) )
         {
@@ -1257,7 +1257,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 ) ) )
         {
@@ -1278,7 +1278,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 ) ) )
         {
@@ -1300,7 +1300,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 ) ) )
         {
@@ -1322,7 +1322,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 ) ) )
         {
@@ -1356,7 +1356,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();
@@ -1422,7 +1422,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
@@ -1549,7 +1549,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/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java Fri Jul 30 20:44:57 2010
@@ -106,7 +106,7 @@ public class DefaultOperationManager imp
                 // So we have to take the RDN one by one, and create a 
                 // new DN with the type and value UP form
     
-                DN urlDn = ( DN ) ldapUrl.getDn().addAll( childDn );
+                DN urlDn = ldapUrl.getDn().addAll( childDn );
     
                 ldapUrl.setDn( urlDn );
                 urls.add( ldapUrl.toString() );
@@ -160,7 +160,7 @@ public class DefaultOperationManager imp
                     // So we have to take the RDN one by one, and create a 
                     // new DN with the type and value UP form
 
-                    DN urlDn = ( DN ) ldapUrl.getDn().addAll( childDn );
+                    DN urlDn = ldapUrl.getDn().addAll( childDn );
 
                     ldapUrl.setDn( urlDn );
                 }
@@ -871,9 +871,9 @@ public class DefaultOperationManager imp
             // Inject the new DN into the context
             if ( !dn.isEmpty() )
             {
-                DN newDn = ( DN ) dn.clone();
-                newDn.remove( dn.size() - 1 );
-                newDn.add( renameContext.getNewRdn() );
+                DN newDn = dn;
+                newDn = newDn.remove( dn.size() - 1 );
+                newDn = newDn.add( renameContext.getNewRdn() );
                 renameContext.setNewDn( newDn );
             }
 

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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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 );

Propchange: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/PasswordPolicyConfiguration.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 30 20:44:57 2010
@@ -1,3 +1,4 @@
+/directory/apacheds/branches/apacheds-dnfactory-experiment/core/src/main/java/org/apache/directory/server/core/authn/PasswordPolicyConfiguration.java:980138-980934
 /directory/apacheds/branches/apacheds-replication/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyConfiguration.java:749790-764110
 /directory/apacheds/branches/apacheds-schema/interceptor-kerberos/src/main/java/org/apache/directory/server/core/kerberos/PasswordPolicyConfiguration.java:806623-896441
 /directory/apacheds/branches/apacheds-subtree/core/src/main/java/org/apache/directory/server/core/authn/PasswordPolicyConfiguration.java:965203-965686

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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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();
     }
 
@@ -278,8 +279,8 @@ public class AciAuthorizationInterceptor
          */
         if ( oc.contains( SchemaConstants.SUBENTRY_OC ) )
         {
-            DN parentDn = ( DN ) dn.clone();
-            parentDn.remove( dn.size() - 1 );
+            DN parentDn = dn;
+            parentDn = parentDn.remove( dn.size() - 1 );
             originalEntry = opContext.lookup( parentDn, ByPassConstants.LOOKUP_BYPASS );
         }
 

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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 2010
@@ -21,6 +21,7 @@ package org.apache.directory.server.core
 
 
 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;
@@ -114,7 +115,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
@@ -157,8 +158,8 @@ public class ExceptionInterceptor extend
             return;
         }
 
-        DN parentDn = ( DN ) name.clone();
-        parentDn.remove( name.size() - 1 );
+        DN parentDn = name;
+        parentDn = parentDn.remove( name.size() - 1 );
 
         // check if we're trying to add to a parent that is an alias
         boolean notAnAlias;
@@ -192,7 +193,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
@@ -338,7 +339,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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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() );
@@ -529,14 +530,14 @@ public class OperationalAttributeInterce
             RDN rdn = dn.getRdn( ii );
             if ( rdn.size() == 0 )
             {
-                newDn.add( new RDN() );
+                newDn = newDn.add( new RDN() );
                 continue;
             }
             else if ( rdn.size() == 1 )
             {
                 String name = schemaManager.lookupAttributeTypeRegistry( rdn.getNormType() ).getName();
                 String value = rdn.getAtav().getNormValue().getString();
-                newDn.add( new RDN( name, name, value, value ) );
+                newDn = newDn.add( new RDN( name, name, value, value ) );
                 continue;
             }
 
@@ -555,7 +556,7 @@ public class OperationalAttributeInterce
                 }
             }
 
-            newDn.add( new RDN( buf.toString() ) );
+            newDn = newDn.add( new RDN( buf.toString() ) );
         }
 
         return newDn;

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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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 );
@@ -321,7 +322,7 @@ public class DefaultPartitionNexus exten
             system.add( addOperationContext );
         }
 
-        String key = system.getSuffix().getName();
+        String key = system.getSuffix().getNormName();
 
         if ( partitions.containsKey( key ) )
         {
@@ -366,9 +367,7 @@ public class DefaultPartitionNexus exten
         {
             try
             {
-                DN adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED, schemaManager );
-
-                removeContextPartition(  new DN( suffix ) );
+                removeContextPartition(  DNFactory.create( suffix ) );
             }
             catch ( Exception e )
             {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/prefs/PreferencesUtils.java Fri Jul 30 20:44:57 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( "/" );
 
@@ -50,7 +51,7 @@ class PreferencesUtils
         {
             if ( comps[ii] != null && !comps[ii].trim().equals( "" ) )
             {
-                dn.add( "prefNodeName=" + comps[ii] );
+                dn = dn.add( "prefNodeName=" + comps[ii] );
             }
         }
 

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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/schema/SchemaSubentryModifier.java Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/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=980948&r1=980947&r2=980948&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 Fri Jul 30 20:44:57 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/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java?rev=980948&r1=980947&r2=980948&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/sp/StoredProcExecutionManager.java Fri Jul 30 20:44:57 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() )



Mime
View raw message