directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r541149 [3/3] - in /directory/apacheds/trunk: ./ constants/src/main/java/org/apache/directory/server/ldap/ constants/src/main/java/org/apache/directory/server/ldap/constants/ core/src/main/java/org/apache/directory/server/core/ core/src/mai...
Date Thu, 24 May 2007 04:08:58 GMT
Modified: directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
(original)
+++ directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java
Wed May 23 21:08:50 2007
@@ -23,7 +23,6 @@
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.Hashtable;
@@ -42,15 +41,20 @@
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.jndi.CoreContextFactory;
 import org.apache.directory.server.core.partition.PartitionNexus;
+import org.apache.directory.server.dns.DnsConfiguration;
+import org.apache.directory.server.dns.DnsServer;
+import org.apache.directory.server.dns.store.JndiRecordStoreImpl;
+import org.apache.directory.server.dns.store.RecordStore;
 import org.apache.directory.server.kerberos.kdc.KdcConfiguration;
 import org.apache.directory.server.kerberos.kdc.KerberosServer;
 import org.apache.directory.server.kerberos.shared.store.JndiPrincipalStoreImpl;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
 import org.apache.directory.server.ldap.ExtendedOperationHandler;
+import org.apache.directory.server.ldap.LdapConfiguration;
 import org.apache.directory.server.ldap.LdapProtocolProvider;
+import org.apache.directory.server.ldap.support.ssl.LdapsInitializer;
 import org.apache.directory.server.ntp.NtpConfiguration;
 import org.apache.directory.server.ntp.NtpServer;
-import org.apache.directory.server.protocol.shared.LoadStrategy;
 import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.exception.LdapConfigurationException;
@@ -69,7 +73,6 @@
 import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 import org.apache.mina.transport.socket.nio.SocketSessionConfig;
-
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -96,7 +99,7 @@
     protected static IoAcceptor udpAcceptor;
     protected static ThreadPoolExecutor threadPoolExecutor;
     protected static ExecutorThreadModel threadModel = ExecutorThreadModel.getInstance( "ApacheDS"
);
-    
+
     private static boolean ldapStarted;
     private static boolean ldapsStarted;
     private static KerberosServer tcpKdcServer;
@@ -105,6 +108,7 @@
     private static ChangePasswordServer udpChangePasswordServer;
     private static NtpServer tcpNtpServer;
     private static NtpServer udpNtpServer;
+    private static DnsServer udpDnsServer;
     private DirectoryService directoryService;
 
     /**
@@ -116,10 +120,10 @@
     public void beforeStartup( DirectoryService service )
     {
         int maxThreads = service.getConfiguration().getStartupConfiguration().getMaxThreads();
-        threadPoolExecutor = new ThreadPoolExecutor( maxThreads, maxThreads, 60, TimeUnit.SECONDS,

+        threadPoolExecutor = new ThreadPoolExecutor( maxThreads, maxThreads, 60, TimeUnit.SECONDS,
             new LinkedBlockingQueue() );
         threadModel.setExecutor( threadPoolExecutor );
-        
+
         udpAcceptor = new DatagramAcceptor();
         tcpAcceptor = new SocketAcceptor(
             Runtime.getRuntime().availableProcessors(), threadPoolExecutor );
@@ -130,18 +134,21 @@
 
     public void afterShutdown( DirectoryService service )
     {
-        ServerStartupConfiguration cfg = ( ServerStartupConfiguration ) 
-            service.getConfiguration().getStartupConfiguration();
-        
+        ServerStartupConfiguration cfg = ( ServerStartupConfiguration ) service.getConfiguration()
+            .getStartupConfiguration();
+
+        LdapConfiguration ldapCfg = cfg.getLdapConfiguration();
+        LdapConfiguration ldapsCfg = cfg.getLdapsConfiguration();
+
         if ( ldapStarted )
         {
-            stopLDAP0( cfg.getLdapPort() );
+            stopLDAP0( ldapCfg.getIpPort() );
             ldapStarted = false;
         }
 
         if ( ldapsStarted )
         {
-            stopLDAP0( cfg.getLdapsPort() );
+            stopLDAP0( ldapsCfg.getIpPort() );
             ldapsStarted = false;
         }
 
@@ -216,6 +223,16 @@
             
             udpNtpServer = null;
         }
+
+        if ( udpDnsServer != null )
+        {
+            udpDnsServer.destroy();
+            if ( log.isInfoEnabled() )
+            {
+                log.info( "Unbind of DNS Service complete: " + udpDnsServer );
+            }
+            udpDnsServer = null;
+        }
     }
 
 
@@ -224,16 +241,25 @@
         ServerStartupConfiguration cfg = ( ServerStartupConfiguration ) service.getConfiguration()
             .getStartupConfiguration();
         Hashtable env = service.getConfiguration().getEnvironment();
+        LdapConfiguration ldapCfg = cfg.getLdapConfiguration();
+        LdapConfiguration ldapsCfg = cfg.getLdapsConfiguration();
+
+        if ( !cfg.isAllowAnonymousAccess() )
+        {
+            ldapCfg.setAllowAnonymousAccess( false );
+            ldapsCfg.setAllowAnonymousAccess( false );
+        }
 
         loadLdifs( service );
 
         if ( cfg.isEnableNetworking() )
         {
-            startLDAP( cfg, env );
-            startLDAPS( cfg, env );
-            startKerberos( cfg, env );
-            startChangePassword( cfg, env );
-            startNTP( cfg, env );
+            startLDAP( ldapCfg, env );
+            startLDAPS( ldapsCfg, env );
+            startKerberos( cfg.getKdcConfiguration() );
+            startChangePassword( cfg.getChangePasswordConfiguration() );
+            startNTP( cfg.getNtpConfiguration() );
+            startDNS( cfg.getDnsConfiguration() );
         }
     }
 
@@ -423,17 +449,17 @@
      *
      * @throws NamingException if there are problems starting the LDAP provider
      */
