directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r951876 [1/2] - in /directory: apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/ apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/ apacheds/trunk/core-api/src/main/...
Date Sun, 06 Jun 2010 15:31:13 GMT
Author: elecharny
Date: Sun Jun  6 15:31:12 2010
New Revision: 951876

URL: http://svn.apache.org/viewvc?rev=951876&view=rev
Log:
o Removed the getSuffix() method from the OperationManager and from the interceptors
o The Partition.getSuffix() and Partition.setSuffix() are now returning a DN and take a DN parameter.
o Removed the Partition getSuffixDn() method  
o Renamed the getSuffix( DN ) method to findSuffix( DN )


Removed:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/GetSuffixOperationContext.java
Modified:
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
    directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
    directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java
    directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperationManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultOperationManager.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/exception/ExceptionInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
    directory/apacheds/trunk/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
    directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
    directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java
    directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
    directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/avl/AvlPartition.java
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java
    directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/AvlPartitionFactory.java Sun Jun  6 15:31:12 2010
@@ -27,6 +27,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -46,7 +47,7 @@ public class AvlPartitionFactory impleme
     {
         AvlPartition partition = new AvlPartition();
         partition.setId( id );
-        partition.setSuffix( suffix );
+        partition.setSuffix( new DN( suffix ) );
         partition.setCacheSize( 500 );
         partition.setPartitionDir( workingDirectory );
         return partition;

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java Sun Jun  6 15:31:12 2010
@@ -42,6 +42,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.exception.LdapException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.apache.directory.shared.ldap.name.DN;
 import org.junit.runner.Description;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -108,7 +109,7 @@ public class DSAnnotationProcessor
                 // The annotation contains a specific partition type, we use that type.
                 partition = createPartition.type().newInstance();
                 partition.setId( createPartition.name() );
-                partition.setSuffix( createPartition.suffix() );
+                partition.setSuffix( new DN( createPartition.suffix() ) );
 
                 if ( partition instanceof BTreePartition<?> )
                 {

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/JdbmPartitionFactory.java Sun Jun  6 15:31:12 2010
@@ -27,6 +27,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -46,7 +47,7 @@ public class JdbmPartitionFactory implem
     {
         JdbmPartition partition = new JdbmPartition();
         partition.setId( id );
-        partition.setSuffix( suffix );
+        partition.setSuffix( new DN( suffix ) );
         partition.setCacheSize( 500 );
         partition.setPartitionDir( workingDirectory );
         return partition;

Modified: directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java (original)
+++ directory/apacheds/trunk/core-annotations/src/main/java/org/apache/directory/server/core/factory/LdifPartitionFactory.java Sun Jun  6 15:31:12 2010
@@ -27,6 +27,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.xdbm.Index;
 import org.apache.directory.server.xdbm.impl.avl.AvlIndex;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -46,7 +47,7 @@ public class LdifPartitionFactory implem
     {
         LdifPartition partition = new LdifPartition();
         partition.setId( id );
-        partition.setSuffix( suffix );
+        partition.setSuffix( new DN( suffix ) );
         partition.setCacheSize( 500 );
         partition.setWorkingDirectory( workingDirectory.getAbsolutePath() );
         partition.setPartitionDir( workingDirectory );

Modified: directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java (original)
+++ directory/apacheds/trunk/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java Sun Jun  6 15:31:12 2010
@@ -116,13 +116,13 @@ public class DirectoryServiceAnnotationT
             if ( "example".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "dc=example,dc=com", partition.getSuffixDn().getName() );
+                assertEquals( "dc=example,dc=com", partition.getSuffix().getName() );
                 assertTrue( partition instanceof JdbmPartition );
             }
             else if ( "schema".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "ou=schema", partition.getSuffixDn().getName() );
+                assertEquals( "ou=schema", partition.getSuffix().getName() );
             }
         }
         
@@ -162,13 +162,13 @@ public class DirectoryServiceAnnotationT
             if ( "example".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "dc=example,dc=com", partition.getSuffixDn().getName() );
+                assertEquals( "dc=example,dc=com", partition.getSuffix().getName() );
                 assertTrue( partition instanceof AvlPartition );
             }
             else if ( "schema".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "ou=schema", partition.getSuffixDn().getName() );
+                assertEquals( "ou=schema", partition.getSuffix().getName() );
             }
         }
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/OperationManager.java Sun Jun  6 15:31:12 2010
@@ -29,7 +29,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -41,7 +40,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -62,12 +60,6 @@ public interface OperationManager
     /**
      * TODO document after determining if this method should be here.
      */
-    DN getSuffix ( GetSuffixOperationContext opContext ) throws LdapException;
-
-
-    /**
-     * TODO document after determining if this method should be here.
-     */
     Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws LdapException;
 
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java Sun Jun  6 15:31:12 2010
@@ -33,7 +33,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -47,7 +46,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.invocation.InvocationStack;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -141,12 +139,6 @@ public abstract class BaseInterceptor im
     }
 
 
