You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/10/30 16:35:58 UTC

svn commit: r1029084 [2/2] - in /directory/apacheds/trunk: all/ core-annotations/ core-annotations/src/main/java/org/apache/directory/server/core/factory/ core-annotations/src/test/java/org/apache/directory/server/core/factory/ core-api/ core-api/src/m...

Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java (original)
+++ directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java Sat Oct 30 14:35:55 2010
@@ -134,7 +134,7 @@ public class ApacheDS
             {
                 if( p instanceof BTreePartition )
                 {
-                    ( ( BTreePartition ) p ).setPartitionDir( new File( directoryService.getWorkingDirectory(), p.getId() ) );
+                    ( ( BTreePartition ) p ).setPartitionDir( new File( directoryService.getInstanceLayout().getPartitionsDirectory(), p.getId() ) );
                 }
                 
                 if( p.getSchemaManager() == null )
@@ -148,7 +148,7 @@ public class ApacheDS
             
             if( sysPartition instanceof BTreePartition )
             {
-                ( ( BTreePartition ) sysPartition ).setPartitionDir( new File( directoryService.getWorkingDirectory(), sysPartition.getId() ) );
+                ( ( BTreePartition ) sysPartition ).setPartitionDir( new File( directoryService.getInstanceLayout().getPartitionsDirectory(), sysPartition.getId() ) );
             }
 
             if( sysPartition.getSchemaManager() == null )
@@ -476,7 +476,7 @@ public class ApacheDS
 
         // Init the LdifPartition
         LdifPartition ldifPartition = new LdifPartition();
-        String workingDirectory = directoryService.getWorkingDirectory().getPath();
+        String workingDirectory = directoryService.getInstanceLayout().getPartitionsDirectory().getPath();
         ldifPartition.setWorkingDirectory( workingDirectory + "/schema" );
 
         // Extract the schema on disk (a brand new one) and load the registries

Propchange: directory/apacheds/trunk/server-replication/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:35:55 2010
@@ -1,2 +1,3 @@
 /directory/apacheds/branches/apacheds-codec-merge/server-replication:982369-987590
+/directory/apacheds/branches/apacheds-config/server-replication:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-replication:980138-980937

Propchange: directory/apacheds/trunk/server-tools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:35:55 2010
@@ -1,2 +1,3 @@
 /directory/apacheds/branches/apacheds-codec-merge/server-tools:982369-987590
+/directory/apacheds/branches/apacheds-config/server-tools:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-tools:980138-980937

Propchange: directory/apacheds/trunk/service/
            ('svn:mergeinfo' removed)

Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java (original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/ApacheDsService.java Sat Oct 30 14:35:55 2010
@@ -29,10 +29,19 @@ import java.util.Map;
 import java.util.UUID;
 
 import org.apache.directory.server.changepw.ChangePasswordServer;
+import org.apache.directory.server.config.ConfigBuilder;
 import org.apache.directory.server.config.ConfigPartitionReader;
 import org.apache.directory.server.config.LdifConfigExtractor;
+import org.apache.directory.server.config.beans.ChangePasswordServerBean;
+import org.apache.directory.server.config.beans.ConfigBean;
+import org.apache.directory.server.config.beans.DirectoryServiceBean;
+import org.apache.directory.server.config.beans.HttpServerBean;
+import org.apache.directory.server.config.beans.KdcServerBean;
+import org.apache.directory.server.config.beans.LdapServerBean;
+import org.apache.directory.server.config.beans.NtpServerBean;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.InstanceLayout;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
@@ -107,7 +116,7 @@ public class ApacheDsService
     private SingleFileLdifPartition configPartition;
 
     private ConfigPartitionReader cpReader;
-
+    
     // variables used during the initial startup to update the mandatory operational
     // attributes
     private UuidSyntaxChecker uuidChecker = new UuidSyntaxChecker();
@@ -133,6 +142,7 @@ public class ApacheDsService
     public void start( InstanceLayout instanceLayout ) throws Exception
     {
         File partitionsDir = instanceLayout.getPartitionsDirectory();
+        
         if ( !partitionsDir.exists() )
         {
             LOG.info( "partition directory doesn't exist, creating {}", partitionsDir.getAbsolutePath() );
@@ -140,31 +150,40 @@ public class ApacheDsService
         }
 
         LOG.info( "using partition dir {}", partitionsDir.getAbsolutePath() );
+        
         initSchemaLdifPartition( instanceLayout );
         initConfigPartition( instanceLayout );
 
+        // Read the configuration
         cpReader = new ConfigPartitionReader( configPartition, partitionsDir );
+        
+        ConfigBean configBean = cpReader.readConfig( "ou=config" );
+        
+        DirectoryServiceBean directoryServiceBean = configBean.getDirectoryServiceBean();
+        
+        // Initialize the DirectoryService now
+        DirectoryService directoryService = initDirectoryService( instanceLayout, directoryServiceBean );
 
         // start the LDAP server
-        startLdap( instanceLayout );
+        startLdap( directoryServiceBean.getLdapServerBean(), directoryService );
 
         // start the NTP server
-        startNtp();
+        startNtp( directoryServiceBean.getNtpServerBean(), directoryService );
 
         // Initialize the DNS server (Not ready yet)
-        // initDns( layout );
+        // initDns( configBean );
 
         // Initialize the DHCP server (Not ready yet)
-        // initDhcp( layout );
+        // initDhcp( configBean );
 
         // start the ChangePwd server (Not ready yet)
-        startChangePwd();
+        startChangePwd( directoryServiceBean.getChangePasswordServerBean(), directoryService );
 
         // start the Kerberos server
-        startKerberos();
+        startKerberos( directoryServiceBean.getKdcServerBean(), directoryService );
 
         // start the jetty http server
-        startHttpServer();
+        //startHttpServer( directoryServiceBean.getHttpServerBean(), directoryService );
     }
 
 
@@ -228,7 +247,7 @@ public class ApacheDsService
         }
         else
         {
-            LdifConfigExtractor.extractSingleFileConfig( instanceLayout.getConfDirectory(), true );
+            LdifConfigExtractor.extractSingleFileConfig( instanceLayout.getConfDirectory(), LdifConfigExtractor.LDIF_CONFIG_FILE, true );
             isConfigPartitionFirstExtraction = true;
         }
 
@@ -240,20 +259,15 @@ public class ApacheDsService
 
         configPartition.initialize();
     }
