directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1028548 - in /directory: apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/ apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/ ...
Date Thu, 28 Oct 2010 23:42:48 GMT
Author: elecharny
Date: Thu Oct 28 23:42:46 2010
New Revision: 1028548

URL: http://svn.apache.org/viewvc?rev=1028548&view=rev
Log:
o Using the InstanceLaout in all the areas we were using the workingDirectory before
o Added the InstanceLayout into the DirectoryService with setter/getter
o Made the index correctly being created in the right place with the right name
o Fixed the config.ldif file
o Removed a duplicated AT

Removed:
    directory/shared/branches/shared-config/ldap-schema/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.307.ldif
Modified:
    directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
    directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
    directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java
    directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java
    directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
    directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
    directory/apacheds/branches/apacheds-config/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
    directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
    directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java
    directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
    directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java
    directory/apacheds/branches/apacheds-config/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java
    directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
    directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
    directory/apacheds/branches/apacheds-config/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
    directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
    directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
    directory/apacheds/branches/apacheds-config/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java
    directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
    directory/apacheds/branches/apacheds-config/server-config/src/main/resources/config.ldif
    directory/apacheds/branches/apacheds-config/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
    directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
    directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
    directory/apacheds/branches/apacheds-config/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java
    directory/apacheds/branches/apacheds-config/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java

Modified: directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java (original)
+++ directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DSAnnotationProcessor.java Thu Oct 28 23:42:46 2010
@@ -95,7 +95,7 @@ public class DSAnnotationProcessor
                 // We use the partition factory to create partition and index instances.
                 PartitionFactory partitionFactory = dsf.getPartitionFactory();
                 partition = partitionFactory.createPartition( createPartition.name(), createPartition.suffix(),
-                    createPartition.cacheSize(), new File( service.getWorkingDirectory(), createPartition.name() ) );
+                    createPartition.cacheSize(), new File( service.getInstanceLayout().getPartitionsDirectory(), createPartition.name() ) );
 
                 CreateIndex[] indexes = createPartition.indexes();
                 for ( CreateIndex createIndex : indexes )
@@ -114,7 +114,7 @@ public class DSAnnotationProcessor
                 {
                     BTreePartition<?> btreePartition = ( BTreePartition<?> ) partition;
                     btreePartition.setCacheSize( createPartition.cacheSize() );
-                    btreePartition.setPartitionDir( new File( service.getWorkingDirectory(), createPartition.name() ) );
+                    btreePartition.setPartitionDir( new File( service.getInstanceLayout().getPartitionsDirectory(), createPartition.name() ) );
 
                     // Process the indexes if any
                     CreateIndex[] indexes = createPartition.indexes();

Modified: directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java (original)
+++ directory/apacheds/branches/apacheds-config/core-annotations/src/main/java/org/apache/directory/server/core/factory/DefaultDirectoryServiceFactory.java Thu Oct 28 23:42:46 2010
@@ -26,6 +26,7 @@ import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.InstanceLayout;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.ldif.LdifPartition;
 import org.apache.directory.server.core.schema.SchemaPartition;
@@ -120,16 +121,17 @@ public class DefaultDirectoryServiceFact
     /**
      * Build the working directory
      */
-    private void buildWorkingDirectory( String name )
+    private void buildInstanceDirectory( String name )
     {
-        String workingDirectory = System.getProperty( "workingDirectory" );
+        String instanceDirectory = System.getProperty( "workingDirectory" );
 
-        if ( workingDirectory == null )
+        if ( instanceDirectory == null )
         {
-            workingDirectory = System.getProperty( "java.io.tmpdir" ) + "/server-work-" + name;
+            instanceDirectory = System.getProperty( "java.io.tmpdir" ) + "/server-work-" + name;
         }
 
-        directoryService.setWorkingDirectory( new File( workingDirectory ) );
+        InstanceLayout instanceLayout = new InstanceLayout( instanceDirectory );
+        directoryService.setInstanceLayout( instanceLayout );
     }
 
 
@@ -142,7 +144,7 @@ public class DefaultDirectoryServiceFact
 
         // 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
@@ -185,7 +187,7 @@ public class DefaultDirectoryServiceFact
 
         // Inject the System Partition
         Partition systemPartition = partitionFactory.createPartition( "system", ServerDNConstants.SYSTEM_DN, 500,
-            new File( directoryService.getWorkingDirectory(), "system" ) );
+            new File( directoryService.getInstanceLayout().getPartitionsDirectory(), "system" ) );
         systemPartition.setSchemaManager( directoryService.getSchemaManager() );
 
         partitionFactory.addIndex( systemPartition, SchemaConstants.OBJECT_CLASS_AT, 100 );