-    public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
-    {
-        return next.getSuffix( opContext );
-    }
-
-
     public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws LdapException
     {
         return next.hasEntry( opContext );

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java Sun Jun  6 15:31:12 2010
@@ -30,7 +30,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -43,7 +42,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -139,12 +137,6 @@ public interface Interceptor
 
 
     /**
-     * Filters {@link DefaultPartitionNexus#getSuffix( GetSuffixOperationContext )} call.
-     */
-    DN getSuffix ( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException;
-
-
-    /**
      * Filters {@link DefaultPartitionNexus#listSuffixes( ListSuffixOperationContext )} call.
      */
     Set<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java Sun Jun  6 15:31:12 2010
@@ -38,7 +38,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -56,7 +55,6 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -110,12 +108,6 @@ public class InterceptorChain
         }
 
 
-        public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
-        {
-            return ( DN ) nexus.getSuffix( opContext ).clone();
-        }
-
-
         public Set<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException
         {
             return nexus.listSuffixes( opContext );
@@ -540,28 +532,6 @@ public class InterceptorChain
     }
 
 
-    public DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException
-    {
-        Element entry = getStartingEntry();
-        Interceptor head = entry.interceptor;
-        NextInterceptor next = entry.nextInterceptor;
-
-        try
-        {
-            return head.getSuffix( next, opContext );
-        }
-        catch ( LdapException le )
-        {
-            throw le;
-        }
-        catch ( Throwable e )
-        {
-            throwInterceptorException( head, e );
-            throw new InternalError(); // Should be unreachable
-        }
-    }
-
-
     public boolean compare( CompareOperationContext opContext ) throws LdapException
     {
         Element entry = getStartingEntry();
@@ -1008,27 +978,6 @@ public class InterceptorChain
                 }
 
 
-                public DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException
-                {
-                    Element next = getNextEntry();
-                    Interceptor interceptor = next.interceptor;
-
-                    try
-                    {
-                        return interceptor.getSuffix( next.nextInterceptor, opContext );
-                    }
-                    catch ( LdapException le )
-                    {
-                        throw le;
-                    }
-                    catch ( Throwable e )
-                    {
-                        throwInterceptorException( interceptor, e );
-                        throw new InternalError(); // Should be unreachable
-                    }
-                }
-
-
                 public Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws LdapException
                 {
                     Element next = getNextEntry();

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java Sun Jun  6 15:31:12 2010
@@ -29,7 +29,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -41,7 +40,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 
 
 /**
@@ -67,12 +65,6 @@ public interface NextInterceptor
 
 
     /**
-     * Calls the next interceptor's {@link Interceptor#getSuffix( NextInterceptor, GetSuffixOperationContext )}.
-     */
-    DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException;
-
-
-    /**
      * Calls the next interceptor's {@link Interceptor#listSuffixes( NextInterceptor, ListSuffixOperationContext )}.
      */
     Set<String> listSuffixes( ListSuffixOperationContext opContext ) throws LdapException;

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/NullPartition.java Sun Jun  6 15:31:12 2010
@@ -105,15 +105,6 @@ public class NullPartition extends Abstr
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.Partition#getSuffix()
-     */
-    public DN getSuffixDn()
-    {
-        return suffix;
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.server.core.partition.Partition#list(org.apache.directory.server.core.interceptor.context.ListOperationContext)
      */
     public EntryFilteringCursor list( ListOperationContext opContext ) throws LdapException
@@ -349,9 +340,9 @@ public class NullPartition extends Abstr
     /**
      * {@inheritDoc}
      */
-    public void setSuffix( String suffix ) throws LdapInvalidDnException
+    public void setSuffix( DN suffix ) throws LdapInvalidDnException
     {
-        this.suffix = new DN( suffix );
+        this.suffix = suffix;
     }
 
 
@@ -363,9 +354,9 @@ public class NullPartition extends Abstr
     }
 
 
-    public String getSuffix()
+    public DN getSuffix()
     {
-        return suffix.getName();
+        return suffix;
     }
 
 

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/Partition.java Sun Jun  6 15:31:12 2010
@@ -72,18 +72,12 @@ public interface Partition
 
 
     /**
-     * Gets the user provided suffix for this Partition as a String.
-     */
-    String getSuffix();
-
-
-    /**
      * Sets the user provided suffix for this Partition as a String.
      *
      * @param suffix the suffix String for this Partition.
      * @throws LdapInvalidDnException if the suffix does not conform to LDAP DN syntax
      */
-    void setSuffix( String suffix ) throws LdapInvalidDnException;
+    void setSuffix( DN suffix ) throws LdapInvalidDnException;
 
 
     /**
@@ -122,7 +116,7 @@ public interface Partition
      * @return the suffix for this Partition.
      * @throws IllegalStateException if the Partition has not been initialized
      */
-    DN getSuffixDn();
+    DN getSuffix();
 
 
     /**

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java Sun Jun  6 15:31:12 2010
@@ -24,7 +24,6 @@ import java.util.Set;
 
 import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
@@ -100,17 +99,15 @@ public interface PartitionNexus extends 
 
 
     /**
-     * Gets the distinguished name of the suffix that would hold an entry with
+     * Finds the distinguished name of the suffix that would hold an entry with
      * the supplied distinguished name parameter.  If the DN argument does not
      * fall under a partition suffix then the empty string Dn is returned.
      *
-     * @param suffixContext the Context containing normalized distinguished
-     * name to use for finding a suffix.
+     * @param The DN we want to find the suffix from
      * @return the suffix portion of dn, or the valid empty string Dn if no
      * naming context was found for dn.
-     * @throws Exception if there are any problems
      */
-    public DN getSuffix( GetSuffixOperationContext getSuffixContext ) throws LdapException;
+    public DN findSuffix( DN dn ) throws LdapException;
 
 
     /**

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Sun Jun  6 15:31:12 2010
@@ -123,6 +123,9 @@ public final class SchemaPartition exten
     /** A static DN for the ou=schemaModifications entry */
     private static DN schemaModificationDN;
 
+    /** A static DN for the ou=schema partition */
+    private static DN schemaDN;
+
 
     /**
      * Sets the wrapped {@link Partition} which must be supplied or 
@@ -174,25 +177,16 @@ public final class SchemaPartition exten
     /**
      * Always returns {@link ServerDNConstants#OU_SCHEMA_DN_NORMALIZED}: '2.5.4.11=schema'.
      */
-    public DN getSuffixDn()
-    {
-        return wrapped.getSuffixDn();
-    }
-
-
-    /**
-     * Always returns {@link ServerDNConstants#OU_SCHEMA_DN}: 'ou=schema'.
-     */
-    public String getSuffix()
+    public DN getSuffix()
     {
-        return SchemaConstants.OU_SCHEMA;
+        return wrapped.getSuffix();
     }
 
 
     /**
      * Has no affect: just logs a warning.
      */
-    public void setSuffix( String suffix )
+    public void setSuffix( DN suffix )
     {
         LOG.warn( "This partition's suffix is fixed: {}", SchemaConstants.OU_SCHEMA );
     }
@@ -216,11 +210,11 @@ public final class SchemaPartition exten
         // Load apachemeta schema from within the ldap-schema Jar with all the
         // schema it depends on.  This is a minimal mandatory set of schemas.
         // -----------------------------------------------------------------------
-        //SerializableComparator.setSchemaManager( schemaManager );
-
+        schemaDN = new DN( SchemaConstants.OU_SCHEMA );
+        schemaDN.normalize( schemaManager.getNormalizerMapping() );
+        
         wrapped.setId( ID );
-        wrapped.setSuffix( SchemaConstants.OU_SCHEMA );
-        wrapped.getSuffixDn().normalize( schemaManager.getNormalizerMapping() );
+        wrapped.setSuffix( schemaDN );
         wrapped.setSchemaManager( schemaManager );
 
         try

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDaoImpl.java Sun Jun  6 15:31:12 2010
@@ -39,13 +39,13 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
-import org.apache.directory.shared.ldap.entry.DefaultModification;
 import org.apache.directory.shared.ldap.entry.DefaultEntryAttribute;
-import org.apache.directory.shared.ldap.entry.StringValue;
+import org.apache.directory.shared.ldap.entry.DefaultModification;
+import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.entry.Modification;
 import org.apache.directory.shared.ldap.entry.ModificationOperation;
-import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.entry.StringValue;
 import org.apache.directory.shared.ldap.filter.AndNode;
 import org.apache.directory.shared.ldap.filter.BranchNode;
 import org.apache.directory.shared.ldap.filter.EqualityNode;
@@ -247,7 +247,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -299,7 +299,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -351,7 +351,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -403,7 +403,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -455,7 +455,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -535,7 +535,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -629,7 +629,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -688,7 +688,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -724,7 +724,7 @@ public class SchemaPartitionDaoImpl impl
         filter.addNode( new PresenceNode( M_OID_OID ) );
         filter.addNode( new PresenceNode( M_NAME_OID ) );
 
-        SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+        SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
             filter, searchControls );
         searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
         
@@ -778,7 +778,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -826,7 +826,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -868,7 +868,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             
@@ -954,7 +954,7 @@ public class SchemaPartitionDaoImpl impl
 
         try
         {
-            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffixDn(),
+            SearchOperationContext searchOperationContext = new SearchOperationContext( null, partition.getSuffix(),
                 filter, searchControls );
             searchOperationContext.setAliasDerefMode( AliasDerefMode.DEREF_ALWAYS );
             

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockInterceptor.java Sun Jun  6 15:31:12 2010
@@ -32,7 +32,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -44,7 +43,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 
 
 public class MockInterceptor implements Interceptor
@@ -90,13 +88,6 @@ public class MockInterceptor implements 
     }
 
 
-    public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
-    {
-        interceptors.add( this );
-        return next.getSuffix( opContext );
-    }
-
-
     public Set<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException
     {
         interceptors.add( this );

Modified: directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperationManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperationManager.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperationManager.java (original)
+++ directory/apacheds/trunk/core-api/src/test/java/org/apache/directory/server/core/MockOperationManager.java Sun Jun  6 15:31:12 2010
@@ -30,7 +30,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -42,7 +41,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 
 public class MockOperationManager implements OperationManager
 {
@@ -78,11 +76,6 @@ public class MockOperationManager implem
         return null;
     }
 
-    public DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException
-    {
-        return null;
-    }
-
     public boolean hasEntry( EntryOperationContext opContext ) throws LdapException
     {
         return false;

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=951876&r1=951875&r2=951876&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 Sun Jun  6 15:31:12 2010
@@ -117,7 +117,7 @@ public class DefaultDirectoryService imp
     
     /** the root nexus */
     private DefaultPartitionNexus partitionNexus;
-
+    
     /** whether or not server is started for the first time */
     private boolean firstStart;
 
@@ -605,7 +605,7 @@ public class DefaultDirectoryService imp
             return;
         }
 
-        partitionNexus.removeContextPartition( partition.getSuffixDn() );
+        partitionNexus.removeContextPartition( partition.getSuffix() );
     }
 
 
@@ -915,7 +915,7 @@ public class DefaultDirectoryService imp
 
         // load the last stored valid CSN value
         LookupOperationContext loc = new LookupOperationContext( getAdminSession() );
-        loc.setDn( systemPartition.getSuffixDn() );
+        loc.setDn( systemPartition.getSuffix() );
         loc.setAttrsId( new String[]{ "+" } );
         ClonedServerEntry entry = systemPartition.lookup( loc );
         
@@ -1405,7 +1405,7 @@ public class DefaultDirectoryService imp
         schemaService.initialize();
         schemaService.getSchemaPartition().initialize();
         partitions.add( schemaService.getSchemaPartition() );
-        systemPartition.getSuffixDn().normalize( schemaManager.getNormalizerMapping() );
+        systemPartition.getSuffix().normalize( schemaManager.getNormalizerMapping() );
 
         adminDn = new DN( ServerDNConstants.ADMIN_SYSTEM_DN ).normalize( schemaManager.getNormalizerMapping() );
         adminDn.normalize( schemaManager.getNormalizerMapping() );
@@ -1435,7 +1435,7 @@ public class DefaultDirectoryService imp
             
             if( changeLog.isExposed() && changeLog.isTagSearchSupported() )
             {
-                String clSuffix = ( ( TaggableSearchableChangeLogStore ) changeLog.getChangeLogStore() ).getPartition().getSuffixDn().getName();
+                String clSuffix = ( ( TaggableSearchableChangeLogStore ) changeLog.getChangeLogStore() ).getPartition().getSuffix().getName();
                 partitionNexus.getRootDSE( null ).add( SchemaConstants.CHANGELOG_CONTEXT_AT, clSuffix );
             }
         }

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=951876&r1=951875&r2=951876&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 Sun Jun  6 15:31:12 2010
@@ -32,7 +32,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -490,29 +489,6 @@ public class DefaultOperationManager imp
     /**
      * {@inheritDoc}
      */