-    private void startLDAP( ServerStartupConfiguration cfg, Hashtable env ) throws NamingException
+    private void startLDAP( LdapConfiguration ldapConfig, Hashtable env ) throws NamingException
     {
         // Skip if disabled
-        int port = cfg.getLdapPort();
-        
-        if ( port < 0 )
+        if ( !ldapConfig.isEnabled() )
         {
             return;
         }
 
-        startLDAP0( cfg, env, port, new DefaultIoFilterChainBuilder() );
+        DefaultIoFilterChainBuilder chain = new DefaultIoFilterChainBuilder();
+
+        startLDAP0( ldapConfig, env, ldapConfig.getIpPort(), chain );
     }
 
 
@@ -442,53 +468,31 @@
      *
      * @throws NamingException if there are problems starting the LDAPS provider
      */
-    private void startLDAPS( ServerStartupConfiguration cfg, Hashtable env ) throws NamingException
+    private void startLDAPS( LdapConfiguration ldapsConfig, Hashtable env ) throws NamingException
     {
         // Skip if disabled
-        if ( !cfg.isEnableLdaps() )
+        if ( !( ldapsConfig.isEnabled() && ldapsConfig.isEnableLdaps() ) )
         {
             return;
         }
 
-        // We use the reflection API in case this is not running on JDK 1.5+.
-        IoFilterChainBuilder chain;
-        
-        try
-        {
-            chain = ( IoFilterChainBuilder ) Class.forName( "org.apache.directory.server.ssl.LdapsInitializer",
true,
-                ServerContextFactory.class.getClassLoader() ).getMethod( "init", new Class[]
-                { ServerStartupConfiguration.class } ).invoke( null, new Object[]
-                { cfg } );
-            ldapsStarted = true;
-        }
-        catch ( InvocationTargetException e )
-        {
-            if ( e.getCause() instanceof NamingException )
-            {
-                throw ( NamingException ) e.getCause();
-            }
-            else
-            {
-                throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer."
).initCause( e
-                    .getCause() );
-            }
-        }
-        catch ( Exception e )
-        {
-            throw ( NamingException ) new NamingException( "Failed to load LDAPS initializer."
).initCause( e );
-        }
+        char[] certPasswordChars = ldapsConfig.getLdapsCertificatePassword().toCharArray();
+        String storePath = ldapsConfig.getLdapsCertificateFile().getPath();
 