@@ -202,11 +204,11 @@ public class DefaultDirectoryServiceFact
     private void build( String name ) throws Exception
     {
         directoryService.setInstanceId( name );
-        buildWorkingDirectory( name );
+        buildInstanceDirectory( name );
 
         // Erase the working directory to be sure that we don't have some
         // remaining data from a previous run
-        String workingDirectoryPath = directoryService.getWorkingDirectory().getPath();
+        String workingDirectoryPath = directoryService.getInstanceLayout().getInstanceDirectory().getPath();
         File workingDirectory = new File( workingDirectoryPath );
 
         FileUtils.deleteDirectory( workingDirectory );

Modified: directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java (original)
+++ directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceAnnotationTest.java Thu Oct 28 23:42:46 2010
@@ -55,7 +55,7 @@ public class DirectoryServiceAnnotationT
         assertEquals( "classDS", service.getInstanceId() );
         
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
 
 
@@ -69,7 +69,7 @@ public class DirectoryServiceAnnotationT
         assertEquals( "methodDS", service.getInstanceId() );
         
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
     
     
@@ -126,7 +126,7 @@ public class DirectoryServiceAnnotationT
         }
         
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
     
     
@@ -172,7 +172,7 @@ public class DirectoryServiceAnnotationT
         }
 
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
 
 }

Modified: directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java (original)
+++ directory/apacheds/branches/apacheds-config/core-annotations/src/test/java/org/apache/directory/server/core/factory/DirectoryServiceFactoryTest.java Thu Oct 28 23:42:46 2010
@@ -50,6 +50,6 @@ public class DirectoryServiceFactoryTest
         assertTrue( service.isStarted() );
         
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
 }

Modified: directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/CacheService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/CacheService.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/CacheService.java (original)
+++ directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/CacheService.java Thu Oct 28 23:42:46 2010
@@ -65,7 +65,7 @@ public class CacheService
             return;
         }
 