-    public DN getSuffix( GetSuffixOperationContext opContext ) throws LdapException
-    {
-        LOG.debug( ">> GetSuffixOperation : {}", opContext );
-
-        ensureStarted();
-        push( opContext );
-
-        try
-        {
-            return directoryService.getInterceptorChain().getSuffix( opContext );
-        }
-        finally
-        {
-            pop();
-
-            LOG.debug( "<< GetSuffixOperation successful" );
-        }
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public boolean hasEntry( EntryOperationContext opContext ) throws LdapException
     {
         LOG.debug( ">> hasEntryOperation : {}", opContext );

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java Sun Jun  6 15:31:12 2010
@@ -41,7 +41,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -238,18 +237,6 @@ public class AuthenticationInterceptor e
     }
 
 
-    public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
-    {
-        if ( IS_DEBUG )
-        {
-            LOG.debug( "Operation Context: {}", opContext );
-        }
-
-        checkAuthenticated( opContext );
-        return next.getSuffix( opContext );
-    }
-
-
     public boolean hasEntry( NextInterceptor next, EntryOperationContext opContext ) throws LdapException
     {
         if ( IS_DEBUG )

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=951876&r1=951875&r2=951876&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 Sun Jun  6 15:31:12 2010
@@ -32,7 +32,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
@@ -149,7 +148,7 @@ public class ExceptionInterceptor extend
             throw ne;
         }
 
-        DN suffix = nexus.getSuffix( new GetSuffixOperationContext( this.directoryService.getAdminSession(), name ) );
+        DN suffix = nexus.findSuffix( name );
 
         // we're adding the suffix entry so just ignore stuff to mess with the parent
         if ( suffix.equals( name ) )

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/logger/TimerInterceptor.java Sun Jun  6 15:31:12 2010
@@ -33,7 +33,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -45,7 +44,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.entry.Entry;
 import org.apache.directory.shared.ldap.exception.LdapException;
-import org.apache.directory.shared.ldap.name.DN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -97,10 +95,6 @@ public class TimerInterceptor implements
     private static AtomicLong totalGetRootDSE = new AtomicLong( 0 );
     private static AtomicInteger nbGetRootDSECalls = new AtomicInteger( 0 );
     
-    /** Stats for the GetSuffix operation */
-    private static AtomicLong totalGetSuffix = new AtomicLong( 0 );
-    private static AtomicInteger nbGetSuffixCalls = new AtomicInteger( 0 );
-    
     /** Stats for the HasEntry operation */
     private static AtomicLong totalHasEntry = new AtomicLong( 0 );
     private static AtomicInteger nbHasEntryCalls = new AtomicInteger( 0 );
@@ -586,36 +580,6 @@ public class TimerInterceptor implements
     /**
      * {@inheritDoc}
      */
-    public DN getSuffix( NextInterceptor next, GetSuffixOperationContext opContext ) throws LdapException
-    {
-        long t0 = System.nanoTime();
-        DN dn = next.getSuffix( opContext );
-        long delta = System.nanoTime() - t0;
-        
-        if ( IS_DEBUG_STATS )
-        {
-            nbGetSuffixCalls.incrementAndGet();
-            totalGetSuffix.getAndAdd( delta );
-    
-            if ( nbGetSuffixCalls.get() % 1000 == 0 )
-            {
-                long average = totalGetSuffix.get()/(nbGetSuffixCalls.get() * 1000);
-                OPERATION_STATS.debug( name + " : Average getSuffix = {} microseconds, nb getSuffixes = {}", average, nbGetSuffixCalls.get() );
-            }
-        }
-
-        if ( IS_DEBUG_TIME )
-        {
-            OPERATION_TIME.debug( "{} : Delta getSuffix = {}", name, delta );
-        }
-        
-        return dn;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public Set<String> listSuffixes( NextInterceptor next, ListSuffixOperationContext opContext ) throws LdapException
     {
         long t0 = System.nanoTime();

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationInterceptor.java Sun Jun  6 15:31:12 2010
@@ -32,7 +32,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.CompareOperationContext;
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
@@ -297,16 +296,6 @@ public class NormalizationInterceptor ex
     /**
      * {@inheritDoc}
      */
-    public DN getSuffix( NextInterceptor nextInterceptor, GetSuffixOperationContext opContext ) throws LdapException
-    {
-        opContext.getDn().normalize( schemaManager.getNormalizerMapping() );
-        return nextInterceptor.getSuffix( opContext );
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
     public boolean compare( NextInterceptor next, CompareOperationContext opContext ) throws LdapException
     {
         opContext.getDn().normalize( schemaManager.getNormalizerMapping() );

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=951876&r1=951875&r2=951876&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 Sun Jun  6 15:31:12 2010
@@ -50,7 +50,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.DeleteOperationContext;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.GetRootDSEOperationContext;
-import org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListOperationContext;
 import org.apache.directory.server.core.interceptor.context.ListSuffixOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
@@ -102,7 +101,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.apache.directory.shared.ldap.util.NamespaceTools;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.directory.shared.ldap.util.tree.DnBranchNode;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -258,7 +256,7 @@ public class DefaultPartitionNexus exten
                     }
                     catch ( Exception e )
                     {
-                        LOG.warn( "Failed to destroy a partition: " + partition.getSuffixDn(), e );
+                        LOG.warn( "Failed to destroy a partition: " + partition.getSuffix(), e );
                     }
                     finally
                     {
@@ -323,7 +321,7 @@ public class DefaultPartitionNexus exten
             system.add( addOperationContext );
         }
 
-        String key = system.getSuffixDn().getName();
+        String key = system.getSuffix().getName();
 
         if ( partitions.containsKey( key ) )
         {
@@ -333,18 +331,18 @@ public class DefaultPartitionNexus exten
         synchronized ( partitionLookupTree )
         {
             partitions.put( key, system );
-            partitionLookupTree.add( system.getSuffixDn(), system );
+            partitionLookupTree.add( system.getSuffix(), system );
             EntryAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
 
             if ( namingContexts == null )
             {
                 namingContexts = new DefaultEntryAttribute( schemaManager
-                    .lookupAttributeTypeRegistry( SchemaConstants.NAMING_CONTEXTS_AT ), system.getSuffixDn().getName() );
+                    .lookupAttributeTypeRegistry( SchemaConstants.NAMING_CONTEXTS_AT ), system.getSuffix().getName() );
                 rootDSE.put( namingContexts );
             }
             else
             {
-                namingContexts.add( system.getSuffixDn().getName() );
+                namingContexts.add( system.getSuffix().getName() );
             }
         }
 
@@ -420,27 +418,9 @@ public class DefaultPartitionNexus exten
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.PartitionNexus#getSuffixDn()
-     */
-    public DN getSuffixDn()
-    {
-        return DN.EMPTY_DN;
-    }
-
-
-    /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.PartitionNexus#getSuffix()
-     */
-    public String getSuffix()
-    {
-        return StringTools.EMPTY;
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.server.core.partition.PartitionNexus#setSuffix(java.lang.String)
      */
-    public void setSuffix( String suffix )
+    public void setSuffix( DN suffix )
     {
         throw new UnsupportedOperationException();
     }
@@ -480,7 +460,7 @@ public class DefaultPartitionNexus exten
                 timeStampAt.add( DateUtils.getGeneralizedTime() );
 
                 ModifyOperationContext csnModContext = new ModifyOperationContext( directoryService.getAdminSession(),
-                    system.getSuffixDn(), mods );
+                    system.getSuffix(), mods );
                 system.modify( csnModContext );
             }
         }
@@ -875,7 +855,7 @@ public class DefaultPartitionNexus exten
                 List<EntryFilteringCursor> cursors = new ArrayList<EntryFilteringCursor>();
                 for ( Partition p : partitions.values() )
                 {
-                    opContext.setDn( p.getSuffixDn() );
+                    opContext.setDn( p.getSuffix() );
                     opContext.setScope( SearchScope.OBJECT );
                     cursors.add( p.search( opContext ) );
                 }
@@ -888,7 +868,7 @@ public class DefaultPartitionNexus exten
                 for ( Partition p : partitions.values() )
                 {
                     ClonedServerEntry entry = p.lookup( new LookupOperationContext( directoryService.getAdminSession(),
-                        p.getSuffixDn() ) );
+                        p.getSuffix() ) );
                     if ( entry != null )
                     {
                         Partition backend = getPartition( entry.getDn() );
@@ -940,7 +920,7 @@ public class DefaultPartitionNexus exten
     public synchronized void addContextPartition( Partition partition ) throws LdapException
     {
         // Turn on default indices
-        String key = partition.getSuffixDn().getNormName();
+        String key = partition.getSuffix().getNormName();
 
         if ( partitions.containsKey( key ) )
         {
@@ -954,7 +934,7 @@ public class DefaultPartitionNexus exten
 
         synchronized ( partitionLookupTree )
         {
-            DN partitionSuffix = partition.getSuffixDn();
+            DN partitionSuffix = partition.getSuffix();
 
             if ( partitionSuffix == null )
             {
@@ -962,7 +942,7 @@ public class DefaultPartitionNexus exten
             }
 
             partitions.put( partitionSuffix.getNormName(), partition );
-            partitionLookupTree.add( partition.getSuffixDn(), partition );
+            partitionLookupTree.add( partition.getSuffix(), partition );
 
             EntryAttribute namingContexts = rootDSE.get( SchemaConstants.NAMING_CONTEXTS_AT );
 
@@ -999,7 +979,7 @@ public class DefaultPartitionNexus exten
             throw new LdapNoSuchObjectException( msg );
         }
 
-        String partitionSuffix = partition.getSuffixDn().getName();
+        String partitionSuffix = partition.getSuffix().getName();
 
         // Retrieve the namingContexts from the RootDSE : the partition
         // suffix must be present in those namingContexts
@@ -1064,10 +1044,17 @@ public class DefaultPartitionNexus exten
     /* (non-Javadoc)
      * @see org.apache.directory.server.core.partition.PartitionNexus#getSuffix(org.apache.directory.server.core.interceptor.context.GetSuffixOperationContext)
      */
-    public DN getSuffix( GetSuffixOperationContext getSuffixContext ) throws LdapException
+    public DN findSuffix( DN dn ) throws LdapException
+    {
+        Partition backend = getPartition( dn );
+        
+        return backend.getSuffix();
+    }
+    
+    
+    public DN getSuffix()
     {
-        Partition backend = getPartition( getSuffixContext.getDn() );
-        return backend.getSuffixDn();
+        return null;
     }
 
 
@@ -1139,10 +1126,10 @@ public class DefaultPartitionNexus exten
 
         if ( namingContexts != null )
         {
-            namingContexts.remove( partition.getSuffixDn().getName() );
+            namingContexts.remove( partition.getSuffix().getName() );
         }
 
-        partitions.remove( partition.getSuffixDn().getName() );
+        partitions.remove( partition.getSuffix().getName() );
     }
 
 

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Sun Jun  6 15:31:12 2010
@@ -167,12 +167,12 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
-            LOG.warn( "No LDAP server was configured under the DN {}", configPartition.getSuffixDn() );
+            LOG.warn( "No LDAP server was configured under the DN {}", configPartition.getSuffix() );
             return null;
         }
 
@@ -270,12 +270,12 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
-            LOG.warn( "No kerberos server was configured under the DN {}", configPartition.getSuffixDn() );
+            LOG.warn( "No kerberos server was configured under the DN {}", configPartition.getSuffix() );
             return null;
         }
 
@@ -417,12 +417,12 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
-            LOG.warn( "No DNS server was configured under the DN {}", configPartition.getSuffixDn() );
+            LOG.warn( "No DNS server was configured under the DN {}", configPartition.getSuffix() );
             return null;
         }
 