-
-
-    /**
-     * start the LDAP server
-     */
-    private void startLdap( InstanceLayout instanceLayout ) throws Exception
+    
+    
+    private DirectoryService initDirectoryService( InstanceLayout instanceLayout, DirectoryServiceBean directoryServiceBean ) throws Exception
     {
-        LOG.info( "Starting the LDAP server" );
-
-        printBanner( BANNER_LDAP );
+        LOG.info( "Initializing the DirectoryService..." );
+        
         long startTime = System.currentTimeMillis();
 
-        DirectoryService directoryService = cpReader.createDirectoryService();
-        directoryService.setSchemaManager( schemaManager );
+        DirectoryService directoryService = ConfigBuilder.createDirectoryService( directoryServiceBean, instanceLayout, schemaManager );
 
         SchemaPartition schemaPartition = directoryService.getSchemaService().getSchemaPartition();
         schemaPartition.setWrappedPartition( schemaLdifPartition );
@@ -261,10 +275,8 @@ public class ApacheDsService
 
         directoryService.addPartition( configPartition );
 
-        directoryService.setWorkingDirectory( instanceLayout.getInstanceDirectory() );
-
-        ldapServer = cpReader.createLdapServer();
-        ldapServer.setDirectoryService( directoryService );
+        // Store the default directories
+        directoryService.setInstanceLayout( instanceLayout );
 
         directoryService.startup();
 
@@ -308,6 +320,26 @@ public class ApacheDsService
             LOG.info( "schema partition data was successfully updated" );
         }
 