-        File configFile = new File( dirService.getWorkingDirectory(), DIRECTORY_CACHESERVICE_XML );
+        File configFile = new File( dirService.getInstanceLayout().getConfDirectory(), DIRECTORY_CACHESERVICE_XML );
 
         if ( !configFile.exists() )
         {

Modified: directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-config/core-api/src/main/java/org/apache/directory/server/core/DirectoryService.java Thu Oct 28 23:42:46 2010
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core;
 
 
-import java.io.File;
 import java.util.List;
 import java.util.Set;
 
@@ -338,21 +337,18 @@ public interface DirectoryService extend
 
 
     /**
-     * Returns working directory (counterpart of <tt>var/lib</tt>) where partitions are
-     * stored by default.
+     * Returns the instance layout which contains the path for various directories
      *
-     * @return the directory where partition's are stored.
+     * @return the InstanceLayout for this directory service.
      */
-    File getWorkingDirectory();
-
+    InstanceLayout getInstanceLayout();
 
+    
     /**
-     * Sets working directory (counterpart of <tt>var/lib</tt>) where partitions are stored
-     * by default.
-     *
-     * @param workingDirectory the directory where the server's partitions are stored by default.
+     * Sets the InstanceLayout used by the DirectoryService to store the files
+     * @param instanceLayout The InstanceLayout to set
      */
-    void setWorkingDirectory( File workingDirectory );
+    void setInstanceLayout( InstanceLayout instanceLayout );
 
 
     /**

Modified: directory/apacheds/branches/apacheds-config/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-config/core-api/src/test/java/org/apache/directory/server/core/MockDirectoryService.java Thu Oct 28 23:42:46 2010
@@ -252,11 +252,6 @@ public class MockDirectoryService implem
     }
 
 
-    public void setWorkingDirectory( File workingDirectory )
-    {
-    }
-
-
     public void validate()
     {
     }
@@ -523,4 +518,15 @@ public class MockDirectoryService implem
     {
         return null;
     }
+
+
+    public InstanceLayout getInstanceLayout()
+    {
+        return null;
+    }
+
+
+    public void setInstanceLayout( InstanceLayout instanceLayout )
+    {
+    }
 }

Modified: directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java (original)
+++ directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/configuration/PartitionConfigurationIT.java Thu Oct 28 23:42:46 2010
@@ -55,7 +55,7 @@ public class PartitionConfigurationIT ex
     {
         PartitionFactory partitionFactory = DefaultDirectoryServiceFactory.DEFAULT.getPartitionFactory();
         Partition partition = partitionFactory.createPartition( "removable", "ou=removable", 100, service
-            .getWorkingDirectory() );
+            .getInstanceLayout().getPartitionsDirectory() );
 
         // Test AddContextPartition
         service.addPartition( partition );

Modified: directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java (original)
+++ directory/apacheds/branches/apacheds-config/core-integ/src/test/java/org/apache/directory/server/core/schema/AbstractMetaSchemaObjectHandler.java Thu Oct 28 23:42:46 2010
@@ -39,7 +39,7 @@ public abstract class AbstractMetaSchema
     @Before
     public final void init()
     {
-        workingDir = service.getWorkingDirectory().getAbsolutePath();
+        workingDir = service.getInstanceLayout().getInstanceDirectory().getAbsolutePath();
     }
 
 

Modified: directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Thu Oct 28 23:42:46 2010
@@ -197,8 +197,8 @@ public class DefaultDirectoryService imp
     /** The instance Id */
     private String instanceId;
 
-    /** The server working directory */
-    private File workingDirectory = new File( "server-work" );
+    /** The server directory layout*/
+    private InstanceLayout instanceLayout;
 
     /**
      * A flag used to shutdown the VM when stopping the server. Useful
@@ -495,26 +495,20 @@ public class DefaultDirectoryService imp
 
 
     /**
-     * Returns working directory (counterpart of <tt>var/lib</tt>) where partitions are
-     * stored by default.
-     *
-     * @return the directory where partition's are stored.
+     * {@inheritDoc}
      */
-    public File getWorkingDirectory()
+    public InstanceLayout getInstanceLayout()
     {
-        return workingDirectory;
+        return instanceLayout;
     }
 
 
     /**
-     * Sets working directory (counterpart of <tt>var/lib</tt>) where partitions are stored
-     * by default.
-     *
-     * @param workingDirectory the directory where the server's partitions are stored by default.
+     * {@inheritDoc}
      */
-    public void setWorkingDirectory( File workingDirectory )
+    public void setInstanceLayout( InstanceLayout instanceLayout )
     {
-        this.workingDirectory = workingDirectory;
+        this.instanceLayout = instanceLayout;
     }
 
 
@@ -1768,7 +1762,7 @@ public class DefaultDirectoryService imp
 
         try
         {
-            lockFile = new RandomAccessFile( workingDirectory.getAbsolutePath() + File.separator + LOCK_FILE_NAME, "rw" );
+            lockFile = new RandomAccessFile( new File( instanceLayout.getInstanceDirectory(), LOCK_FILE_NAME ), "rw" );
             try
             {
                 fileLock = lockFile.getChannel().tryLock( 0, 1, false );
@@ -1791,7 +1785,7 @@ public class DefaultDirectoryService imp
 
         if ( ( fileLock == null ) || ( !fileLock.isValid() ) )
         {
-            String message = "the working directory " + workingDirectory + " has been locked by another directory service.";
+            String message = "the working directory " + instanceLayout.getRunDirectory() + " has been locked by another directory service.";
             LOG.error( message );
             throw new RuntimeException( message );
         }

Modified: directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java (original)
+++ directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/changelog/MemoryChangeLogStore.java Thu Oct 28 23:42:46 2010
@@ -117,7 +117,7 @@ public class MemoryChangeLogStore implem
 
     public void init( DirectoryService service ) throws Exception
     {
-        workingDirectory = service.getWorkingDirectory();
+        workingDirectory = service.getInstanceLayout().getLogDirectory();
         loadRevision();
         loadTags();
         loadChangeLog();

Modified: directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java (original)
+++ directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/journal/DefaultJournalStore.java Thu Oct 28 23:42:46 2010
@@ -70,7 +70,7 @@ public class DefaultJournalStore impleme
     {
         if ( workingDirectory == null )
         {
-            workingDirectory = service.getWorkingDirectory();
+            workingDirectory = service.getInstanceLayout().getLogDirectory();
         }
 
         /** Load or create the journal file */

Modified: directory/apacheds/branches/apacheds-config/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java (original)
+++ directory/apacheds/branches/apacheds-config/http-integration/src/main/java/org/apache/directory/server/integration/http/HttpServer.java Thu Oct 28 23:42:46 2010
@@ -159,7 +159,7 @@ public class HttpServer
 
             // add web apps from the webapps directory inside directory service's working directory
             // the exploded or archived wars
-            File webAppDir = new File( dirService.getWorkingDirectory(), "webapps" );
+            File webAppDir = new File( dirService.getInstanceLayout().getInstanceDirectory(), "webapps" );
             
             FilenameFilter webAppFilter = new FilenameFilter()
             {

Modified: directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Thu Oct 28 23:42:46 2010
@@ -171,8 +171,7 @@ public class JdbmIndex<K, O> implements 
             this.wkDirPath = wkDirPath;
         }
 
-        File file = new File( this.wkDirPath, attribute.getOid() );
-        String path = file.getAbsolutePath();
+        String path = this.wkDirPath.getAbsolutePath();
         BaseRecordManager base = new BaseRecordManager( path );
         base.disableTransactions();
         this.recMan = new CacheRecordManager( base, new MRU( cacheSize ) );
@@ -189,7 +188,7 @@ public class JdbmIndex<K, O> implements 
         }
 
         // finally write a text file in the format <OID>-<attribute-name>.txt
-        FileWriter fw = new FileWriter( new File( this.wkDirPath.getPath(), attribute.getOid() + "-" + attribute.getName() + ".txt" ) );
+        FileWriter fw = new FileWriter( new File( this.wkDirPath + "-" + attribute.getName() + ".txt" ) );
         // write the AttributeType description
         fw.write( attribute.toString() );
         fw.close();

Modified: directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Thu Oct 28 23:42:46 2010
@@ -80,10 +80,12 @@ public class JdbmPartition extends Abstr
         for ( Index<?, Entry, Long> index : getIndexedAttributes() )
         {
             String oid = schemaManager.getAttributeTypeRegistry().getOidByName( index.getAttributeId() );
+            
             if ( !index.getAttributeId().equals( oid ) )
             {
                 index.setAttributeId( oid );
             }
+            
             store.addIndex( index );
         }
 

Modified: directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java (original)
+++ directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmRdnIndex.java Thu Oct 28 23:42:46 2010
@@ -25,6 +25,8 @@ import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
 
+import javax.naming.NamingException;
+
 import jdbm.helper.MRU;
 import jdbm.recman.BaseRecordManager;
 import jdbm.recman.CacheRecordManager;
@@ -77,12 +79,18 @@ public class JdbmRdnIndex<E> extends Jdb
             setAttributeId( attribute.getName() );
         }
 
+        File file = null;
+        
         if ( this.wkDirPath == null )
         {
             this.wkDirPath = wkDirPath;
+            file = new File( this.wkDirPath.getPath() + File.separator + attribute.getOid() );
         }
-
-        File file = new File( this.wkDirPath.getPath() + File.separator + attribute.getOid() );
+        else
+        {
+            file = this.wkDirPath;
+        }
+        
         String path = file.getAbsolutePath();
         BaseRecordManager base = new BaseRecordManager( path );
         base.disableTransactions();
@@ -100,7 +108,7 @@ public class JdbmRdnIndex<E> extends Jdb
         }
 
         // finally write a text file in the format <OID>-<attribute-name>.txt
-        FileWriter fw = new FileWriter( new File( this.wkDirPath.getPath() + File.separator + attribute.getOid() + "-" + attribute.getName() + ".txt" ) );
+        FileWriter fw = new FileWriter( new File( path + "-" + attribute.getName() + ".txt" ) );
         // write the AttributeType description
         fw.write( attribute.toString() );
         fw.close();

Modified: directory/apacheds/branches/apacheds-config/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java (original)
+++ directory/apacheds/branches/apacheds-config/jdbm-partition/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java Thu Oct 28 23:42:46 2010
@@ -65,7 +65,7 @@ public class PartitionSchemaLoaderTest
             workingDirectory.mkdirs();
         }
 
-        directoryService.setWorkingDirectory( workingDirectory );
+        directoryService.getInstanceLayout().setPartitionsDir( workingDirectory );
 
         // --------------------------------------------------------------------
         // Load the bootstrap schemas to start up the schema partition

Modified: directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java (original)
+++ directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java Thu Oct 28 23:42:46 2010
@@ -33,7 +33,6 @@ import java.util.Map;
 import java.util.Set;
 
 import org.apache.directory.ldap.client.api.ConnectionClosedEventListener;
-import org.apache.directory.ldap.client.api.NoVerificationTrustManager;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.directory.ldap.client.api.future.SearchFuture;
 import org.apache.directory.server.core.CoreSession;
@@ -180,7 +179,7 @@ public class SyncReplConsumer implements
 
         if ( config.isStoreCookieInFile() )
         {
-            File cookieDir = new File( directoryservice.getWorkingDirectory(), "cookies" );
+            File cookieDir = new File( directoryservice.getInstanceLayout().getRunDirectory(), "cookies" );
             cookieDir.mkdir();
 
             cookieFile = new File( cookieDir, String.valueOf( config.getReplicaId() ) );

Modified: directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java (original)
+++ directory/apacheds/branches/apacheds-config/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java Thu Oct 28 23:42:46 2010
@@ -145,7 +145,7 @@ public class SyncReplProvider implements
             this.ldapServer = server;
             this.dirService = server.getDirectoryService();
 
-            File workDir = dirService.getWorkingDirectory();
+            File workDir = dirService.getInstanceLayout().getLogDirectory();
             syncReplData = new File( workDir, "syncrepl-data" );
             if ( !syncReplData.exists() )
             {

Modified: directory/apacheds/branches/apacheds-config/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java (original)
+++ directory/apacheds/branches/apacheds-config/server-annotations/src/test/java/org/apache/directory/server/factory/DirectoryServiceAnnotationTest.java Thu Oct 28 23:42:46 2010
@@ -91,7 +91,7 @@ public class DirectoryServiceAnnotationT
         assertEquals( "classDS", service.getInstanceId() );
         
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
 
 
@@ -105,7 +105,7 @@ public class DirectoryServiceAnnotationT
         assertEquals( "methodDS", service.getInstanceId() );
         
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
     
     
@@ -163,7 +163,7 @@ public class DirectoryServiceAnnotationT
         assertTrue( service.getAdminSession().exists( new DN( "dc=example,dc=com" ) ) );
 
         service.shutdown();
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
     
     
@@ -261,7 +261,7 @@ public class DirectoryServiceAnnotationT
         ldapServer.stop();
         service.shutdown();
         
-        FileUtils.deleteDirectory( service.getWorkingDirectory() );
+        FileUtils.deleteDirectory( service.getInstanceLayout().getInstanceDirectory() );
     }
 
 }

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java (original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java Thu Oct 28 23:42:46 2010
@@ -55,6 +55,7 @@ import org.apache.directory.server.confi
 import org.apache.directory.server.config.beans.UdpTransportBean;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.InstanceLayout;
 import org.apache.directory.server.core.authn.AuthenticationInterceptor;
 import org.apache.directory.server.core.authn.PasswordPolicyConfiguration;
 import org.apache.directory.server.core.changelog.ChangeLog;
@@ -88,6 +89,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.ldif.LdapLdifException;
 import org.apache.directory.shared.ldap.ldif.LdifEntry;
 import org.apache.directory.shared.ldap.ldif.LdifReader;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -841,22 +844,43 @@ public class ConfigBuilder
      * @return An JdbmIndex instance
      * @throws Exception If the instance cannot be created
      */
-    public static JdbmIndex<?, Entry> createJdbmIndex( JdbmPartition partition, JdbmIndexBean<String, Entry> jdbmIndexBean )
+    public static JdbmIndex<?, Entry> createJdbmIndex( JdbmPartition partition, JdbmIndexBean<String, Entry> jdbmIndexBean, DirectoryService directoryService )
     {
         JdbmIndex<String, Entry> index = new JdbmIndex<String, Entry>();
         
         index.setAttributeId( jdbmIndexBean.getIndexAttributeId() );
         index.setCacheSize( jdbmIndexBean.getIndexCacheSize() );
         index.setNumDupLimit( jdbmIndexBean.getIndexNumDupLimit() );
-                
+        
+        String indexFileName = jdbmIndexBean.getIndexFileName();
+        
+        if ( indexFileName == null )
+        {
+            indexFileName = jdbmIndexBean.getIndexAttributeId();
+        }
+            
+        // Find the OID for this index
+        SchemaManager schemaManager = directoryService.getSchemaManager();
+        
+        try
+        {
+            AttributeType indexAT = schemaManager.lookupAttributeTypeRegistry( indexFileName );
+            indexFileName = indexAT.getOid();
+        }
+        catch ( LdapException le )
+        {
+            // Not found ? We will use the index file name
+        }
+        
+        
         if ( jdbmIndexBean.getIndexWorkingDir() != null )
         {
-            index.setWkDirPath( new File( jdbmIndexBean.getIndexWorkingDir() + File.pathSeparator + jdbmIndexBean.getIndexFileName()) );
+            index.setWkDirPath( new File( jdbmIndexBean.getIndexWorkingDir() + File.pathSeparator + indexFileName ) );
         }
         else
         {
             // Set the Partition working dir as a default
-            index.setWkDirPath( new File( partition.getPartitionDir().getAbsolutePath() + File.pathSeparator + jdbmIndexBean.getIndexFileName() ) );
+            index.setWkDirPath( new File( partition.getPartitionDir(), indexFileName ) );
         }
                 
         return index;
@@ -866,7 +890,7 @@ public class ConfigBuilder
     /**
      * Create the list of Index from the configuration
      */
-    private static Set<Index<?, Entry, Long>> createJdbmIndexes( JdbmPartition partition, List<IndexBean> indexesBeans ) //throws Exception
+    private static Set<Index<?, Entry, Long>> createJdbmIndexes( JdbmPartition partition, List<IndexBean> indexesBeans, DirectoryService directoryService ) //throws Exception
     {
         Set<Index<?, Entry, Long>> indexes = new HashSet<Index<?, Entry, Long>>();
 
@@ -874,7 +898,7 @@ public class ConfigBuilder
         {
             if ( indexBean instanceof JdbmIndexBean )
             {
-                indexes.add( createJdbmIndex( partition, (JdbmIndexBean)indexBean ) );
+                indexes.add( createJdbmIndex( partition, (JdbmIndexBean)indexBean, directoryService ) );
             }
         }
 
@@ -897,7 +921,7 @@ public class ConfigBuilder
         jdbmPartition.setCacheSize( jdbmPartitionBean.getPartitionCacheSize() );
         jdbmPartition.setId( jdbmPartitionBean.getPartitionId() );
         jdbmPartition.setOptimizerEnabled( jdbmPartitionBean.isJdbmPartitionOptimizerEnabled() );
-        jdbmPartition.setPartitionDir( new File( directoryService.getWorkingDirectory() + File.separator + jdbmPartitionBean.getPartitionId() ) );
+        jdbmPartition.setPartitionDir( new File( directoryService.getInstanceLayout().getPartitionsDirectory(), jdbmPartitionBean.getPartitionId() ) );
         
         try
         {
@@ -911,7 +935,7 @@ public class ConfigBuilder
         }
         
         jdbmPartition.setSyncOnWrite( jdbmPartitionBean.isPartitionSyncOnWrite() );
-        jdbmPartition.setIndexedAttributes( createJdbmIndexes( jdbmPartition, jdbmPartitionBean.getIndexes() ) );
+        jdbmPartition.setIndexedAttributes( createJdbmIndexes( jdbmPartition, jdbmPartitionBean.getIndexes(), directoryService ) );
         
         String contextEntry = jdbmPartitionBean.getContextEntry();
         
@@ -996,9 +1020,12 @@ public class ConfigBuilder
      * @return An instance of DirectoryService
      * @throws Exception 
      */
-    public static DirectoryService createDirectoryService( DirectoryServiceBean directoryServiceBean, File baseDirectory ) throws Exception
+    public static DirectoryService createDirectoryService( DirectoryServiceBean directoryServiceBean, InstanceLayout instanceLayout, SchemaManager schemaManager ) throws Exception
     {
         DirectoryService directoryService = new DefaultDirectoryService();
+        
+        // The schemaManager
+        directoryService.setSchemaManager( schemaManager );
 
         // MUST attributes
         // DirectoryService ID
@@ -1008,7 +1035,7 @@ public class ConfigBuilder
         directoryService.setReplicaId( directoryServiceBean.getDsReplicaId() );
 
         // WorkingDirectory
-        directoryService.setWorkingDirectory( baseDirectory );
+        directoryService.setInstanceLayout( instanceLayout );
 
         // Interceptors
         List<Interceptor> interceptors = createInterceptors( directoryServiceBean.getInterceptors() );

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/resources/config.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/resources/config.ldif?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/resources/config.ldif (original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/resources/config.ldif Thu Oct 28 23:42:46 2010
@@ -232,11 +232,11 @@ ads-partitioncachesize: 100
 ads-partitionsynconwrite: true
 ads-partitionid: system
 ads-enabled: true
-ads-contextEntry: dc=example,dc=com\n
+ads-contextEntry: dn: ou=system\n
  objectClass: top\n
- objectClass: domain\n
- dc: example\n
- description: The example context entry
+ objectClass: organizationalUnit\n
+ ou: system\n
+ description: The System context entry
 
 dn: ou=indexes,ads-partitionId=system,ou=partitions,ads-directoryServiceId=default,ou=config
 ou: indexes

Modified: directory/apacheds/branches/apacheds-config/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java (original)
+++ directory/apacheds/branches/apacheds-config/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java Thu Oct 28 23:42:46 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

Modified: directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java (original)
+++ directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkRunner.java Thu Oct 28 23:42:46 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/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java (original)
+++ directory/apacheds/branches/apacheds-config/test-framework/src/main/java/org/apache/directory/server/core/integ/FrameworkSuite.java Thu Oct 28 23:42:46 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 )
             {

Modified: directory/apacheds/branches/apacheds-config/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java (original)
+++ directory/apacheds/branches/apacheds-config/wrapper/src/main/java/org/apache/directory/server/ApacheDsTanukiWrapper.java Thu Oct 28 23:42:46 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;

Modified: directory/apacheds/branches/apacheds-config/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java?rev=1028548&r1=1028547&r2=1028548&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java (original)
+++ directory/apacheds/branches/apacheds-config/xdbm-partition/src/main/java/org/apache/directory/server/xdbm/AbstractStore.java Thu Oct 28 23:42:46 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( new File( partitionDir, ApacheSchemaConstants.APACHE_EXISTENCE_AT_OID ) );
+            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( new File( partitionDir, ApacheSchemaConstants.APACHE_ONE_LEVEL_AT_OID ) );
+            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( new File( partitionDir, ApacheSchemaConstants.APACHE_SUB_LEVEL_AT_OID ) );
+            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( new File( partitionDir, ApacheSchemaConstants.APACHE_RDN_AT_OID ) );
+            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( new File( partitionDir, ApacheSchemaConstants.APACHE_ALIAS_AT_OID ) );
+            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( new File( partitionDir, ApacheSchemaConstants.APACHE_ONE_ALIAS_AT_OID ) );
+            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( new File( partitionDir, ApacheSchemaConstants.APACHE_SUB_ALIAS_AT_OID ) );
+            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( new File( partitionDir, SchemaConstants.OBJECT_CLASS_AT_OID ) );
+            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( new File( partitionDir, SchemaConstants.ENTRY_UUID_AT_OID ) );
+            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( new File( partitionDir, SchemaConstants.ENTRY_CSN_AT_OID ) );
+            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() );
         }
 



Mime
View raw message