directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1001778 - /directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Date Mon, 27 Sep 2010 15:21:48 GMT
Author: kayyagari
Date: Mon Sep 27 15:21:43 2010
New Revision: 1001778

URL: http://svn.apache.org/viewvc?rev=1001778&view=rev
Log:
o updated to use SingleFileLdifPartition for creating and loading configuration

Modified:
    directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java

Modified: directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=1001778&r1=1001777&r2=1001778&view=diff
==============================================================================
--- directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
(original)
+++ directory/installers/trunk/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Mon Sep 27 15:21:43 2010
@@ -40,6 +40,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.ModifyOperationContext;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.core.partition.ldif.LdifPartition;
+import org.apache.directory.server.core.partition.ldif.SingleFileLdifPartition;
 import org.apache.directory.server.core.schema.SchemaPartition;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.integration.http.HttpServer;
@@ -105,7 +106,7 @@ public class Service implements DaemonAp
 
     private SchemaManager schemaManager;
 
-    private LdifPartition configPartition;
+    private SingleFileLdifPartition configPartition;
 
     private ConfigPartitionReader cpReader;
 
@@ -143,7 +144,7 @@ public class Service implements DaemonAp
         initSchemaLdifPartition( partitionsDir );
         initConfigPartition( partitionsDir );
 
-        cpReader = new ConfigPartitionReader( configPartition );
+        cpReader = new ConfigPartitionReader( configPartition, partitionsDir );
 
         // Initialize the LDAP server
         initLdap( layout, args );
@@ -220,24 +221,25 @@ public class Service implements DaemonAp
     private void initConfigPartition( File partitionsDir ) throws Exception
     {
 
-        File configRepository = new File( partitionsDir, "config" );
+        File configRepository = new File( partitionsDir.getParentFile(), "conf" );
 
-        if ( configRepository.exists() )
+        File confFile = new File( configRepository, LdifConfigExtractor.LDIF_CONFIG_FILE
);
+        
+        if ( confFile.exists() )
         {
             LOG.info( "config partition already exists, skipping default config extraction"
);
         }
         else
         {
-            LdifConfigExtractor.extract( partitionsDir, true );
+            LdifConfigExtractor.extractSingleFileConfig( configRepository, true );
             isConfigPartitionFirstExtraction = true;
         }
 
-        configPartition = new LdifPartition();
+        configPartition = new SingleFileLdifPartition( confFile.getAbsolutePath() );
+        
         configPartition.setId( "config" );
         configPartition.setSuffix( new DN( "ou=config" ) );
         configPartition.setSchemaManager( schemaManager );
-        configPartition.setWorkingDirectory( partitionsDir.getPath() + "/config" );
-        configPartition.setPartitionDir( new File( configPartition.getWorkingDirectory()
) );
 
         configPartition.initialize();
     }



Mime
View raw message