@@ -457,12 +457,12 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
-            LOG.warn( "No DHCP server was configured under the DN {}", configPartition.getSuffixDn() );
+            LOG.warn( "No DHCP server was configured under the DN {}", configPartition.getSuffix() );
             return null;
         }
 
@@ -492,12 +492,12 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
-            LOG.warn( "No NTP server was configured under the DN {}", configPartition.getSuffixDn() );
+            LOG.warn( "No NTP server was configured under the DN {}", configPartition.getSuffix() );
             return null;
         }
 
@@ -531,12 +531,12 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
-            LOG.warn( "No ChangePassword server was configured under the DN {}", configPartition.getSuffixDn() );
+            LOG.warn( "No ChangePassword server was configured under the DN {}", configPartition.getSuffix() );
             return null;
         }
         
@@ -635,12 +635,12 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
-            LOG.warn( "No HTTP server was configured under the DN {}", configPartition.getSuffixDn() );
+            LOG.warn( "No HTTP server was configured under the DN {}", configPartition.getSuffix() );
             return null;
         }
 
@@ -700,14 +700,14 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         if ( !cursor.next() )
         {
             // the DirectoryService is mandatory so throwing exception
             throw new Exception( "No directoryService instance was configured under the DN "
-                + configPartition.getSuffixDn() );
+                + configPartition.getSuffix() );
         }
 
         ForwardIndexEntry<Long, Entry, Long> forwardEntry = ( ForwardIndexEntry<Long, Entry, Long> ) cursor
