directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r895817 - in /directory/installers/branches/installers-schema/apacheds-noarch: pom.xml src/main/java/org/apache/directory/server/Service.java src/main/java/org/apache/directory/server/UberjarMain.java
Date Mon, 04 Jan 2010 22:51:39 GMT
Author: seelmann
Date: Mon Jan  4 22:51:39 2010
New Revision: 895817

URL: http://svn.apache.org/viewvc?rev=895817&view=rev
Log:
Fixed compilation errors, use DefaultDirectoryServiceFactory to initialize the directory service
when no configuration is provided

Modified:
    directory/installers/branches/installers-schema/apacheds-noarch/pom.xml
    directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
    directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/UberjarMain.java

Modified: directory/installers/branches/installers-schema/apacheds-noarch/pom.xml
URL: http://svn.apache.org/viewvc/directory/installers/branches/installers-schema/apacheds-noarch/pom.xml?rev=895817&r1=895816&r2=895817&view=diff
==============================================================================
--- directory/installers/branches/installers-schema/apacheds-noarch/pom.xml (original)
+++ directory/installers/branches/installers-schema/apacheds-noarch/pom.xml Mon Jan  4 22:51:39
2010
@@ -98,4 +98,12 @@
       </plugin>
     </plugins>
   </build>
+  
+  <dependencies>
+  	<dependency>
+      <groupId>org.apache.directory.server</groupId>
+      <artifactId>apacheds-core-annotations</artifactId>
+      <version>${pom.version}</version>
+    </dependency>
+  </dependencies>
 </project>

Modified: directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=895817&r1=895816&r2=895817&view=diff
==============================================================================
--- directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
(original)
+++ directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
Mon Jan  4 22:51:39 2010
@@ -23,11 +23,12 @@
 import java.io.File;
 
 import org.apache.directory.daemon.DaemonApplication;
-import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.daemon.InstanceLayout;
 import org.apache.directory.server.changepw.ChangePasswordServer;
 import org.apache.directory.server.configuration.ApacheDS;
 import org.apache.directory.server.core.DefaultDirectoryService;
 import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.factory.DefaultDirectoryServiceFactory;
 import org.apache.directory.server.dns.DnsServer;
 import org.apache.directory.server.integration.http.HttpServer;
 import org.apache.directory.server.kerberos.kdc.KdcServer;
@@ -72,25 +73,25 @@
     private FileSystemXmlApplicationContext factory;
 
 
-    public void init( InstallationLayout install, String[] args ) throws Exception
+    public void init( InstanceLayout layout, String[] args ) throws Exception
     {
         // Initialize the LDAP server
-        initLdap( install, args );
+        initLdap( layout, args );
         
         // Initialize the NTP server
-        initNtp( install, args );
+        initNtp( layout, args );
         
         // Initialize the DNS server (Not ready yet)
-        // initDns( install, args );
+        // initDns( layout, args );
         
         // Initialize the DHCP server (Not ready yet)
-        // initDhcp( install, args );
+        // initDhcp( layout, args );
         
         // Initialize the ChangePwd server (Not ready yet)
-        initChangePwd( install, args );
+        initChangePwd( layout, args );
         
         // Initialize the Kerberos server
-        initKerberos( install, args );
+        initKerberos( layout, args );
         
         // initialize the jetty http server
         initHttpServer();
@@ -100,7 +101,7 @@
     /**
      * Initialize the LDAP server
      */
-    private void initLdap( InstallationLayout install, String[] args ) throws Exception
+    private void initLdap( InstanceLayout layout, String[] args ) throws Exception
     {
         LOG.info( "Starting the LDAP server" );
         
@@ -117,7 +118,8 @@
         else
         {
             LOG.info( "server: using default settings ..." );
-            DirectoryService directoryService = new DefaultDirectoryService();
+            DefaultDirectoryServiceFactory.DEFAULT.init( "default" );
+            DirectoryService directoryService = DefaultDirectoryServiceFactory.DEFAULT.getDirectoryService();
             directoryService.startup();
             ldapServer = new LdapServer();
             ldapServer.setDirectoryService( directoryService );
@@ -127,9 +129,9 @@
             apacheDS = new ApacheDS( ldapServer );
         }
 
-        if ( install != null )
+        if ( layout != null )
         {
-            ldapServer.getDirectoryService().setWorkingDirectory( install.getPartitionsDirectory()
);
+            ldapServer.getDirectoryService().setWorkingDirectory( layout.getPartitionsDir()
);
         }
 
         // And start the server now
@@ -145,7 +147,7 @@
     /**
      * Initialize the NTP server
      */
-    private void initNtp( InstallationLayout install, String[] args ) throws Exception
+    private void initNtp( InstanceLayout layout, String[] args ) throws Exception
     {
         if ( factory == null )
         {
@@ -181,7 +183,7 @@
     /**
      * Initialize the DNS server
      */
-    private void initDns( InstallationLayout install, String[] args ) throws Exception
+    private void initDns( InstanceLayout layout, String[] args ) throws Exception
     {
         if ( factory == null )
         {
@@ -217,7 +219,7 @@
     /**
      * Initialize the KERBEROS server
      */
-    private void initKerberos( InstallationLayout install, String[] args ) throws Exception
+    private void initKerberos( InstanceLayout layout, String[] args ) throws Exception
     {
         if ( factory == null )
         {
@@ -253,7 +255,7 @@
     /**
      * Initialize the Change Password server
      */
-    private void initChangePwd( InstallationLayout install, String[] args ) throws Exception
+    private void initChangePwd( InstanceLayout layout, String[] args ) throws Exception
     {
         if ( factory == null )
         {
@@ -417,4 +419,5 @@
     {
         System.out.println( bannerConstant );
     }
+
 }

Modified: directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/UberjarMain.java
URL: http://svn.apache.org/viewvc/directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/UberjarMain.java?rev=895817&r1=895816&r2=895817&view=diff
==============================================================================
--- directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/UberjarMain.java
(original)
+++ directory/installers/branches/installers-schema/apacheds-noarch/src/main/java/org/apache/directory/server/UberjarMain.java
Mon Jan  4 22:51:39 2010
@@ -20,7 +20,8 @@
 package org.apache.directory.server;
 
 
-import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.daemon.InstallLayout;
+import org.apache.directory.daemon.InstanceLayout;
 
 import java.io.File;
 
@@ -46,9 +47,10 @@
 
         if ( args.length > 0 && new File( args[0] ).isDirectory() )
         {
-            InstallationLayout layout = new InstallationLayout( args[0] );
-            String confFile = layout.getConfigurationFile().toURI().toURL().toString();
-            service.init( layout, new String[] { confFile } );
+            InstallLayout installLayout = new InstallLayout( new File( args[0] ) );
+            String confFile = installLayout.getConfigurationFile().toURI().toURL().toString();
+            InstanceLayout instanceLayout = new InstanceLayout( "default", installLayout
); // TODO: make name configurable
+            service.init( instanceLayout, new String[] { confFile } );
         }
         else if ( args.length > 0 && new File( args[0] ).isFile() )
         {



Mime
View raw message