directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r519833 - in /directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration: MutableServerStartupConfiguration.java ServerStartupConfiguration.java
Date Mon, 19 Mar 2007 04:29:21 GMT
Author: erodriguez
Date: Sun Mar 18 21:29:18 2007
New Revision: 519833

URL: http://svn.apache.org/viewvc?view=rev&rev=519833
Log:
Updates to ServerStartupConfiguration:
o  Removal of parameters for configuring LDAP and LDAPS.  These are now in LdapConfiguration.
o  Removal of boolean parameters for enabling individual protocol providers.  These are now
in the ServiceConfiguration base class used by all the protocol providers.
o  Addition of configuration beans for all the protocol providers:  LDAP, LDAPS, Kerberos,
NTP, and Change Password.  DNS is available but was not originally part of the server so was
left out.

Modified:
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
    directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java?view=diff&rev=519833&r1=519832&r2=519833
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java
Sun Mar 18 21:29:18 2007
@@ -18,14 +18,18 @@
  *  
  */
 package org.apache.directory.server.configuration;
- 
+
 
 import java.io.File;
-import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.directory.server.changepw.ChangePasswordConfiguration;
 import org.apache.directory.server.core.configuration.PartitionConfiguration;
+import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
+import org.apache.directory.server.ldap.LdapConfiguration;
+import org.apache.directory.server.ntp.NtpConfiguration;
+
 
 /**
  * A mutable version of {@link ServerStartupConfiguration}.
@@ -38,46 +42,44 @@
     private static final long serialVersionUID = 515104910980600099L;
 
 
+    /**
+     * Creates a new instance of MutableServerStartupConfiguration.
+     */
     public MutableServerStartupConfiguration()
     {
         super();
     }
-    
+
+
+    /**
+     * Creates a new instance of MutableServerStartupConfiguration.
+     *
+     * @param instanceId
+     */
     public MutableServerStartupConfiguration( String instanceId )
     {
-    	super( instanceId );
+        super( instanceId );
     }
 
+
     public void setSystemPartitionConfiguration( PartitionConfiguration systemPartitionConfiguration
)
     {
         super.setSystemPartitionConfiguration( systemPartitionConfiguration );
     }
-    
-    
+
+
     public void setMaxThreads( int maxThreads )
     {
         super.setMaxThreads( maxThreads );
     }
-    
-    
-    public void setMaxTimeLimit( int maxTimeLimit )
-    {
-        super.setMaxTimeLimit( maxTimeLimit );
-    }
-    
-    
-    public void setMaxSizeLimit( int maxSizeLimit )
-    {
-        super.setMaxSizeLimit( maxSizeLimit );
-    }
-    
+
 
     public void setSynchPeriodMillis( long synchPeriodMillis )
     {
         super.setSynchPeriodMillis( synchPeriodMillis );
     }