@@ -834,7 +834,7 @@ public class ConfigPartitionReader
         SearchControls controls = new SearchControls();
         controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
 
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffixDn(),
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( configPartition.getSuffix(),
             AliasDerefMode.NEVER_DEREF_ALIASES, filter, controls );
 
         List<SyncreplConfiguration> syncReplConfigLst = new ArrayList<SyncreplConfiguration>();
@@ -1061,7 +1061,9 @@ public class ConfigPartitionReader
         partition.setId( getString( ConfigSchemaConstants.ADS_PARTITION_ID, partitionEntry ) );
         partition.setPartitionDir( new File( workDir, partition.getId() ) );
 
-        partition.setSuffix( getString( ConfigSchemaConstants.ADS_PARTITION_SUFFIX, partitionEntry ) );
+        DN systemDn = new DN( getString( ConfigSchemaConstants.ADS_PARTITION_SUFFIX, partitionEntry ) );
+        systemDn.normalize( schemaManager.getNormalizerMapping() );
+        partition.setSuffix( systemDn );
 
         EntryAttribute cacheAttr = partitionEntry.get( ConfigSchemaConstants.ADS_PARTITION_CACHE_SIZE );
 

Modified: directory/apacheds/trunk/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java (original)
+++ directory/apacheds/trunk/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java Sun Jun  6 15:31:12 2010
@@ -33,6 +33,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.schema.SchemaPartition;
 import org.apache.directory.server.ldap.LdapServer;
 import org.apache.directory.server.protocol.shared.transport.Transport;