+        LOG.info( "DirectoryService initialized in {} milliseconds", ( System.currentTimeMillis() - startTime ) );
+        
+        return directoryService;
+    }
+
+
+    /**
+     * start the LDAP server
+     */
+    private void startLdap( LdapServerBean ldapServerBean, DirectoryService directoryService ) throws Exception
+    {
+        LOG.info( "Starting the LDAP server" );
+        long startTime = System.currentTimeMillis();
+
+        printBanner( BANNER_LDAP );
+
+        ldapServer = ConfigBuilder.createLdapServer( ldapServerBean, directoryService );
+        
+        ldapServer.setDirectoryService( directoryService );
+
         // And start the server now
         try
         {
@@ -318,34 +350,29 @@ public class ApacheDsService
             LOG.error( "Cannot start the server : " + e.getMessage() );
         }
 
-        if ( LOG.isInfoEnabled() )
-        {
-            LOG.info( "LDAP server: started in {} milliseconds", ( System.currentTimeMillis() - startTime ) + "" );
-        }
+        LOG.info( "LDAP server: started in {} milliseconds", ( System.currentTimeMillis() - startTime ) + "" );
     }
 
 
     /**
      * start the NTP server
      */
-    private void startNtp() throws Exception
+    private void startNtp( NtpServerBean ntpServerBean, DirectoryService directoryService ) throws Exception
     {
-        ntpServer = cpReader.createNtpServer();
+        LOG.info( "Starting the NTP server" );
+        long startTime = System.currentTimeMillis();
+
+        ntpServer = ConfigBuilder.createNtpServer( ntpServerBean, directoryService);
+        
         if ( ntpServer == null )
         {
-            LOG
-                .info( "Cannot find any reference to the NTP Server in the configuration : the server won't be started" );
+            LOG.info( "Cannot find any reference to the NTP Server in the configuration : the server won't be started" );
             return;
         }
 
-        System.out.println( "Starting the NTP server" );
-        LOG.info( "Starting the NTP server" );
-
         printBanner( BANNER_NTP );
-        long startTime = System.currentTimeMillis();
 
         ntpServer.start();
-        System.out.println( "NTP Server started" );
 
         if ( LOG.isInfoEnabled() )
         {
@@ -392,29 +419,26 @@ public class ApacheDsService
     /**
      * start the KERBEROS server
      */
-    private void startKerberos() throws Exception
+    private void startKerberos( KdcServerBean kdcServerBean, DirectoryService directoryService ) throws Exception
     {
-        kdcServer = cpReader.createKdcServer();
+        LOG.info( "Starting the Kerberos server" );
+        long startTime = System.currentTimeMillis();
+
+        kdcServer = ConfigBuilder.createKdcServer( kdcServerBean, directoryService );
+        
         if ( kdcServer == null )
         {
-            LOG
-                .info( "Cannot find any reference to the Kerberos Server in the configuration : the server won't be started" );
+            LOG.info( "Cannot find any reference to the Kerberos Server in the configuration : the server won't be started" );
             return;
         }
 
         getDirectoryService().startup();
         kdcServer.setDirectoryService( getDirectoryService() );
 
-        System.out.println( "Starting the Kerberos server" );
-        LOG.info( "Starting the Kerberos server" );
-
         printBanner( BANNER_KERBEROS );
-        long startTime = System.currentTimeMillis();
 
         kdcServer.start();
 
-        System.out.println( "Kerberos server started" );
-
         if ( LOG.isInfoEnabled() )
         {
             LOG.info( "Kerberos server: started in {} milliseconds", ( System.currentTimeMillis() - startTime ) + "" );
@@ -425,29 +449,28 @@ public class ApacheDsService
     /**
      * start the Change Password server
      */
-    private void startChangePwd() throws Exception
+    private void startChangePwd( ChangePasswordServerBean changePwdServerBean, DirectoryService directoryService ) throws Exception
     {
-
-        changePwdServer = cpReader.createChangePwdServer();
+        changePwdServer = ConfigBuilder.createChangePasswordServer( changePwdServerBean, directoryService );
+        
         if ( changePwdServer == null )
         {
-            LOG
-                .info( "Cannot find any reference to the Change Password Server in the configuration : the server won't be started" );
+            LOG.info( "Cannot find any reference to the Change Password Server in the configuration : the server won't be started" );
             return;
         }
 
+        LOG.info( "Starting the Change Password server" );
+        long startTime = System.currentTimeMillis();
+
         getDirectoryService().startup();
         changePwdServer.setDirectoryService( getDirectoryService() );
 
-        System.out.println( "Starting the Change Password server" );
         LOG.info( "Starting the Change Password server" );
 
         printBanner( BANNER_CHANGE_PWD );
-        long startTime = System.currentTimeMillis();
 
         changePwdServer.start();
 
-        System.out.println( "Change Password server started" );
         if ( LOG.isInfoEnabled() )
         {
             LOG.info( "Change Password server: started in {} milliseconds", ( System.currentTimeMillis() - startTime )
@@ -459,19 +482,25 @@ public class ApacheDsService
     /**
      * start the embedded HTTP server
      */
-    private void startHttpServer() throws Exception
+    private void startHttpServer( HttpServerBean httpServerBean, DirectoryService directoryService ) throws Exception
     {
-        httpServer = cpReader.createHttpServer();
+        httpServer = ConfigBuilder.createHttpServer( httpServerBean, directoryService);
+        
         if ( httpServer == null )
         {
-            LOG
-                .info( "Cannot find any reference to the HTTP Server in the configuration : the server won't be started" );
+            LOG.info( "Cannot find any reference to the HTTP Server in the configuration : the server won't be started" );
             return;
         }
 
-        if ( httpServer != null )
+        LOG.info( "Starting the Http server" );
+        long startTime = System.currentTimeMillis();
+
+        httpServer.start( getDirectoryService() );
+
+        if ( LOG.isInfoEnabled() )
         {
-            httpServer.start( getDirectoryService() );
+            LOG.info( "Http server: started in {} milliseconds", ( System.currentTimeMillis() - startTime )
+                + "" );
         }
     }
 

Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/InstallationLayout.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/InstallationLayout.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/InstallationLayout.java (original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/InstallationLayout.java Sat Oct 30 14:35:55 2010
@@ -23,6 +23,8 @@ package org.apache.directory.server;
 
 import java.io.File;
 
+import org.apache.directory.server.core.AbstractLayout;
+
 
 /**
  * Convenience class to encapsulate paths to various directories and files within

Modified: directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java (original)
+++ directory/apacheds/trunk/service/src/main/java/org/apache/directory/server/UberjarMain.java Sat Oct 30 14:35:55 2010
@@ -20,6 +20,7 @@
 package org.apache.directory.server;
 
 
+import org.apache.directory.server.core.InstanceLayout;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,12 +59,14 @@ public class UberjarMain
             }
             catch ( Exception e )
             {
+                e.printStackTrace();
                 LOG.error( "Failed to start the service.", e );
                 System.exit( 1 );
             }
         }
         else
         {
+            // TODO default to the current directory.
             throw new IllegalArgumentException(
                 "Program must be launched with 1 arguement, the path to the instance directory." );
         }

Propchange: directory/apacheds/trunk/test-framework/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:35:55 2010
@@ -1,4 +1,5 @@
 /directory/apacheds/branches/apacheds-codec-merge/test-framework:982369-987590
+/directory/apacheds/branches/apacheds-config/test-framework:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/test-framework:980138-980938
 /directory/apacheds/branches/apacheds-replication/apacheds-test-framework:749790-764110
 /directory/apacheds/branches/apacheds-replication/test-framework:749790-764110

Modified: directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java (original)
+++ directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java Sat Oct 30 14:35:55 2010
@@ -252,7 +252,7 @@ public class FrameworkRunner extends Blo
             {
                 LOG.debug( "Shuting down DS for {}", classDS.getInstanceId() );
                 classDS.shutdown();
-                FileUtils.deleteDirectory( classDS.getWorkingDirectory() );
+                FileUtils.deleteDirectory( classDS.getInstanceLayout().getInstanceDirectory() );
             }
             else
             {
@@ -407,7 +407,7 @@ public class FrameworkRunner extends Blo
             {
                 LOG.debug( "Shuting down DS for {}", methodDS.getInstanceId() );
                 methodDS.shutdown();
-                FileUtils.deleteDirectory( methodDS.getWorkingDirectory() );
+                FileUtils.deleteDirectory( methodDS.getInstanceLayout().getInstanceDirectory() );
             }
             else
             {

Modified: directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java (original)
+++ directory/apacheds/trunk/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java Sat Oct 30 14:35:55 2010
@@ -97,7 +97,7 @@ public class FrameworkSuite extends Suit
             {
                 LOG.debug( "Shuting down DS for {}", directoryService.getInstanceId() );
                 directoryService.shutdown();
-                FileUtils.deleteDirectory( directoryService.getWorkingDirectory() );
+                FileUtils.deleteDirectory( directoryService.getInstanceLayout().getInstanceDirectory() );
             }
             catch ( Exception e )
             {

Propchange: directory/apacheds/trunk/wrapper/
            ('svn:mergeinfo' removed)

Modified: directory/apacheds/trunk/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java (original)
+++ directory/apacheds/trunk/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java Sat Oct 30 14:35:55 2010
@@ -21,6 +21,7 @@
 package org.apache.directory.server;
 
 
+import org.apache.directory.server.core.InstanceLayout;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.tanukisoftware.wrapper.WrapperListener;

Propchange: directory/apacheds/trunk/xdbm-partition/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:35:55 2010
@@ -1,2 +1,3 @@
 /directory/apacheds/branches/apacheds-codec-merge/xdbm-partition:982369-987590
+/directory/apacheds/branches/apacheds-config/xdbm-partition:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-partition:980138-980938

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Sat Oct 30 14:35:55 2010
@@ -82,9 +82,6 @@ public abstract class BTreePartition<ID>
     protected DN suffix;
     private File partitionDir;
 
-    /** The rootDSE context */
-    protected Entry contextEntry;
-    
     /** The set of indexed attributes */
     private Set<Index<? extends Object, Entry, ID>> indexedAttributes;
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Sat Oct 30 14:35:55 2010
@@ -303,52 +303,72 @@ public abstract class AbstractStore<E, I
         // add missing system indices
         if ( getPresenceIndex() == null )
         {
-            addIndex( new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID ) ;
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getOneLevelIndex() == null )
         {
-            addIndex( new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getSubLevelIndex() == null )
         {
-            addIndex( new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getRdnIndex() == null )
         {
-            addIndex( new GenericIndex<ParentIdAndRdn<ID>, E, ID>( ApacheSchemaConstants.APACHE_RDN_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<ParentIdAndRdn<ID>, E, ID>( ApacheSchemaConstants.APACHE_RDN_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getAliasIndex() == null )
         {
-            addIndex( new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<String, E, ID>( ApacheSchemaConstants.APACHE_ALIAS_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getOneAliasIndex() == null )
         {
-            addIndex( new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getSubAliasIndex() == null )
         {
-            addIndex( new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<ID, E, ID>( ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getObjectClassIndex() == null )
         {
-            addIndex( new GenericIndex<String, E, ID>( SchemaConstants.OBJECT_CLASS_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.OBJECT_CLASS_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getEntryUuidIndex() == null )
         {
-            addIndex( new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_UUID_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_UUID_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         if ( getEntryCsnIndex() == null )
         {
-            addIndex( new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_CSN_AT_OID ) );
+            Index<?, E, ID> index = new GenericIndex<String, E, ID>( SchemaConstants.ENTRY_CSN_AT_OID );
+            index.setWkDirPath( partitionDir );
+            addIndex( index );
         }
 
         // convert and initialize system indices
@@ -887,6 +907,12 @@ public abstract class AbstractStore<E, I
         {
             parentDn = entryDn.getParent();
             parentId = getEntryId( parentDn );
+            
+            if ( parentId == null )
+            {
+                parentId = getEntryId( parentDn );
+            }
+            
             key = new ParentIdAndRdn<ID>( parentId, entryDn.getRdn() );
         }
 

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java?rev=1029084&r1=1029083&r2=1029084&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java (original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/Index.java Sat Oct 30 14:35:55 2010
@@ -141,7 +141,7 @@ public interface Index<K, O, ID>
 
 
     /**
-     * Gets the scan count for the occurance of a specific attribute value 
+     * Gets the scan count for the occurence of a specific attribute value 
      * within the index.
      *
      * @param attrVal the value of the attribute to get a scan count for

Propchange: directory/apacheds/trunk/xdbm-tools/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 14:35:55 2010
@@ -1,2 +1,3 @@
 /directory/apacheds/branches/apacheds-codec-merge/xdbm-tools:982369-987590
+/directory/apacheds/branches/apacheds-config/xdbm-tools:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/xdbm-tools:980138-980938