-    
-    
+
+
     public void setAccessControlEnabled( boolean accessControlEnabled )
     {
         super.setAccessControlEnabled( accessControlEnabled );
@@ -87,14 +89,15 @@
     public void setAllowAnonymousAccess( boolean arg0 )
     {
         super.setAllowAnonymousAccess( arg0 );
+        getLdapConfiguration().setAllowAnonymousAccess( arg0 );
     }
 
-    
+
     public void setDenormalizeOpAttrsEnabled( boolean denormalizeOpAttrsEnabled )
     {
         super.setDenormalizeOpAttrsEnabled( denormalizeOpAttrsEnabled );
     }
-    
+
 
     public void setAuthenticatorConfigurations( Set arg0 )
     {
@@ -126,80 +129,56 @@
     }
 
 
-    public void setEnableKerberos( boolean enableKerberos )
-    {
-        super.setEnableKerberos( enableKerberos );
-    }
-
-
-    public void setEnableChangePassword( boolean enableChangePassword )
-    {
-        super.setEnableChangePassword( enableChangePassword );
-    }
-
-
-    public void setEnableNtp( boolean enableNtp )
-    {
-        super.setEnableNtp( enableNtp );
-    }
-
-
-    public void setLdapPort( int ldapPort )
-    {
-        super.setLdapPort( ldapPort );
-    }
-
-
-    public void setLdapsPort( int ldapsPort )
+    public void setLdifDirectory( File ldifDirectory )
     {
-        super.setLdapsPort( ldapsPort );
+        super.setLdifDirectory( ldifDirectory );
     }
 
 
-    public void setExtendedOperationHandlers( Collection handlers )
+    public void setLdifFilters( List ldifFilters )
     {
-        super.setExtendedOperationHandlers( handlers );
+        super.setLdifFilters( ldifFilters );
     }
 
 
-    public void setLdifDirectory( File ldifDirectory )
+    public void setShutdownHookEnabled( boolean shutdownHookEnabled )
     {
-        super.setLdifDirectory( ldifDirectory );
+        super.setShutdownHookEnabled( shutdownHookEnabled );
     }
 
 
-    public void setLdifFilters( List ldifFilters )
+    public void setExitVmOnShutdown( boolean exitVmOnShutdown )
     {
-        super.setLdifFilters( ldifFilters );
+        super.setExitVmOnShutdown( exitVmOnShutdown );
     }
 
 
-    public void setEnableLdaps( boolean enableLdaps )
+    public void setKdcConfiguration( KdcConfiguration kdcConfiguration )
     {
-        super.setEnableLdaps( enableLdaps );
+        super.setKdcConfiguration( kdcConfiguration );
     }
 
 
-    public void setLdapsCertificateFile( File ldapsCertificateFile )
+    public void setLdapConfiguration( LdapConfiguration ldapConfiguration )
     {
-        super.setLdapsCertificateFile( ldapsCertificateFile );
+        super.setLdapConfiguration( ldapConfiguration );
     }
 
 
-    public void setLdapsCertificatePassword( String ldapsCertificatePassword )
+    public void setLdapsConfiguration( LdapConfiguration ldapsConfiguration )
     {
-        super.setLdapsCertificatePassword( ldapsCertificatePassword );
+        super.setLdapsConfiguration( ldapsConfiguration );
     }
 
 
-    public void setShutdownHookEnabled( boolean shutdownHookEnabled )
+    public void setNtpConfiguration( NtpConfiguration ntpConfiguration )
     {
-        super.setShutdownHookEnabled( shutdownHookEnabled );
+        super.setNtpConfiguration( ntpConfiguration );
     }
 
 
-    public void setExitVmOnShutdown( boolean exitVmOnShutdown )
+    public void setChangePasswordConfiguration( ChangePasswordConfiguration changePasswordConfiguration
)
     {
-        super.setExitVmOnShutdown( exitVmOnShutdown );
+        super.setChangePasswordConfiguration( changePasswordConfiguration );
     }
 }

Modified: directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java?view=diff&rev=519833&r1=519832&r2=519833
==============================================================================
--- directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
(original)
+++ directory/apacheds/branches/apacheds-sasl-branch/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java
Sun Mar 18 21:29:18 2007
@@ -20,16 +20,15 @@
 package org.apache.directory.server.configuration;
 
 
+import java.io.File;
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
-import java.io.File;
 
-import org.apache.directory.server.core.configuration.ConfigurationException;
-import org.apache.directory.server.core.configuration.ConfigurationUtil;
+import org.apache.directory.server.changepw.ChangePasswordConfiguration;
 import org.apache.directory.server.core.configuration.StartupConfiguration;
-import org.apache.directory.server.ldap.ExtendedOperationHandler;
+import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
+import org.apache.directory.server.ldap.LdapConfiguration;
+import org.apache.directory.server.ntp.NtpConfiguration;
 import org.apache.directory.server.protocol.shared.store.LdifLoadFilter;
 
 
@@ -45,31 +44,31 @@
 
     private static final long DEFAULT_SYNC_PERIOD_MILLIS = 20000;
 
-    private boolean enableNetworking = true;
     private long synchPeriodMillis = DEFAULT_SYNC_PERIOD_MILLIS;
-    private int ldapPort = 389;
-    private int ldapsPort = 636;
-    private File ldapsCertificateFile = new File( this.getWorkingDirectory().getPath() +
File.separator
-        + "certificates" + File.separator + "server.cert" );
-    private String ldapsCertificatePassword = "changeit";
-    private boolean enableLdaps = false;
-    private boolean enableKerberos = false;
-    private boolean enableChangePassword = false;
-    private boolean enableNtp = false;
-    private final Collection extendedOperationHandlers = new ArrayList();
+
+    private boolean enableNetworking = true;
+
     private File ldifDirectory = null;
     private final List ldifFilters = new ArrayList();
 