+import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.impl.DefaultSchemaLdifExtractor;
@@ -100,7 +101,7 @@ public class ConfigPartitionReaderTest
 
         LdifPartition configPartition = new LdifPartition();
         configPartition.setId( "config" );
-        configPartition.setSuffix( "ou=config" );
+        configPartition.setSuffix( new DN( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
         configPartition.setWorkingDirectory( workingDirectory + "/config" );
         configPartition.setPartitionDir( new File( configPartition.getWorkingDirectory() ) );

Modified: directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Sun Jun  6 15:31:12 2010
@@ -76,8 +76,8 @@ public class JdbmPartition extends Abstr
         store.setId( id );
 
         // Normalize the suffix
-        suffixDn.normalize( schemaManager.getNormalizerMapping() );
-        store.setSuffixDn( suffixDn );
+        suffix.normalize( schemaManager.getNormalizerMapping() );
+        store.setSuffixDn( suffix );
         store.setPartitionDir( getPartitionDir() );
 
         for ( Index<?, Entry, Long> index : getIndexedAttributes() )

Modified: directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java (original)
+++ directory/apacheds/trunk/jdbm-partition/src/test/java/org/apache/directory/server/core/partition/tree/PartitionTreeTest.java Sun Jun  6 15:31:12 2010
@@ -53,7 +53,7 @@ public class PartitionTreeTest
         
         DN suffix = new DN( "dc=example, dc=com" );
         Partition partition = new JdbmPartition();
-        partition.setSuffix( suffix.getName() );
+        partition.setSuffix( suffix );
         
         partitionLookupTree.add( suffix, partition );
         
@@ -66,7 +66,7 @@ public class PartitionTreeTest
         assertTrue( ((DnBranchNode<Partition>)child).contains( "dc=example" ) );
 
         child = ((DnBranchNode<Partition>)child).getChild( "dc=example" );
-        assertEquals( "dc=example, dc=com", ((DnLeafNode<Partition>)child).getElement().getSuffixDn().getName() );
+        assertEquals( "dc=example, dc=com", ((DnLeafNode<Partition>)child).getElement().getSuffix().getName() );
     }
 
 
@@ -80,13 +80,13 @@ public class PartitionTreeTest
         
         DN suffix1 = new DN( "dc=example, dc=com" );
         Partition partition1 = new JdbmPartition();
-        partition1.setSuffix( suffix1.getName() );
+        partition1.setSuffix( suffix1 );
         
         partitionLookupTree.add( suffix1, partition1 );
         
         DN suffix2 = new DN( "ou=system" );
         Partition partition2 = new JdbmPartition();
-        partition2.setSuffix( suffix2.getName() );
+        partition2.setSuffix( suffix2 );
         
         partitionLookupTree.add( suffix2, partition2 );
 
@@ -97,7 +97,7 @@ public class PartitionTreeTest
         
         DnNode<Partition> child = ((DnBranchNode<Partition>)partitionLookupTree).getChild( "ou=system" );
         assertTrue( child instanceof DnLeafNode );
-        assertEquals( "ou=system", ((DnLeafNode<Partition>)child).getElement().getSuffixDn().getName() );
+        assertEquals( "ou=system", ((DnLeafNode<Partition>)child).getElement().getSuffix().getName() );
 
         child = ((DnBranchNode<Partition>)partitionLookupTree).getChild( "dc=com" );
         assertTrue( child instanceof DnBranchNode );
@@ -105,7 +105,7 @@ public class PartitionTreeTest
         
         child = ((DnBranchNode<Partition>)child).getChild( "dc=example" );
         assertTrue( child instanceof DnLeafNode );
-        assertEquals( "dc=example, dc=com", ((DnLeafNode<Partition>)child).getElement().getSuffixDn().getName() );
+        assertEquals( "dc=example, dc=com", ((DnLeafNode<Partition>)child).getElement().getSuffix().getName() );
     }
 
 
