directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1028036 - in /directory: apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ apacheds/bra...
Date Wed, 27 Oct 2010 16:58:46 GMT
Author: elecharny
Date: Wed Oct 27 16:58:46 2010
New Revision: 1028036

URL: http://svn.apache.org/viewvc?rev=1028036&view=rev
Log:
o We don't any more need to pass the DS name to initialize it by default
o Added some more accurate logs in ConfigBuilder
o Removed the dsWorkingDirectory field from DS? as we don't need it
o Removed the ads-dsWorkingDirectory AT and also removed it from the ads-directoryService
OC

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.114.ldif
Modified:
    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/java/org/apache/directory/server/config/beans/ConfigBean.java
    directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
    directory/apacheds/branches/apacheds-config/service/src/main/java/org/apache/directory/server/ApacheDsService.java
    directory/shared/branches/shared-config/ldap-schema/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.100.ldif

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=1028036&r1=1028035&r2=1028036&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
Wed Oct 27 16:58:46 2010
@@ -148,7 +148,10 @@ public class ConfigBuilder
             }
             catch ( Exception e )
             {
-                throw new ConfigurationException( e.getMessage() );
+                e.printStackTrace();
+                String message = "Cannot initialize the " + interceptorBean.getInterceptorClassName()
+ ", error : " + e;
+                LOG.error( message );
+                throw new ConfigurationException( message );
             }
         }
         
@@ -989,10 +992,11 @@ public class ConfigBuilder
      * Instantiates a DirectoryService based on the configuration present in the partition

      *
      * @param directoryServiceBean The bean containing the configuration
+     * @param baseDirectory The working path for this DirectoryService 
      * @return An instance of DirectoryService
      * @throws Exception 
      */
-    private static DirectoryService createDirectoryService( DirectoryServiceBean directoryServiceBean
) throws Exception
+    public static DirectoryService createDirectoryService( DirectoryServiceBean directoryServiceBean,
File baseDirectory ) throws Exception
     {
         DirectoryService directoryService = new DefaultDirectoryService();
 
@@ -1004,7 +1008,7 @@ public class ConfigBuilder
         directoryService.setReplicaId( directoryServiceBean.getDsReplicaId() );
 
         // WorkingDirectory
-        directoryService.setWorkingDirectory( new File( directoryServiceBean.getDsWorkingDirectory()
) );
+        directoryService.setWorkingDirectory( baseDirectory );
 
         // Interceptors
         List<Interceptor> interceptors = createInterceptors( directoryServiceBean.getInterceptors()
);
@@ -1072,26 +1076,4 @@ public class ConfigBuilder
 
         return directoryService;
     }