+    private KdcConfiguration kdcConfiguration = new KdcConfiguration();
+    private LdapConfiguration ldapConfiguration = new LdapConfiguration();
+    private LdapConfiguration ldapsConfiguration = new LdapConfiguration();
+    private ChangePasswordConfiguration changePasswordConfiguration = new ChangePasswordConfiguration();
+    private NtpConfiguration ntpConfiguration = new NtpConfiguration();
+
 
     protected ServerStartupConfiguration()
     {
     }
 
+
     protected ServerStartupConfiguration( String instanceId )
     {
-    	super( instanceId );
+        super( instanceId );
     }
 
+
     /**
      * Returns <tt>true</tt> if networking (LDAP, LDAPS, and Kerberos) is enabled.
      */
@@ -88,230 +87,108 @@
     }
 
 
-    /**
-     * Returns <tt>true</tt> if Kerberos support is enabled.
-     */
-    public boolean isEnableKerberos()
-    {
-        return enableKerberos;
-    }
-
-
-    /**
-     * Returns <tt>true</tt> if Change Password support is enabled.
-     */
-    public boolean isEnableChangePassword()
-    {
-        return enableChangePassword;
-    }
-
-
-    /**
-     * Returns <tt>true</tt> if Kerberos support is enabled.
-     */
-    public boolean isEnableNtp()
-    {
-        return enableNtp;
-    }
-
-
-    /**
-     * Sets whether to enable Kerberos support or not.
-     */
-    protected void setEnableKerberos( boolean enableKerberos )
-    {
-        this.enableKerberos = enableKerberos;
-    }
-
-
-    /**
-     * Sets whether to enable Change Password support or not.
-     */
-    protected void setEnableChangePassword( boolean enableChangePassword )
-    {
-        this.enableChangePassword = enableChangePassword;
-    }
-
-
-    /**
-     * Sets whether to enable Ntp support or not.
-     */
-    protected void setEnableNtp( boolean enableNtp )
-    {
-        this.enableNtp = enableNtp;
-    }
-
-
-    /**
-     * Returns LDAP TCP/IP port number to listen to.
-     */
-    public int getLdapPort()
-    {
-        return ldapPort;
-    }
-
-
-    /**
-     * Sets LDAP TCP/IP port number to listen to.
-     */
-    protected void setLdapPort( int ldapPort )
+    public File getLdifDirectory()
     {
-        ConfigurationUtil.validatePortNumber( ldapPort );
-        this.ldapPort = ldapPort;
+        return this.ldifDirectory;
     }
 
 
-    /**
-     * Returns LDAPS TCP/IP port number to listen to.
-     */
-    public int getLdapsPort()
+    protected void setLdifDirectory( File ldifDirectory )
     {
-        return ldapsPort;
+        this.ldifDirectory = ldifDirectory;
     }
 
 
-    /**
-     * Sets LDAPS TCP/IP port number to listen to.
-     */
-    protected void setLdapsPort( int ldapsPort )
+    public List getLdifFilters()
     {
-        ConfigurationUtil.validatePortNumber( ldapsPort );
-        this.ldapsPort = ldapsPort;
+        return new ArrayList( ldifFilters );
     }
 
 