-        startLDAP0( cfg, env, cfg.getLdapsPort(), chain );
+        IoFilterChainBuilder chain = LdapsInitializer.init( certPasswordChars, storePath
);
+        ldapsStarted = true;
+
+        startLDAP0( ldapsConfig, env, ldapsConfig.getIpPort(), chain );
     }
 
 
-    private void startLDAP0( ServerStartupConfiguration cfg, Hashtable env, int port,
-        IoFilterChainBuilder chainBuilder ) throws LdapNamingException, LdapConfigurationException
+    private void startLDAP0( LdapConfiguration ldapConfig, Hashtable env, int port, IoFilterChainBuilder
chainBuilder )
+        throws LdapNamingException, LdapConfigurationException
     {
         // Register all extended operation handlers.
-        LdapProtocolProvider protocolProvider = new LdapProtocolProvider( cfg, ( Hashtable
) env.clone() );
+        LdapProtocolProvider protocolProvider = new LdapProtocolProvider( ldapConfig, ( Hashtable
) env.clone() );
 
-        for ( Iterator i = cfg.getExtendedOperationHandlers().iterator(); i.hasNext(); )
+        for ( Iterator i = ldapConfig.getExtendedOperationHandlers().iterator(); i.hasNext();
)
         {
             ExtendedOperationHandler h = ( ExtendedOperationHandler ) i.next();
             protocolProvider.addExtendedOperationHandler( h );
@@ -506,12 +510,12 @@
             acceptorCfg.setReuseAddress( true );
             acceptorCfg.setFilterChainBuilder( chainBuilder );
             acceptorCfg.setThreadModel( threadModel );
-            
-            ((SocketSessionConfig)(acceptorCfg.getSessionConfig())).setTcpNoDelay( true );
-            
+
+            ( ( SocketSessionConfig ) ( acceptorCfg.getSessionConfig() ) ).setTcpNoDelay(
true );
+
             tcpAcceptor.bind( new InetSocketAddress( port ), protocolProvider.getHandler(),
acceptorCfg );
             ldapStarted = true;
-            
+
             if ( log.isInfoEnabled() )
             {
                 log.info( "Successful bind of an LDAP Service (" + port + ") is complete."
);
@@ -528,91 +532,117 @@
     }
 
 
-    private void startKerberos( ServerStartupConfiguration cfg, Hashtable env )
+    private void startKerberos( KdcConfiguration kdcConfig )
     {
-        if ( cfg.isEnableKerberos() )
+        // Skip if disabled
+        if ( !kdcConfig.isEnabled() )
         {
-            try
-            {
-                KdcConfiguration kdcConfiguration = new KdcConfiguration( env, LoadStrategy.PROPS
);
-                PrincipalStore kdcStore = new JndiPrincipalStoreImpl( kdcConfiguration, this
);
-                
-                DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-                udpConfig.setThreadModel( threadModel );
+            return;
+        }
 
-                SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
-                tcpConfig.setDisconnectOnUnbind( false );
-                tcpConfig.setReuseAddress( true );
-                tcpConfig.setFilterChainBuilder( new DefaultIoFilterChainBuilder() );
-                tcpConfig.setThreadModel( threadModel );
+        try
+        {
+            PrincipalStore kdcStore = new JndiPrincipalStoreImpl( kdcConfig, this );
 
-                tcpKdcServer = new KerberosServer( kdcConfiguration, tcpAcceptor, tcpConfig,
kdcStore );
-                udpKdcServer = new KerberosServer( kdcConfiguration, udpAcceptor, udpConfig,
kdcStore );
-            }
-            catch ( Throwable t )
-            {
-                log.error( "Failed to start the Kerberos service", t );
-            }
+            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
+            udpConfig.setThreadModel( threadModel );
+
+            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
+            tcpConfig.setDisconnectOnUnbind( false );
+            tcpConfig.setReuseAddress( true );
+            tcpConfig.setFilterChainBuilder( new DefaultIoFilterChainBuilder() );
+            tcpConfig.setThreadModel( threadModel );
+
+            tcpKdcServer = new KerberosServer( kdcConfig, tcpAcceptor, tcpConfig, kdcStore
);
+            udpKdcServer = new KerberosServer( kdcConfig, udpAcceptor, udpConfig, kdcStore
);
+        }
+        catch ( Throwable t )
+        {
+            log.error( "Failed to start the Kerberos service", t );
         }
     }
 
 
-    private void startChangePassword( ServerStartupConfiguration cfg, Hashtable env )
+    private void startChangePassword( ChangePasswordConfiguration changePasswordConfig )
     {
-        if ( cfg.isEnableChangePassword() )
+        // Skip if disabled
+        if ( !changePasswordConfig.isEnabled() )
         {
-            try
-            {
-                ChangePasswordConfiguration changePasswordConfiguration = new ChangePasswordConfiguration(
env,
-                    LoadStrategy.PROPS );
-                PrincipalStore store = new JndiPrincipalStoreImpl( changePasswordConfiguration,
this );
+            return;
+        }
 
-                DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-                udpConfig.setThreadModel( threadModel );
+        try
+        {
+            PrincipalStore store = new JndiPrincipalStoreImpl( changePasswordConfig, this
);
 
-                SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
-                tcpConfig.setDisconnectOnUnbind( false );
-                tcpConfig.setReuseAddress( true );
-                tcpConfig.setFilterChainBuilder( new DefaultIoFilterChainBuilder() );
-                tcpConfig.setThreadModel( threadModel );
+            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
+            udpConfig.setThreadModel( threadModel );
 
-                tcpChangePasswordServer = new ChangePasswordServer( changePasswordConfiguration,
tcpAcceptor, 
-                    tcpConfig, store );
-                udpChangePasswordServer = new ChangePasswordServer( changePasswordConfiguration,
udpAcceptor, 
-                    udpConfig, store );
-            }
-            catch ( Throwable t )
-            {
-                log.error( "Failed to start the Change Password service", t );
-            }
+            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
+            tcpConfig.setDisconnectOnUnbind( false );
+            tcpConfig.setReuseAddress( true );
+            tcpConfig.setFilterChainBuilder( new DefaultIoFilterChainBuilder() );
+            tcpConfig.setThreadModel( threadModel );
+
+            tcpChangePasswordServer = new ChangePasswordServer( changePasswordConfig, tcpAcceptor,
tcpConfig, store );
+            udpChangePasswordServer = new ChangePasswordServer( changePasswordConfig, udpAcceptor,
udpConfig, store );
+        }
+        catch ( Throwable t )
+        {
+            log.error( "Failed to start the Change Password service", t );
         }
     }
 
 
-    private void startNTP( ServerStartupConfiguration cfg, Hashtable env )
+    private void startNTP( NtpConfiguration ntpConfig )
     {
-        if ( cfg.isEnableNtp() )
+        // Skip if disabled
+        if ( !ntpConfig.isEnabled() )
         {
-            try
-            {
-                NtpConfiguration ntpConfig = new NtpConfiguration( env, LoadStrategy.PROPS
);
+            return;
+        }
 
-                DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-                udpConfig.setThreadModel( threadModel );
+        try
+        {
+            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
+            udpConfig.setThreadModel( threadModel );
 
-                SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
-                tcpConfig.setDisconnectOnUnbind( false );
-                tcpConfig.setReuseAddress( true );
-                tcpConfig.setFilterChainBuilder( new DefaultIoFilterChainBuilder() );
-                tcpConfig.setThreadModel( threadModel );
+            SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
+            tcpConfig.setDisconnectOnUnbind( false );
+            tcpConfig.setReuseAddress( true );
+            tcpConfig.setFilterChainBuilder( new DefaultIoFilterChainBuilder() );
+            tcpConfig.setThreadModel( threadModel );
 
-                tcpNtpServer = new NtpServer( ntpConfig, tcpAcceptor, tcpConfig );
-                udpNtpServer = new NtpServer( ntpConfig, udpAcceptor, udpConfig );
-            }
-            catch ( Throwable t )
-            {
-                log.error( "Failed to start the NTP service", t );
-            }
+            tcpNtpServer = new NtpServer( ntpConfig, tcpAcceptor, tcpConfig );
+            udpNtpServer = new NtpServer( ntpConfig, udpAcceptor, udpConfig );
+        }
+        catch ( Throwable t )
+        {
+            log.error( "Failed to start the NTP service", t );
+        }
+    }
+
+
+    private void startDNS( DnsConfiguration dnsConfig )
+    {
+        // Skip if disabled
+        if ( !dnsConfig.isEnabled() )
+        {
+            return;
+        }
+
+        try
+        {
+            RecordStore store = new JndiRecordStoreImpl( dnsConfig, this );
+
+            DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
+            udpConfig.setThreadModel( threadModel );
+
+            udpDnsServer = new DnsServer( dnsConfig, udpAcceptor, udpConfig, store );
+        }
+        catch ( Throwable t )
+        {
+            log.error( "Failed to start the DNS service", t );
         }
     }
 

Modified: directory/apacheds/trunk/server-main/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-main/pom.xml?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-main/pom.xml (original)
+++ directory/apacheds/trunk/server-main/pom.xml Wed May 23 21:08:50 2007
@@ -12,9 +12,9 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.directory.server</groupId>
-      <artifactId>apacheds-server-ssl</artifactId>
+      <artifactId>apacheds-server-jndi</artifactId>
       <version>${pom.version}</version>
-    </dependency>  
+    </dependency>
     <dependency>
       <groupId>org.apache.directory.daemon</groupId>
       <artifactId>daemon-bootstrappers</artifactId>

Modified: directory/apacheds/trunk/server-main/server.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-main/server.xml?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-main/server.xml (original)
+++ directory/apacheds/trunk/server-main/server.xml Wed May 23 21:08:50 2007
@@ -7,13 +7,10 @@
   <bean id="environment" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
     <property name="properties">
       <props>
+        <!-- JNDI security properties used to get initial contexts.         -->
         <prop key="java.naming.security.authentication">simple</prop>
         <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
         <prop key="java.naming.security.credentials">secret</prop>
-        <!--<prop key="kdc.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
-        <!--<prop key="kdc.java.naming.security.credentials">secret</prop>-->
-        <!--<prop key="changepw.entryBaseDn">ou=users,dc=example,dc=com</prop>-->
-        <!--<prop key="changepw.java.naming.security.credentials">secret</prop>-->
         <!-- Set this key to a space delimited set of attributeType descriptions
              and their OID's if you want an attributeType to be handled as 
              binary content.
@@ -30,6 +27,100 @@
     </property>
   </bean>
   
+  <bean id="changePasswordConfiguration" class="org.apache.directory.server.changepw.ChangePasswordConfiguration">
+    <!-- Whether to enable the Change Password protocol.                    -->
+    <property name="enabled" value="true" />
+    <!-- The port to run the Change Password protocol on.                   -->
+    <property name="ipPort" value="464" />
+  </bean>
+  
+  <bean id="ntpConfiguration" class="org.apache.directory.server.ntp.NtpConfiguration">
+    <!-- Whether to enable the NTP protocol.                                -->
+    <property name="enabled" value="true" />
+    <!-- The port to run the NTP protocol on.                               -->
+    <property name="ipPort" value="123" />
+  </bean>
+  
+  <bean id="dnsConfiguration" class="org.apache.directory.server.dns.DnsConfiguration">
+    <!-- Whether to enable the DNS protocol.                                -->
+    <property name="enabled" value="true" />
+    <!-- The port to run the DNS protocol on.                               -->
+    <property name="ipPort" value="53" />
+  </bean>
+  
+  <bean id="kdcConfiguration" class="org.apache.directory.server.kerberos.kdc.KdcConfiguration">
+    <!-- Whether to enable the Kerberos protocol.                           -->
+    <property name="enabled" value="true" />
+    <!-- The port to run the Kerberos protocol on.                          -->
+    <property name="ipPort" value="88" />
+  </bean>
+  
+  <bean id="ldapsConfiguration" class="org.apache.directory.server.ldap.LdapConfiguration">
+    <!-- Whether to enable the LDAPS protocol.                               -->
+    <property name="enabled" value="false" />
+    <!-- The port to run the LDAPS protocol on.                              -->
+    <property name="ipPort" value="636" />
+  </bean>
+  
+  <bean id="ldapConfiguration" class="org.apache.directory.server.ldap.LdapConfiguration">
+    <!-- The port to run the LDAP protocol on.                              -->
+    <property name="ipPort" value="389" />
+    <!-- Whether to allow anonymous access.                                 -->
+    <property name="allowAnonymousAccess" value="false" />
+    
+    <!-- The list of supported authentication mechanisms.                   -->
+    <property name="supportedMechanisms">
+      <list>
+        <value>SIMPLE</value>
+        <value>CRAM-MD5</value>
+        <value>DIGEST-MD5</value>
+        <value>GSSAPI</value>
+      </list>
+    </property>
+    
+    <!-- The FQDN of this SASL host, validated during SASL negotiation.     -->
+    <property name="saslHost" value="ldap.example.com" />
+    
+    <!-- The Kerberos principal name for this LDAP service, used by GSSAPI. -->
+    <property name="saslPrincipal" value="ldap/ldap.example.com@EXAMPLE.COM" />
+    
+    <!-- The desired quality-of-protection, used by DIGEST-MD5 and GSSAPI.  -->
+    <property name="saslQop">
+      <list>
+        <value>auth</value>
+        <value>auth-int</value>
+        <value>auth-conf</value>
+      </list>
+    </property>
+    
+    <!-- The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI. -->
+    <property name="saslRealms">
+      <list>
+        <value>example.com</value>
+        <value>apache.org</value>
+      </list>
+    </property>
+    
+    <!-- The base DN containing users that can be SASL authenticated.       -->
+    <property name="searchBaseDn" value="ou=users,dc=example,dc=com" />
+    
+    <!-- SSL CONFIG CAN GO HERE-->
+    
+    <!-- limits searches by non-admin users to a max time of 15000          -->
+    <!-- milliseconds and has a default value of 10000                      -->
+    <property name="maxTimeLimit" value="15000" />
+    <!-- limits searches to max size of 1000 entries: default value is 100  -->
+    <property name="maxSizeLimit" value="1000" />
+    <!-- the collection of extended operation handlers to install           -->
+    <property name="extendedOperationHandlers">
+      <list>
+        <bean class="org.apache.directory.server.ldap.support.starttls.StartTlsHandler"/>
+        <bean class="org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler"/>
+        <bean class="org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler"/>
+      </list>
+    </property>
+  </bean>
+  
   <bean id="configuration" class="org.apache.directory.server.configuration.MutableServerStartupConfiguration">
     <property name="workingDirectory" value="example.com" />
 
@@ -37,20 +128,22 @@
     <!-- ldifDirectory property can point to a relative file, directory or  -->
     <!-- can point to an absolute path to either using the URL path         -->
     <!-- notation: i.e. file:///Users/jack/apacheds/ldifs                   -->
-
-    <!-- Entries will optionally be filtered using LdifLoadFilters in the   -->
-    <!-- order specified.  The included Krb5KdcEntryFilter will filter      -->
-    <!-- kerberos principals creating keys for them using their             -->
-    <!-- userPassword attribute if present.                                 -->
-
-    <!--<property name="ldifDirectory">
+    <!--
+    <property name="ldifDirectory">
       <value>example.ldif</value>
     </property>
+    -->
+
+    <!-- Entries will optionally be filtered using LdifLoadFilters in the   -->
+    <!-- order specified.  The included Krb5KdcEntryFilter will conflict    -->
+    <!-- with the KeyDerivationService interceptor, so should not be used.  -->
+    <!--
     <property name="ldifFilters">
       <list>
         <bean class="org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter"/>
       </list>
-    </property>-->
+    </property>
+    -->
 
     <!-- the number of milliseconds before issuing a synch (flush to disk)  -->
     <!-- which writes out dirty pages back to disk.  To turn off synchs all -->
@@ -59,20 +152,12 @@
     <!-- writes may never persist to disk.                                  -->
     <property name="synchPeriodMillis" value="15000" />
 
-    <!-- limits searches by non-admin users to a max time of 15000          -->
-    <!-- milliseconds and has a default value of 10000                      -->
-    <property name="maxTimeLimit" value="15000" />
-    <!-- limits searches to max size of 1000 entries: default value is 100  -->
-    <property name="maxSizeLimit" value="1000" />
     <!-- maximum number of threads used by mina is set to 8: default is 4   -->
     <property name="maxThreads" value="8" />
 
     <property name="allowAnonymousAccess" value="false" />
     <property name="accessControlEnabled" value="false" />
-    <property name="enableNtp" value="false" />
-    <property name="enableKerberos" value="false" />
-    <property name="enableChangePassword" value="false" />
-
+    
     <!--
        It's more efficient to keep this feature turned off but you may not like
        having the creatorsName and modifiersName contain OIDs instead of short
@@ -89,7 +174,12 @@
     -->
     <property name="denormalizeOpAttrsEnabled" value="false" />
 
-    <property name="ldapPort" value="10389" />
+    <property name="ntpConfiguration" ref="ntpConfiguration" />
+    <property name="dnsConfiguration" ref="dnsConfiguration" />
+    <property name="changePasswordConfiguration" ref="changePasswordConfiguration" />
+    <property name="kdcConfiguration" ref="kdcConfiguration" />
+    <property name="ldapConfiguration" ref="ldapConfiguration" />
+    <property name="ldapsConfiguration" ref="ldapsConfiguration" />
 
     <property name="systemPartitionConfiguration" ref="systemPartitionConfiguration" />
 
@@ -99,13 +189,6 @@
       </set>
     </property>
     
-    <property name="extendedOperationHandlers">
-      <list>
-        <bean class="org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler"/>
-        <bean class="org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler"/>
-      </list>
-    </property>
-
     <property name="interceptorConfigurations">
       <list>
         <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
@@ -151,6 +234,18 @@
           </property>
         </bean>
         <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="passwordPolicyService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.kerberos.shared.interceptors.PasswordPolicyService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name" value="keyDerivationService" />
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.kerberos.shared.interceptors.KeyDerivationService"
/>
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
           <property name="name" value="schemaService" />
           <property name="interceptor">
             <bean class="org.apache.directory.server.core.schema.SchemaService" />
@@ -256,7 +351,6 @@
           <property name="attributeId" value="1.3.6.1.4.1.18060.0.4.1.2.7" />
           <property name="cacheSize" value="10" />
         </bean>
-
         <bean class="org.apache.directory.server.core.partition.impl.btree.MutableIndexConfiguration">
           <property name="attributeId" value="ou" />
           <property name="cacheSize" value="100" />

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/diagnosticcmd/DiagnosticCommandExecutor.java
Wed May 23 21:08:50 2007
@@ -201,7 +201,7 @@
         }
         else if ( getConfiguration() != null )
         {
-            port = getConfiguration().getLdapPort();
+            port = getConfiguration().getLdapConfiguration().getIpPort();
 
             if ( isDebugEnabled() )
             {

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/disconnectnotificationcmd/DisconnectNotificationCommandExecutor.java
Wed May 23 21:08:50 2007
@@ -216,7 +216,7 @@
         }
         else if ( getConfiguration() != null )
         {
-            port = getConfiguration().getLdapPort();
+            port = getConfiguration().getLdapConfiguration().getIpPort();
 
             if ( isDebugEnabled() )
             {

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/exportcmd/ExportCommandExecutor.java
Wed May 23 21:08:50 2007
@@ -431,7 +431,7 @@
         }
         else if ( getConfiguration() != null )
         {
-            port = getConfiguration().getLdapPort();
+            port = getConfiguration().getLdapConfiguration().getIpPort();
 
             if ( isDebugEnabled() )
             {

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/gracefulshutdowncmd/GracefulShutdownCommandExecutor.java
Wed May 23 21:08:50 2007
@@ -251,7 +251,7 @@
         }
         else if ( getConfiguration() != null )
         {
-            port = getConfiguration().getLdapPort();
+            port = getConfiguration().getLdapConfiguration().getIpPort();
 
             if ( isDebugEnabled() )
             {

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/importcmd/ImportCommandExecutor.java
Wed May 23 21:08:50 2007
@@ -705,7 +705,7 @@
         }
         else if ( getConfiguration() != null )
         {
-            port = getConfiguration().getLdapPort();
+            port = getConfiguration().getLdapConfiguration().getIpPort();
 
             if ( isDebugEnabled() )
             {

Modified: directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
(original)
+++ directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/commands/storedprocedurecmd/StoredProcedureCommandExecutor.java
Wed May 23 21:08:50 2007
@@ -203,7 +203,7 @@
         }
         else if ( getConfiguration() != null )
         {
-            port = getConfiguration().getLdapPort();
+            port = getConfiguration().getLdapConfiguration().getIpPort();
 
             if ( isDebugEnabled() )
             {

Modified: directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
Wed May 23 21:08:50 2007
@@ -82,7 +82,7 @@
 
         doDelete( configuration.getWorkingDirectory() );
         port = AvailablePortFinder.getNextAvailable( 1024 );
-        configuration.setLdapPort( port );
+        configuration.getLdapConfiguration().setIpPort( port );
         configuration.setShutdownHookEnabled( false );
         setContexts( "uid=admin,ou=system", "secret" );
     }
@@ -139,7 +139,7 @@
         Hashtable<String, Object> envFinal = new Hashtable<String, Object>( env
);
         envFinal.put( Context.PROVIDER_URL, "ou=system" );
         sysRoot = new InitialLdapContext( envFinal, null );
-        
+
         envFinal.put( Context.PROVIDER_URL, "" );
         rootDSE = new InitialLdapContext( envFinal, null );
 
@@ -190,10 +190,10 @@
         try
         {
             Iterator iterator = new LdifReader( in );
-            
+
             while ( iterator.hasNext() )
             {
-                Entry entry = ( Entry) iterator.next();
+                Entry entry = ( Entry ) iterator.next();
                 LdapDN dn = new LdapDN( entry.getDn() );
                 rootDSE.createSubcontext( dn, entry.getAttributes() );
             }

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/DefaultServerTriggerServiceTest.java
Wed May 23 21:08:50 2007
@@ -31,6 +31,7 @@
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.server.ldap.LdapConfiguration;
 import org.apache.directory.server.ldap.support.extended.StoredProcedureExtendedOperationHandler;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.message.AttributeImpl;
@@ -53,9 +54,10 @@
     
     public void setUp() throws Exception
     {
-        Set handlers = new HashSet( super.configuration.getExtendedOperationHandlers() );
+        LdapConfiguration ldapCfg = super.configuration.getLdapConfiguration();
+        Set handlers = new HashSet( ldapCfg.getExtendedOperationHandlers() );
         handlers.add( new StoredProcedureExtendedOperationHandler() );
-        super.configuration.setExtendedOperationHandlers( handlers );
+        ldapCfg.setExtendedOperationHandlers( handlers );
         
         super.setUp();
 

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/KeyDerivationServiceITest.java
Wed May 23 21:08:50 2007
@@ -116,7 +116,7 @@
 
         doDelete( configuration.getWorkingDirectory() );
         port = AvailablePortFinder.getNextAvailable( 1024 );
-        configuration.setLdapPort( port );
+        configuration.getLdapConfiguration().setIpPort( port );
         configuration.setShutdownHookEnabled( false );
         setContexts( "uid=admin,ou=system", "secret" );
 

Modified: directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java?view=diff&rev=541149&r1=541148&r2=541149
==============================================================================
--- directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
(original)
+++ directory/apacheds/trunk/server-unit/src/test/java/org/apache/directory/server/StoredProcedureTest.java
Wed May 23 21:08:50 2007
@@ -29,6 +29,7 @@
 import javax.naming.ldap.InitialLdapContext;
 import javax.naming.ldap.LdapContext;
 
+import org.apache.directory.server.ldap.LdapConfiguration;
 import org.apache.directory.server.ldap.support.extended.StoredProcedureExtendedOperationHandler;
 import org.apache.directory.server.unit.AbstractServerTest;
 import org.apache.directory.shared.ldap.sp.JavaStoredProcedureUtils;
@@ -45,10 +46,11 @@
     
     public void setUp() throws Exception
     {
-        Set handlers = new HashSet( super.configuration.getExtendedOperationHandlers() );
+        LdapConfiguration ldapCfg = super.configuration.getLdapConfiguration();
+        Set handlers = new HashSet( ldapCfg.getExtendedOperationHandlers() );
         handlers.add( new StoredProcedureExtendedOperationHandler() );
-        super.configuration.setExtendedOperationHandlers( handlers );
-        
+        ldapCfg.setExtendedOperationHandlers( handlers );
+
         super.setUp();
 
         Hashtable env = new Hashtable();



Mime
View raw message