@@ -119,13 +119,13 @@ public class PartitionTreeTest
         
         DN suffix1 = new DN( "dc=com" );
         Partition partition1 = new JdbmPartition();
-        partition1.setSuffix( suffix1.getName() );
+        partition1.setSuffix( suffix1 );
         
         partitionLookupTree.add( suffix1, partition1 );
         
         DN suffix2 = new DN( "dc=example, dc=com" );
         Partition partition2 = new JdbmPartition();
-        partition2.setSuffix( suffix2.getName() );
+        partition2.setSuffix( suffix2 );
         
         try
         {
@@ -149,13 +149,13 @@ public class PartitionTreeTest
         
         DN suffix1 = new DN( "dc=example1, dc=com" );
         Partition partition1 = new JdbmPartition();
-        partition1.setSuffix( suffix1.getName() );
+        partition1.setSuffix( suffix1 );
         
         partitionLookupTree.add( suffix1, partition1 );
         
         DN suffix2 = new DN( "dc=example2, dc=com" );
         Partition partition2 = new JdbmPartition();
-        partition2.setSuffix( suffix2.getName() );
+        partition2.setSuffix( suffix2 );
         
         partitionLookupTree.add( suffix2, partition2 );
 
@@ -174,10 +174,10 @@ public class PartitionTreeTest
         
         DnNode<Partition> child1 = ((DnBranchNode<Partition>)child).getChild( "dc=example1" );
         assertTrue( child1 instanceof DnLeafNode );
-        assertEquals( "dc=example1, dc=com", ((DnLeafNode<Partition>)child1).getElement().getSuffixDn().getName() );
+        assertEquals( "dc=example1, dc=com", ((DnLeafNode<Partition>)child1).getElement().getSuffix().getName() );
 
         DnNode<Partition> child2 = ((DnBranchNode<Partition>)child).getChild( "dc=example1" );
         assertTrue( child2 instanceof DnLeafNode );
-        assertEquals( "dc=example1, dc=com", ((DnLeafNode<Partition>)child2).getElement().getSuffixDn().getName() );
+        assertEquals( "dc=example1, dc=com", ((DnLeafNode<Partition>)child2).getElement().getSuffix().getName() );
     }
 }