-
-    
-    /**
-     * Create a new DirectoryService instance using the ConfigBean as a container for 
-     * the configuration
-     * 
-     * @param configBean The Bean containing all the needed configuration to create the DS
-     * @param directoryServiceId The DS id we want to instantiate
-     * @return An instance of DS
-     */
-    public static DirectoryService createDirectoryService( DirectoryServiceBean directoryServiceBean,
String directoryServiceId ) throws LdapException, Exception
-    {
-        if ( directoryServiceBean.getDirectoryServiceId().equalsIgnoreCase( directoryServiceId
) )
-        {
-            DirectoryService directoryService = createDirectoryService( directoryServiceBean
);
-            
-            return directoryService;
-        }
-        
-        LOG.info( "Cannot instanciate the {} directory service, it was not found in the configuration",
directoryServiceId );
-        return null;
-    }
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ConfigBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ConfigBean.java?rev=1028036&r1=1028035&r2=1028036&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ConfigBean.java
(original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ConfigBean.java
Wed Oct 27 16:58:46 2010
@@ -63,7 +63,30 @@ public class ConfigBean 
 
 
     /**
-     * @return the directoryServiceBean
+     * @return the first directoryServiceBean found into the configuration
+     */
+    public DirectoryServiceBean getDirectoryServiceBean()
+    {
+        if ( ( directoryServiceBeans == null ) || ( directoryServiceBeans.size() == 0 ) )
+        {
+            return null;
+        }
+        
+        for ( AdsBaseBean bean : directoryServiceBeans )
+        {
+            if ( bean instanceof DirectoryServiceBean )
+            {
+                return (DirectoryServiceBean)bean;
+            }
+        }
+        
+        return null;
+    }
+
+
+    /**
+     * @param The DirectoryService ID we want to get
+     * @return the found directoryServiceBean
      */
     public DirectoryServiceBean getDirectoryServiceBean( String directoryServiceId )
     {

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java?rev=1028036&r1=1028035&r2=1028036&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
(original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
Wed Oct 27 16:58:46 2010
@@ -76,9 +76,6 @@ public class DirectoryServiceBean extend
     /** The reference to the Password Policy component */
     private PasswordPolicyBean passwordPolicy;
 
-    /** The working directory */
-    private String dsWorkingDirectory;
-
     /**
      * Create a new DnsServerBean instance
      */
@@ -527,24 +524,6 @@ public class DirectoryServiceBean extend
 
 
     /**
-     * @return the dsWorkingDirectory
-     */
-    public String getDsWorkingDirectory()
-    {
-        return dsWorkingDirectory;
-    }
-
-
-    /**
-     * @param dsWorkingDirectory the dsWorkingDirectory to set
-     */
-    public void setDsWorkingDirectory( String dsWorkingDirectory )
-    {
-        this.dsWorkingDirectory = dsWorkingDirectory;
-    }
-    
-
-    /**
      * {@inheritDoc}
      */
     public String toString()
@@ -557,7 +536,6 @@ public class DirectoryServiceBean extend
         // Dump the must attributes
         sb.append( "  directoryService ID : " ).append( directoryServiceId ).append( '\n'
);
         sb.append( "  replica ID : " ).append( dsReplicaId ).append( '\n' );
-        sb.append( "  working directory : " ).append( dsWorkingDirectory ).append( '\n' );
         sb.append( toString( "  ", "accessControl enabled", dsAccessControlEnabled ) );
         sb.append( toString( "  ", "allow anonymous access", dsAllowAnonymousAccess ) );
         sb.append( toString( "  ", "denormalized attributes enabled", dsDenormalizeOpAttrsEnabled
) );

Modified: directory/apacheds/branches/apacheds-config/service/src/main/java/org/apache/directory/server/ApacheDsService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/service/src/main/java/org/apache/directory/server/ApacheDsService.java?rev=1028036&r1=1028035&r2=1028036&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/service/src/main/java/org/apache/directory/server/ApacheDsService.java
(original)
+++ directory/apacheds/branches/apacheds-config/service/src/main/java/org/apache/directory/server/ApacheDsService.java
Wed Oct 27 16:58:46 2010
@@ -158,7 +158,7 @@ public class ApacheDsService
         
         ConfigBean configBean = cpReader.readConfig( "ou=config" );
         
-        DirectoryServiceBean directoryServiceBean = configBean.getDirectoryServiceBean( "default"
);
+        DirectoryServiceBean directoryServiceBean = configBean.getDirectoryServiceBean();
         
         // Initialize the DirectoryService now
         DirectoryService directoryService = initDirectoryService( instanceLayout, directoryServiceBean
);
@@ -266,7 +266,7 @@ public class ApacheDsService
         
         long startTime = System.currentTimeMillis();
 
-        DirectoryService directoryService = ConfigBuilder.createDirectoryService( directoryServiceBean,
"default" );
+        DirectoryService directoryService = ConfigBuilder.createDirectoryService( directoryServiceBean,
instanceLayout.getInstanceDirectory() );
         directoryService.setSchemaManager( schemaManager );
 
         SchemaPartition schemaPartition = directoryService.getSchemaService().getSchemaPartition();

Modified: directory/shared/branches/shared-config/ldap-schema/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.100.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dadsconfig/ou%3Dobjectclasses/m-oid%3D1.3.6.1.4.1.18060.0.4.1.3.100.ldif?rev=1028036&r1=1028035&r2=1028036&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap-schema/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.100.ldif
(original)
+++ directory/shared/branches/shared-config/ldap-schema/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.100.ldif
Wed Oct 27 16:58:46 2010
@@ -14,7 +14,6 @@ m-must: ads-directoryServiceId
 m-must: ads-dsReplicaId
 m-must: ads-interceptors
 m-must: ads-partitions
-m-must: ads-dsWorkingDirectory
 m-may: ads-servers
 m-may: ads-dsAccessControlEnabled
 m-may: ads-dsAllowAnonymousAccess



Mime
View raw message