-    /**
-     * Returns <tt>true</tt> if LDAPS is enabled.
-     */
-    public boolean isEnableLdaps()
+    protected void setLdifFilters( List filters )
     {
-        return enableLdaps;
-    }
-
+        for ( int ii = 0; ii < filters.size(); ii++ )
+        {
+            if ( !( filters.get( ii ) instanceof LdifLoadFilter ) )
+            {
+                throw new IllegalArgumentException(
+                    "The specified filter collection contains an element which is not an
LdifLoadFilter." );
+            }
+        }
 
-    /**
-     * Sets if LDAPS is enabled or not.
-     */
-    protected void setEnableLdaps( boolean enableLdaps )
-    {
-        this.enableLdaps = enableLdaps;
+        this.ldifFilters.clear();
+        this.ldifFilters.addAll( filters );
     }
 
 
-    /**
-     * Returns the path of the X509 (or JKS) certificate file for LDAPS.
-     * The default value is <tt>"&lt;WORKDIR&gt;/certificates/server.cert"</tt>.

-     */
-    public File getLdapsCertificateFile()
+    protected void setSynchPeriodMillis( long synchPeriodMillis )
     {
-        return ldapsCertificateFile;
+        this.synchPeriodMillis = synchPeriodMillis;
     }
 
 
-    /**
-     * Sets the path of the SunX509 certificate file (either PKCS12 or JKS format)
-     * for LDAPS.
-     */
-    protected void setLdapsCertificateFile( File ldapsCertificateFile )
+    public long getSynchPeriodMillis()
     {
-        if ( ldapsCertificateFile == null )
-        {
-            throw new ConfigurationException( "LdapsCertificateFile cannot be null." );
-        }
-        this.ldapsCertificateFile = ldapsCertificateFile;
+        return synchPeriodMillis;
     }
 
 
-    /**
-     * Returns the password which is used to load the the SunX509 certificate file
-     * (either PKCS12 or JKS format).
-     * The default value is <tt>"changeit"</tt>.  This is the same value with
what
-     * <a href="http://jakarta.apache.org/tomcat/">Apache Jakarta Tomcat</a>
uses by
-     * default.
-     */
-    public String getLdapsCertificatePassword()
+    protected void setKdcConfiguration( KdcConfiguration kdcConfiguration )
     {
-        return ldapsCertificatePassword;
+        this.kdcConfiguration = kdcConfiguration;
     }
 
 
-    /**
-     * Sets the password which is used to load the LDAPS certificate file.
-     */
-    protected void setLdapsCertificatePassword( String ldapsCertificatePassword )
+    public KdcConfiguration getKdcConfiguration()
     {
-        if ( ldapsCertificatePassword == null )
-        {
-            throw new ConfigurationException( "LdapsCertificatePassword cannot be null."
);
-        }
-        this.ldapsCertificatePassword = ldapsCertificatePassword;
+        return kdcConfiguration;
     }
 
 
-    public Collection getExtendedOperationHandlers()
+    protected void setLdapConfiguration( LdapConfiguration ldapConfiguration )
     {
-        return new ArrayList( extendedOperationHandlers );
+        this.ldapConfiguration = ldapConfiguration;
     }
 
 
-    protected void setExtendedOperationHandlers( Collection handlers )
+    public LdapConfiguration getLdapConfiguration()
     {
-        for ( Iterator i = handlers.iterator(); i.hasNext(); )
-        {
-            if ( !( i.next() instanceof ExtendedOperationHandler ) )
-            {
-                throw new IllegalArgumentException(
-                    "The specified handler collection contains an element which is not an
ExtendedOperationHandler." );
-            }
-        }
-
-        this.extendedOperationHandlers.clear();
-        this.extendedOperationHandlers.addAll( handlers );
+        return ldapConfiguration;
     }
 
 
-    public File getLdifDirectory()
+    protected void setLdapsConfiguration( LdapConfiguration ldapsConfiguration )
     {
-        return this.ldifDirectory;
+        this.ldapsConfiguration = ldapsConfiguration;
     }
 
 
-    protected void setLdifDirectory( File ldifDirectory )
+    public LdapConfiguration getLdapsConfiguration()
     {
-        this.ldifDirectory = ldifDirectory;
+        return ldapsConfiguration;
     }
 
 
-    public List getLdifFilters()
+    protected void setNtpConfiguration( NtpConfiguration ntpConfiguration )
     {
-        return new ArrayList( ldifFilters );
+        this.ntpConfiguration = ntpConfiguration;
     }
 
 
-    protected void setLdifFilters( List filters )
+    public NtpConfiguration getNtpConfiguration()
     {
-        for ( int ii = 0; ii < filters.size(); ii++ )
-        {
-            if ( !( filters.get( ii ) instanceof LdifLoadFilter ) )
-            {
-                throw new IllegalArgumentException(
-                    "The specified filter collection contains an element which is not an
LdifLoadFilter." );
-            }
-        }
-
-        this.ldifFilters.clear();
-        this.ldifFilters.addAll( filters );
+        return ntpConfiguration;
     }
 
 
-    protected void setSynchPeriodMillis( long synchPeriodMillis )
+    protected void setChangePasswordConfiguration( ChangePasswordConfiguration changePasswordConfiguration
)
     {
-        this.synchPeriodMillis = synchPeriodMillis;
+        this.changePasswordConfiguration = changePasswordConfiguration;
     }
 
 
-    public long getSynchPeriodMillis()
+    public ChangePasswordConfiguration getChangePasswordConfiguration()
     {
-        return synchPeriodMillis;
+        return changePasswordConfiguration;
     }
 }



Mime
View raw message