Modified: directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Sun Jun  6 15:31:12 2010
@@ -156,7 +156,7 @@ public class LdifPartition extends BTree
     {
         // Initialize the AvlPartition
         wrappedPartition.setId( id );
-        wrappedPartition.setSuffix( suffixDn.getName() );
+        wrappedPartition.setSuffix( suffix );
         wrappedPartition.setSchemaManager( schemaManager );
         wrappedPartition.initialize();
 
@@ -170,19 +170,19 @@ public class LdifPartition extends BTree
 
         // Initialize the suffixDirectory : it's a composition
         // of the workingDirectory followed by the suffix
-        if ( ( suffixDn == null ) || ( suffixDn.isEmpty() ) )
+        if ( ( suffix == null ) || ( suffix.isEmpty() ) )
         {
             String msg = I18n.err( I18n.ERR_150 );
             LOG.error( msg );
             throw new LdapInvalidDnException( msg );
         }
 
-        if ( !suffixDn.isNormalized() )
+        if ( !suffix.isNormalized() )
         {
-            suffixDn.normalize( schemaManager.getNormalizerMapping() );
+            suffix.normalize( schemaManager.getNormalizerMapping() );
         }
 
-        String suffixDirName = getFileName( suffixDn );
+        String suffixDirName = getFileName( suffix );
         suffixDirectory = new File( workingDirectory, suffixDirName );
 
         // Create the context entry now, if it does not exists, or load the
@@ -529,7 +529,7 @@ public class LdifPartition extends BTree
         StringBuilder filePath = new StringBuilder();
         filePath.append( suffixDirectory ).append( File.separator );
 
-        DN baseDn = ( DN ) entryDn.getSuffix( suffixDn.size() );
+        DN baseDn = ( DN ) entryDn.getSuffix( suffix.size() );
 
         for ( int i = 0; i < baseDn.size() - 1; i++ )
         {
@@ -542,7 +542,7 @@ public class LdifPartition extends BTree
         
         String parentDir = null;
         
-        if( entryDn.equals( suffixDn ) )
+        if( entryDn.equals( suffix ) )
         {
             parentDir = suffixDirectory.getParent() + File.separator;
         }
@@ -993,7 +993,7 @@ public class LdifPartition extends BTree
 
 
     @Override
-    public void setSuffix( String suffix ) throws LdapInvalidDnException
+    public void setSuffix( DN suffix ) throws LdapInvalidDnException
     {
         super.setSuffix( suffix );
         wrappedPartition.setSuffix( suffix );

Modified: directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java (original)
+++ directory/apacheds/trunk/ldif-partition/src/test/java/org/apache/directory/server/core/partition/LdifPartitionTest.java Sun Jun  6 15:31:12 2010
@@ -141,7 +141,7 @@ public class LdifPartitionTest
         // initialize the partition
         partition = new LdifPartition();
         partition.setId( "test-ldif" );
-        partition.setSuffix( "ou=test,ou=system" );
+        partition.setSuffix( new DN( "ou=test,ou=system" ) );
         partition.setSchemaManager( schemaManager );
         partition.setWorkingDirectory( wkdir.getAbsolutePath() );
         

Modified: directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java?rev=951876&r1=951875&r2=951876&view=diff
==============================================================================
--- directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java (original)
+++ directory/apacheds/trunk/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java Sun Jun  6 15:31:12 2010
@@ -151,12 +151,12 @@ public class DirectoryServiceAnnotationT
             if ( "example".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "dc=example,dc=com", partition.getSuffixDn().getName() );
+                assertEquals( "dc=example,dc=com", partition.getSuffix().getName() );
             }
             else if ( "schema".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "ou=schema", partition.getSuffixDn().getName() );
+                assertEquals( "ou=schema", partition.getSuffix().getName() );
             }
         }
         
@@ -218,12 +218,12 @@ public class DirectoryServiceAnnotationT
             if ( "example".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "dc=example,dc=com", partition.getSuffixDn().getName() );
+                assertEquals( "dc=example,dc=com", partition.getSuffix().getName() );
             }
             else if ( "schema".equalsIgnoreCase( partition.getId() ) )
             {
                 assertTrue( partition.isInitialized() );
-                assertEquals( "ou=schema", partition.getSuffixDn().getName() );
+                assertEquals( "ou=schema", partition.getSuffix().getName() );
             }
         }
         



Mime
View raw message