directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r584949 - in /directory: apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/ apacheds/branches/bigbang/protoco...
Date Mon, 15 Oct 2007 22:39:43 GMT
Author: akarasulu
Date: Mon Oct 15 15:39:36 2007
New Revision: 584949

URL: http://svn.apache.org/viewvc?rev=584949&view=rev
Log:
Cleaning up ServiceConfiguration with intermediate step and some interfaces: seems lots of unnecessary code was added even through inheritance was used.

Modified:
    directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
    directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
    directory/apacheds/branches/bigbang/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
    directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
    directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java
    directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java
    directory/apacheds/branches/bigbang/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
    directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
    directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java
    directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java
    directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java
    directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
    directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java

Modified: directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java (original)
+++ directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java Mon Oct 15 15:39:36 2007
@@ -28,14 +28,11 @@
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.changepw.protocol.ChangePasswordProtocolHandler;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.kerberos.shared.store.JndiPrincipalStoreImpl;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
 import org.apache.directory.server.protocol.shared.ServiceConfiguration;
-import org.apache.mina.transport.socket.nio.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.DatagramAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 
 
@@ -49,6 +46,7 @@
  */
 public class ChangePasswordServer extends ServiceConfiguration
 {
+    @SuppressWarnings ( { "UnusedDeclaration" } )
     private static final long serialVersionUID = 3509208713288140629L;
 
     /** The default change password principal name. */
@@ -68,7 +66,7 @@
         { "des-cbc-md5" };
 
     /** The default changepw buffer size. */
-    private static final long DEFAULT_ALLOWABLE_CLOCKSKEW = 5 * ServiceConfiguration.MINUTE;
+    private static final long DEFAULT_ALLOWABLE_CLOCKSKEW = 5 * 60000;
 
     /** The default empty addresses. */
     private static final boolean DEFAULT_EMPTY_ADDRESSES_ALLOWED = true;
@@ -112,15 +110,6 @@
     /** The policy for token size. */
     private int policyTokenSize;
 
-    /** DirectoryService backend for this server */
-    private DirectoryService directoryService;
-
-    /** DatagramAcceptor input for this server */
-    private DatagramAcceptor datagramAcceptor;
-
-    /** SocketAcceptor input for this server */
-    private SocketAcceptor socketAcceptor;
-
 
     /**
      * Creates a new instance of ChangePasswordConfiguration.
@@ -129,65 +118,12 @@
     {
         super.setServiceName( SERVICE_NAME_DEFAULT );
         super.setIpPort( IP_PORT_DEFAULT );
-        super.setServicePid( SERVICE_PID_DEFAULT );
+        super.setServiceId( SERVICE_PID_DEFAULT );
         super.setSearchBaseDn( SEARCH_BASEDN_DEFAULT );
 
         prepareEncryptionTypes();
     }
 
-    /**
-     * Returns the backend for this server
-     * @return DirectoryService backend for this server
-     */
-    public DirectoryService getDirectoryService()
-    {
-        return directoryService;
-    }
-
-    /**
-     * Set the backend for this server
-     * @param directoryService the DirectoryService backend for this server
-     */
-    public void setDirectoryService( DirectoryService directoryService )
-    {
-        this.directoryService = directoryService;
-    }
-
-    /**
-     * Returns the DatagramAcceptor input for this server
-     * @return DatagramAcceptor input for this server
-     */
-    public DatagramAcceptor getDatagramAcceptor()
-    {
-        return datagramAcceptor;
-    }
-
-    /**
-     * Set the DatagramAcceptor for this server
-     * @param datagramAcceptor the DatagramAcceptor input for this server
-     */
-    public void setDatagramAcceptor( DatagramAcceptor datagramAcceptor )
-    {
-        this.datagramAcceptor = datagramAcceptor;
-    }
-
-    /**
-     * Returns the SocketAcceptor for this server
-     * @return SocketAcceptor input for this server
-     */
-    public SocketAcceptor getSocketAcceptor()
-    {
-        return socketAcceptor;
-    }
-
-    /**
-     * Set the SocketAcceptor for this server
-     * @param socketAcceptor the SocketAcceptor input for this server
-     */
-    public void setSocketAcceptor( SocketAcceptor socketAcceptor )
-    {
-        this.socketAcceptor = socketAcceptor;
-    }
 
     /**
      * Returns the primary realm.
@@ -324,44 +260,50 @@
 
     /**
      * @org.apache.xbean.InitMethod
+     * @throws IOException if we cannot bind to the specified ports
      */
     public void start() throws IOException
     {
-        PrincipalStore store = new JndiPrincipalStoreImpl( getCatalogBaseDn(), getSearchBaseDn(), directoryService );
+        PrincipalStore store = new JndiPrincipalStoreImpl( getSearchBaseDn(),
+                getSearchBaseDn(), getDirectoryService() );
 
-        if ( datagramAcceptor != null )
+        if ( getDatagramAcceptor() != null )
         {
             DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-            datagramAcceptor.bind( new InetSocketAddress( getIpPort() ), new ChangePasswordProtocolHandler( this, store ), udpConfig );
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ),
+                    new ChangePasswordProtocolHandler( this, store ), udpConfig );
         }
 
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
             SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
             tcpConfig.setDisconnectOnUnbind( false );
             tcpConfig.setReuseAddress( true );
-            socketAcceptor.bind( new InetSocketAddress( getIpPort() ), new ChangePasswordProtocolHandler( this, store ), tcpConfig );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ),
+                    new ChangePasswordProtocolHandler( this, store ), tcpConfig );
         }
     }
 
+
     /**
      * @org.apache.xbean.DestroyMethod
      */
-    public void stop() {
-        if ( datagramAcceptor != null )
+    public void stop()
+    {
+        if ( getDatagramAcceptor() != null )
         {
-            datagramAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getDatagramAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
-            socketAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getSocketAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
     }
 
+
     private void prepareEncryptionTypes()
     {
         String[] encryptionTypeStrings = ENCRYPTION_TYPES_DEFAULT;
-
         List<EncryptionType> encTypes = new ArrayList<EncryptionType>();
 
         for ( String enc : encryptionTypeStrings )
@@ -376,5 +318,38 @@
         }
 
         encryptionTypes = encTypes.toArray( new EncryptionType[encTypes.size()] );
+    }
+
+
+    /**
+     * Sets the policy's minimum?? password length.
+     *
+     * @param policyPasswordLength the minimum password length requirement
+     */
+    public void setPolicyPasswordLength( int policyPasswordLength )
+    {
+        this.policyPasswordLength = policyPasswordLength;
+    }
+
+
+    /**
+     * Sets the policy category count - what's this?
+     *
+     * @param policyCategoryCount the policy category count
+     */
+    public void setPolicyCategoryCount( int policyCategoryCount )
+    {
+        this.policyCategoryCount = policyCategoryCount;
+    }
+
+
+    /**
+     * Sets the policy token size - what's this?
+     *
+     * @param policyTokenSize the policy token size
+     */
+    public void setPolicyTokenSize( int policyTokenSize )
+    {
+        this.policyTokenSize = policyTokenSize;
     }
 }

Modified: directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java (original)
+++ directory/apacheds/branches/bigbang/protocol-dns/src/main/java/org/apache/directory/server/dns/DnsServer.java Mon Oct 15 15:39:36 2007
@@ -23,14 +23,11 @@
 import java.io.IOException;
 import java.net.InetSocketAddress;
 
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.dns.protocol.DnsProtocolHandler;
 import org.apache.directory.server.dns.store.RecordStore;
 import org.apache.directory.server.dns.store.jndi.JndiRecordStoreImpl;
 import org.apache.directory.server.protocol.shared.ServiceConfiguration;
-import org.apache.mina.transport.socket.nio.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.DatagramAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 
 
@@ -44,6 +41,7 @@
  */
 public class DnsServer extends ServiceConfiguration
 {
+    @SuppressWarnings ( { "UnusedDeclaration" } )
     private static final long serialVersionUID = 6943138644427163149L;
 
     /** The default IP port. */
@@ -55,15 +53,6 @@
     /** The default service name. */
     private static final String SERVICE_NAME_DEFAULT = "ApacheDS DNS Service";
 
-    /** DirectoryService backend for this server */
-    private DirectoryService directoryService;
-
-    /** DatagramAcceptor input for this server */
-    private DatagramAcceptor datagramAcceptor;
-
-    /** SocketAcceptor input for this server */
-    private SocketAcceptor socketAcceptor;
-
 
     /**
      * Creates a new instance of DnsConfiguration.
@@ -71,83 +60,31 @@
     public DnsServer()
     {
         super.setIpPort( IP_PORT_DEFAULT );
-        super.setServicePid( SERVICE_PID_DEFAULT );
+        super.setServiceId( SERVICE_PID_DEFAULT );
         super.setServiceName( SERVICE_NAME_DEFAULT );
     }
 
-    /**
-     * Returns the backend for this server
-     * @return DirectoryService backend for this server
-     */
-    public DirectoryService getDirectoryService()
-    {
-        return directoryService;
-    }
-
-    /**
-     * Set the backend for this server
-     * @param directoryService the DirectoryService backend for this server
-     */
-    public void setDirectoryService( DirectoryService directoryService )
-    {
-        this.directoryService = directoryService;
-    }
-
-    /**
-     * Returns the DatagramAcceptor input for this server
-     * @return DatagramAcceptor input for this server
-     */
-    public DatagramAcceptor getDatagramAcceptor()
-    {
-        return datagramAcceptor;
-    }
-
-    /**
-     * Set the DatagramAcceptor for this server
-     * @param datagramAcceptor the DatagramAcceptor input for this server
-     */
-    public void setDatagramAcceptor( DatagramAcceptor datagramAcceptor )
-    {
-        this.datagramAcceptor = datagramAcceptor;
-    }
-
-    /**
-     * Returns the SocketAcceptor for this server
-     * @return SocketAcceptor input for this server
-     */
-    public SocketAcceptor getSocketAcceptor()
-    {
-        return socketAcceptor;
-    }
-
-    /**
-     * Set the SocketAcceptor for this server
-     * @param socketAcceptor the SocketAcceptor input for this server
-     */
-    public void setSocketAcceptor( SocketAcceptor socketAcceptor )
-    {
-        this.socketAcceptor = socketAcceptor;
-    }
 
     /**
      * @org.apache.xbean.InitMethod
+     * @throws IOException if we cannot bind to the specified ports
      */
     public void start() throws IOException
     {
-        RecordStore store = new JndiRecordStoreImpl( getCatalogBaseDn(), getSearchBaseDn(), directoryService );
+        RecordStore store = new JndiRecordStoreImpl( getSearchBaseDn(), getSearchBaseDn(), getDirectoryService() );
 
-        if ( datagramAcceptor != null )
+        if ( getDatagramAcceptor() != null )
         {
             DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-            datagramAcceptor.bind( new InetSocketAddress( getIpPort() ), new DnsProtocolHandler( this, store ), udpConfig );
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ), new DnsProtocolHandler( this, store ), udpConfig );
         }
 
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
             SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
             tcpConfig.setDisconnectOnUnbind( false );
             tcpConfig.setReuseAddress( true );
-            socketAcceptor.bind( new InetSocketAddress( getIpPort() ), new DnsProtocolHandler( this, store ), tcpConfig );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ), new DnsProtocolHandler( this, store ), tcpConfig );
         }
     }
 
@@ -155,13 +92,13 @@
      * @org.apache.xbean.DestroyMethod
      */
     public void stop() {
-        if ( datagramAcceptor != null )
+        if ( getDatagramAcceptor() != null )
         {
-            datagramAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getDatagramAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
-            socketAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getSocketAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
     }
 }

Modified: directory/apacheds/branches/bigbang/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java (original)
+++ directory/apacheds/branches/bigbang/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java Mon Oct 15 15:39:36 2007
@@ -27,15 +27,12 @@
 
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.kerberos.protocol.KerberosProtocolHandler;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.kerberos.shared.store.JndiPrincipalStoreImpl;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
 import org.apache.directory.server.protocol.shared.ServiceConfiguration;
-import org.apache.mina.transport.socket.nio.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.DatagramAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 
 
@@ -49,6 +46,7 @@
  */
 public class KdcServer extends ServiceConfiguration
 {
+    @SuppressWarnings ( { "UnusedDeclaration" } )
     private static final long serialVersionUID = 522567370475574165L;
 
     /** The default kdc port */
@@ -70,7 +68,7 @@
     private static final String DEFAULT_REALM = "EXAMPLE.COM";
 
     /** The default allowable clockskew */
-    private static final long DEFAULT_ALLOWABLE_CLOCKSKEW = 5 * MINUTE;
+    private static final long DEFAULT_ALLOWABLE_CLOCKSKEW = 5 * 60000;
 
     /** The default encryption types */
     private static final String[] DEFAULT_ENCRYPTION_TYPES = new String[]
@@ -83,10 +81,10 @@
     private static final boolean DEFAULT_PA_ENC_TIMESTAMP_REQUIRED = true;
 
     /** The default for the maximum ticket lifetime */
-    private static final int DEFAULT_TGS_MAXIMUM_TICKET_LIFETIME = MINUTE * 1440;
+    private static final int DEFAULT_TGS_MAXIMUM_TICKET_LIFETIME = 60000 * 1440;
 
     /** The default for the maximum renewable lifetime */
-    private static final int DEFAULT_TGS_MAXIMUM_RENEWABLE_LIFETIME = MINUTE * 10080;
+    private static final int DEFAULT_TGS_MAXIMUM_RENEWABLE_LIFETIME = 60000 * 10080;
 
     /** The default for allowing forwardable tickets */
     private static final boolean DEFAULT_TGS_FORWARDABLE_ALLOWED = true;
@@ -143,15 +141,6 @@
     private boolean isBodyChecksumVerified = DEFAULT_VERIFY_BODY_CHECKSUM;
 
 
-    /** DirectoryService backend for this server */
-    private DirectoryService directoryService;
-
-    /** DatagramAcceptor input for this server */
-    private DatagramAcceptor datagramAcceptor;
-
-    /** SocketAcceptor input for this server */
-    private SocketAcceptor socketAcceptor;
-
     /**
      * Creates a new instance of KdcConfiguration.
      */
@@ -159,66 +148,12 @@
     {
         super.setServiceName( DEFAULT_NAME );
         super.setIpPort( DEFAULT_IP_PORT );
-        super.setServicePid( DEFAULT_PID );
+        super.setServiceId( DEFAULT_PID );
         super.setSearchBaseDn( DEFAULT_SEARCH_BASEDN );
 
         prepareEncryptionTypes();
     }
 
-    /**
-     * Returns the backend for this server
-     * @return DirectoryService backend for this server
-     */
-    public DirectoryService getDirectoryService()
-    {
-        return directoryService;
-    }
-
-    /**
-     * Set the backend for this server
-     * @param directoryService the DirectoryService backend for this server
-     */
-    public void setDirectoryService( DirectoryService directoryService )
-    {
-        this.directoryService = directoryService;
-    }
-
-    /**
-     * Returns the DatagramAcceptor input for this server
-     * @return DatagramAcceptor input for this server
-     */
-    public DatagramAcceptor getDatagramAcceptor()
-    {
-        return datagramAcceptor;
-    }
-
-    /**
-     * Set the DatagramAcceptor for this server
-     * @param datagramAcceptor the DatagramAcceptor input for this server
-     */
-    public void setDatagramAcceptor( DatagramAcceptor datagramAcceptor )
-    {
-        this.datagramAcceptor = datagramAcceptor;
-    }
-
-    /**
-     * Returns the SocketAcceptor for this server
-     * @return SocketAcceptor input for this server
-     */
-    public SocketAcceptor getSocketAcceptor()
-    {
-        return socketAcceptor;
-    }
-
-    /**
-     * Set the SocketAcceptor for this server
-     * @param socketAcceptor the SocketAcceptor input for this server
-     */
-    public void setSocketAcceptor( SocketAcceptor socketAcceptor )
-    {
-        this.socketAcceptor = socketAcceptor;
-    }
-
 
     /**
      * Returns the allowable clock skew.
@@ -466,37 +401,41 @@
 
     /**
      * @org.apache.xbean.InitMethod
+     * @throws IOException if we cannot bind to the sockets
      */
     public void start() throws IOException
     {
-        PrincipalStore store = new JndiPrincipalStoreImpl( getCatalogBaseDn(), getSearchBaseDn(), directoryService );
+        PrincipalStore store = new JndiPrincipalStoreImpl( getSearchBaseDn(),
+                getSearchBaseDn(), getDirectoryService() );
 
-        if ( datagramAcceptor != null )
+        if ( getDatagramAcceptor() != null )
         {
             DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-            datagramAcceptor.bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), udpConfig );
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), udpConfig );
         }
 
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
             SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
             tcpConfig.setDisconnectOnUnbind( false );
             tcpConfig.setReuseAddress( true );
-            socketAcceptor.bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), tcpConfig );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ), new KerberosProtocolHandler( this, store ), tcpConfig );
         }
     }
 
+    
     /**
      * @org.apache.xbean.DestroyMethod
      */
-    public void stop() {
-        if ( datagramAcceptor != null )
+    public void stop()
+    {
+        if ( getDatagramAcceptor() != null )
         {
-            datagramAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getDatagramAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
-            socketAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getSocketAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
     }
 

Modified: directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java (original)
+++ directory/apacheds/branches/bigbang/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java Mon Oct 15 15:39:36 2007
@@ -87,9 +87,6 @@
         kdcConfig.setDirectoryService( directoryService );
         kdcConfig.setEnabled( true );
         kdcConfig.setSearchBaseDn( "ou=users,dc=example,dc=com" );
-        kdcConfig.setSecurityAuthentication( "simple" );
-        kdcConfig.setSecurityCredentials( "secret" );
-        kdcConfig.setSecurityPrincipal( "uid=admin,ou=system" );
 
         Attributes attrs;
 

Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java Mon Oct 15 15:39:36 2007
@@ -106,7 +106,6 @@
 import org.apache.mina.filter.codec.ProtocolDecoder;
 import org.apache.mina.filter.codec.ProtocolEncoder;
 import org.apache.mina.handler.demux.DemuxingIoHandler;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 import org.apache.mina.util.SessionLog;
 import org.slf4j.Logger;
@@ -211,34 +210,18 @@
     /** the MINA protocol handler */
     private final LdapProtocolHandler handler = new LdapProtocolHandler();
 
-    private final SocketAcceptor socketAcceptor;
-
-    private final DirectoryService directoryService;
-
     /** tracks state of the server */
     private boolean started;
 
 
     /**
      * Creates an LDAP protocol provider.
-     *
-     * @param socketAcceptor the mina socket acceptor wrapper
-     * @param directoryService the directory service core
      */
-    public LdapServer( SocketAcceptor socketAcceptor, DirectoryService directoryService )
+    public LdapServer()
     {
-        this.socketAcceptor = socketAcceptor;
-        this.directoryService = directoryService;
-        this.codecFactory = new ProtocolCodecFactoryImpl( directoryService );
-        Hashtable<String,Object> copy = new Hashtable<String,Object>();
-        copy.put( Context.PROVIDER_URL, "" );
-        copy.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
-        copy.put( DirectoryService.JNDI_KEY, directoryService );
-        this.registry = new SessionRegistry( this, copy );
-
         super.setIpPort( IP_PORT_DEFAULT );
         super.setEnabled( true );
-        super.setServicePid( SERVICE_PID_DEFAULT );
+        super.setServiceId( SERVICE_PID_DEFAULT );
         super.setServiceName( SERVICE_NAME_DEFAULT );
 
         supportedMechanisms = new HashSet<String>();
@@ -324,7 +307,7 @@
             try
             {
                 sessions = new ArrayList<IoSession>(
-                        socketAcceptor.getManagedSessions( new InetSocketAddress( getIpPort() ) ) );
+                        getSocketAcceptor().getManagedSessions( new InetSocketAddress( getIpPort() ) ) );
             }
             catch ( IllegalArgumentException e )
             {
@@ -332,7 +315,7 @@
                 return;
             }
 
-            socketAcceptor.unbind( new InetSocketAddress( getIpPort() ) );
+            getSocketAcceptor().unbind( new InetSocketAddress( getIpPort() ) );
 
             if ( LOG.isInfoEnabled() )
             {
@@ -373,7 +356,7 @@
             addExtendedOperationHandler( h );
             LOG.info( "Added Extended Request Handler: " + h.getOid() );
             h.setLdapProvider( this );
-            PartitionNexus nexus = directoryService.getPartitionNexus();
+            PartitionNexus nexus = getDirectoryService().getPartitionNexus();
             nexus.registerSupportedExtensions( h.getExtensionOids() );
         }
 
@@ -389,7 +372,7 @@
 
             acceptorCfg.getSessionConfig().setTcpNoDelay( true );
 
-            socketAcceptor.bind( new InetSocketAddress( port ), getHandler(), acceptorCfg );
+            getSocketAcceptor().bind( new InetSocketAddress( port ), getHandler(), acceptorCfg );
             started = true;
 
             if ( LOG.isInfoEnabled() )
@@ -769,9 +752,15 @@
     }
 
 
-    public DirectoryService getDirectoryService()
+    public void setDirectoryService( DirectoryService directoryService )
     {
-        return directoryService;
+        super.setDirectoryService( directoryService );
+        this.codecFactory = new ProtocolCodecFactoryImpl( directoryService );
+        Hashtable<String,Object> copy = new Hashtable<String,Object>();
+        copy.put( Context.PROVIDER_URL, "" );
+        copy.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
+        copy.put( DirectoryService.JNDI_KEY, directoryService );
+        this.registry = new SessionRegistry( this, copy );
     }
 
 
@@ -830,7 +819,7 @@
         this.handler.removeMessageHandler( BindRequest.class );
         this.bindHandler = bindHandler;
         this.bindHandler.setProtocolProvider( this );
-            this.bindHandler.setDirectoryService( directoryService );
+            this.bindHandler.setDirectoryService( getDirectoryService() );
         //noinspection unchecked
         this.handler.addMessageHandler( BindRequest.class, this.bindHandler );
     }

Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/bind/ConfigureChain.java Mon Oct 15 15:39:36 2007
@@ -20,6 +20,8 @@
 package org.apache.directory.server.ldap.support.bind;
 
 
+import org.apache.directory.server.core.authn.LdapPrincipal;
+import org.apache.directory.server.core.partition.PartitionNexus;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
 import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntry;
@@ -28,15 +30,15 @@
 import org.apache.directory.server.ldap.constants.SupportedSASLMechanisms;
 import org.apache.directory.server.protocol.shared.ServiceConfigurationException;
 import org.apache.directory.server.protocol.shared.store.ContextOperation;
+import org.apache.directory.shared.ldap.aci.AuthenticationLevel;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.chain.IoHandlerCommand;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.naming.Context;
 import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
-import javax.naming.ldap.InitialLdapContext;
 import javax.security.auth.Subject;
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
@@ -204,34 +206,21 @@
 
     private Object execute( LdapServer ldapServer, ContextOperation operation ) throws Exception
     {
-        Hashtable<String, Object> env = getEnvironment( ldapServer );
-
         if ( ctx == null )
         {
             try
             {
-                ctx = new InitialLdapContext( env, null );
+                LdapPrincipal principal = new LdapPrincipal(
+                        new LdapDN( PartitionNexus.ADMIN_PRINCIPAL ), AuthenticationLevel.SIMPLE );
+                ctx = ldapServer.getDirectoryService().getJndiContext( principal, ldapServer.getSearchBaseDn() );
             }
             catch ( NamingException ne )
             {
-                String message = "Failed to get initial context " + env.get( Context.PROVIDER_URL );
+                String message = "Failed to get initial context " + ldapServer.getSearchBaseDn();
                 throw new ServiceConfigurationException( message, ne );
             }
         }
 
         return operation.execute( ctx, null );
-    }
-
-
-    private Hashtable<String, Object> getEnvironment( LdapServer ldapServer )
-    {
-        Hashtable<String, Object> env = new Hashtable<String, Object>();
-        env.put( Context.INITIAL_CONTEXT_FACTORY, ldapServer.getInitialContextFactory() );
-        env.put( Context.PROVIDER_URL, ldapServer.getSearchBaseDn() );
-        env.put( Context.SECURITY_AUTHENTICATION, ldapServer.getSecurityAuthentication() );
-        env.put( Context.SECURITY_CREDENTIALS, ldapServer.getSecurityCredentials() );
-        env.put( Context.SECURITY_PRINCIPAL, ldapServer.getSecurityPrincipal() );
-
-        return env;
     }
 }

Modified: directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerTest.java Mon Oct 15 15:39:36 2007
@@ -32,8 +32,6 @@
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.SimpleByteBufferAllocator;
 import org.apache.mina.util.AvailablePortFinder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 
 /**
@@ -45,11 +43,8 @@
  */
 public class LdapServerTest extends TestCase
 {
-    private static final Logger LOG = LoggerFactory.getLogger( LdapServerTest.class.getName() );
     LdapServer ldapServer;
     DirectoryService directoryService;
-//    ExecutorService ioExecutor;
-//    ExecutorService logicExecutor;
     SocketAcceptor tcpAcceptor;
 
 
@@ -62,7 +57,9 @@
         ByteBuffer.setUseDirectBuffers( false );
         tcpAcceptor = new SocketAcceptor( null );
 
-        ldapServer = new LdapServer( tcpAcceptor, directoryService );
+        ldapServer = new LdapServer();
+        ldapServer.setSocketAcceptor( tcpAcceptor );
+        ldapServer.setDirectoryService( directoryService );
         ldapServer.setIpPort( AvailablePortFinder.getNextAvailable( 1024 ) );
         if ( getName().equals( "testAlternativeConfiguration" ) )
         {

Modified: directory/apacheds/branches/bigbang/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java (original)
+++ directory/apacheds/branches/bigbang/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java Mon Oct 15 15:39:36 2007
@@ -25,9 +25,7 @@
 
 import org.apache.directory.server.ntp.protocol.NtpProtocolHandler;
 import org.apache.directory.server.protocol.shared.ServiceConfiguration;
-import org.apache.mina.transport.socket.nio.DatagramAcceptor;
 import org.apache.mina.transport.socket.nio.DatagramAcceptorConfig;
-import org.apache.mina.transport.socket.nio.SocketAcceptor;
 import org.apache.mina.transport.socket.nio.SocketAcceptorConfig;
 
 
@@ -58,12 +56,6 @@
      */
     private static final String SERVICE_NAME_DEFAULT = "ApacheDS NTP Service";
 
-    /** DatagramAcceptor input for this server */
-    private DatagramAcceptor datagramAcceptor;
-
-    /** SocketAcceptor input for this server */
-    private SocketAcceptor socketAcceptor;
-
 
     /**
      * Creates a new instance of NtpConfiguration.
@@ -71,70 +63,30 @@
     public NtpServer()
     {
         super.setIpPort( IP_PORT_DEFAULT );
-        super.setServicePid( SERVICE_PID_DEFAULT );
+        super.setServiceId( SERVICE_PID_DEFAULT );
         super.setServiceName( SERVICE_NAME_DEFAULT );
     }
 
     
     /**
-     * Returns the DatagramAcceptor input for this server
-     * @return DatagramAcceptor input for this server
-     */
-    public DatagramAcceptor getDatagramAcceptor()
-    {
-        return datagramAcceptor;
-    }
-
-
-    /**
-     * Set the DatagramAcceptor for this server
-     * @param datagramAcceptor the DatagramAcceptor input for this server
-     */
-    public void setDatagramAcceptor( DatagramAcceptor datagramAcceptor )
-    {
-        this.datagramAcceptor = datagramAcceptor;
-    }
-
-
-    /**
-     * Returns the SocketAcceptor for this server
-     * @return SocketAcceptor input for this server
-     */
-    public SocketAcceptor getSocketAcceptor()
-    {
-        return socketAcceptor;
-    }
-
-
-    /**
-     * Set the SocketAcceptor for this server
-     * @param socketAcceptor the SocketAcceptor input for this server
-     */
-    public void setSocketAcceptor( SocketAcceptor socketAcceptor )
-    {
-        this.socketAcceptor = socketAcceptor;
-    }
-
-
-    /**
      * @org.apache.xbean.InitMethod
      * @throws IOException if there are issues binding
      */
     public void start() throws IOException
     {
         //If appropriate, the udp and tcp servers could be enabled with boolean flags.
-        if ( datagramAcceptor != null )
+        if ( getDatagramAcceptor() != null )
         {
             DatagramAcceptorConfig udpConfig = new DatagramAcceptorConfig();
-            datagramAcceptor.bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), udpConfig );
+            getDatagramAcceptor().bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), udpConfig );
         }
 
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
             SocketAcceptorConfig tcpConfig = new SocketAcceptorConfig();
             tcpConfig.setDisconnectOnUnbind( false );
             tcpConfig.setReuseAddress( true );
-            socketAcceptor.bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), tcpConfig );
+            getSocketAcceptor().bind( new InetSocketAddress( getIpPort() ), new NtpProtocolHandler(), tcpConfig );
         }
     }
 
@@ -144,13 +96,13 @@
      */
     public void stop()
     {
-        if ( datagramAcceptor != null )
+        if ( getDatagramAcceptor() != null )
         {
-            datagramAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getDatagramAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
-        if ( socketAcceptor != null )
+        if ( getSocketAcceptor() != null )
         {
-            socketAcceptor.unbind( new InetSocketAddress( getIpPort() ));
+            getSocketAcceptor().unbind( new InetSocketAddress( getIpPort() ));
         }
     }
 

Modified: directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java (original)
+++ directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java Mon Oct 15 15:39:36 2007
@@ -35,6 +35,7 @@
  */
 public abstract class AbstractProtocolService implements ProtocolService
 {
+    private boolean started;
     private boolean enabled;
     private String serviceId;
     private String serviceName;
@@ -44,6 +45,18 @@
     private DirectoryService directoryService;
     private DatagramAcceptor datagramAcceptor;
     private SocketAcceptor socketAcceptor;
+
+
+    public boolean isStarted()
+    {
+        return started;
+    }
+
+
+    protected void setStarted( boolean started )
+    {
+        this.started = started;
+    }
 
 
     public boolean isEnabled()

Modified: directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java (original)
+++ directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java Mon Oct 15 15:39:36 2007
@@ -49,6 +49,14 @@
 
 
     /**
+     * Gets whether or not this service has been started.
+     *
+     * @return true if the service has started, false otherwise
+     */
+    boolean isStarted();
+
+
+    /**
      * If this protocol service supports UDP transport then this gets the
      * non-null MINA DatagramAcceptor it uses.
      *
@@ -183,7 +191,7 @@
      *
      * @param transportProtocols the transport protocols to be used by this service
      */
-    void setTransportProtocols( TransportProtocol[] transportProtocols );
+    void setTransportProtocols( Set<TransportProtocol> transportProtocols );
 
 
     /**

Modified: directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java (original)
+++ directory/apacheds/branches/bigbang/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ServiceConfiguration.java Mon Oct 15 15:39:36 2007
@@ -20,47 +20,14 @@
 package org.apache.directory.server.protocol.shared;
 
 
-import java.util.Dictionary;
-
-import javax.naming.spi.InitialContextFactory;
-
-
 /**
  * Base class shared by all protocol providers for configuration.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public abstract class ServiceConfiguration
+public abstract class ServiceConfiguration extends AbstractProtocolService
 {
-    /** The prop key const for the port. */
-    public static final String IP_PORT_KEY = "ipPort";
-
-    /** The number of milliseconds in a minute. */
-    public static final int MINUTE = 60000;
-
-    /** The default MINA buffer size. */
-    public static final int DEFAULT_BUFFER_SIZE = 1024;
-
-    protected static final String SERVICE_PID = "service.pid";
-    protected static final String SERVICE_FACTORYPID = "service.factoryPid";
-
-    /** The MINA buffer size for this service. */
-    private int bufferSize;
-
-    /** The IP port for this service. */
-    private int ipPort;
-
-    /** The IP address for this service. */
-    private String ipAddress;
-
-    /**
-     * The single location where catalog entries are stored.  If this
-     * property is not set the store will expect a single search base
-     * DN to be set.
-     */
-    private String catalogBaseDn;
-
     /**
      * The single location where entries are stored.  If this
      * property is not set the store will search the system
@@ -68,163 +35,6 @@
      */
     private String searchBaseDn = "ou=users,dc=example,dc=com";
 
-    /** The JNDI initial context factory to use. */
-    private String initialContextFactory = "org.apache.directory.server.core.jndi.CoreContextFactory";
-
-    /** The authentication mechanism to use for establishing a JNDI context. */
-    private String securityAuthentication = "simple";
-
-    /** The principal to use for establishing a JNDI context. */
-    private String securityPrincipal = "uid=admin,ou=system";
-
-    /** The credentials to use for establishing a JNDI context. */
-    private String securityCredentials = "secret";
-
-    /** The friendly name of this service. */
-    private String serviceName;
-
-    /** The PID for this service. */
-    private String servicePid;
-
-    /** Whether this service is enabled. */
-    private boolean isEnabled;
-
-
-    /**
-     * Returns the buffer size.
-     * 
-     * @return The bufferSize.
-     */
-    public int getBufferSize()
-    {
-        return bufferSize;
-    }
-
-
-    /**
-     * Sets the buffer size.
-     * 
-     * @param bufferSize The bufferSize to set.
-     */
-    public void setBufferSize( int bufferSize )
-    {
-        this.bufferSize = bufferSize;
-    }
-
-
-    /**
-     * Returns whether this service is enabled or not.
-     * 
-     * @return True if this service is enabled.
-     */
-    public boolean isEnabled()
-    {
-        return isEnabled;
-    }
-
-
-    /**
-     * Sets whether this service is enabled or not.
-     * 
-     * @param isEnabled True if this service is to be enabled.
-     */
-    public void setEnabled( boolean isEnabled )
-    {
-        this.isEnabled = isEnabled;
-    }
-
-
-    /**
-     * Returns the service PID.
-     * 
-     * @return The servicePid.
-     */
-    public String getServicePid()
-    {
-        return servicePid;
-    }
-
-
-    /**
-     * Sets the service PID.
-     * 
-     * @param servicePid The servicePid to set.
-     */
-    public void setServicePid( String servicePid )
-    {
-        this.servicePid = servicePid;
-    }
-
-
-    /**
-     * Compares whether a Dictionary of configuration is 
-     * different from the current instance of configuration.
-     *
-     * @param config the configuration
-     * @return Whether the configuration is different.
-     */
-    public boolean isDifferent( Dictionary<String, Object> config )
-    {
-        int port = getIpPort();
-        return port != Integer.parseInt( ( String ) config.get( IP_PORT_KEY ) );
-    }
-
-
-    /**
-     * Returns the service name.
-     * 
-     * @return The serviceName.
-     */
-    public String getServiceName()
-    {
-        return serviceName;
-    }
-
-
-    /**
-     * Sets the service name.
-     * 
-     * @param serviceName The service name to set.
-     */
-    public void setServiceName( String serviceName )
-    {
-        this.serviceName = serviceName;
-    }
-
-
-    /**
-     * Returns the IP address.
-     * 
-     * @return The IP address.
-     */
-    public String getIpAddress()
-    {
-        return ipAddress;
-    }
-
-
-    /**
-     * Returns the IP port.
-     * 
-     * @return The IP port.
-     */
-    public int getIpPort()
-    {
-        return ipPort;
-    }
-
-
-    /**
-     * Returns the catalog base DN.
-     *
-     * @return The catalog base DN.
-     */
-    public String getCatalogBaseDn()
-    {
-        return catalogBaseDn;
-    }
-
-
     /**
      * Returns the search base DN.
      *
@@ -237,129 +47,10 @@
 
 
     /**
-     * Returns the {@link InitialContextFactory}.
-     *
-     * @return The {@link InitialContextFactory}.
-     */
-    public String getInitialContextFactory()
-    {
-        return initialContextFactory;
-    }
-
-
-    /**
-     * Returns The authentication mechanism.
-     * 
-     * @return The securityAuthentication.
-     */
-    public String getSecurityAuthentication()
-    {
-        return securityAuthentication;
-    }
-
-
-    /**
-     * @return The securityCredentials.
-     */
-    public String getSecurityCredentials()
-    {
-        return securityCredentials;
-    }
-
-
-    /**
-     * @return The securityPrincipal.
-     */
-    public String getSecurityPrincipal()
-    {
-        return securityPrincipal;
-    }
-
-
-    /**
-     * @param catalogBaseDn The catalogBaseDn to set.
-     */
-    public void setCatalogBaseDn( String catalogBaseDn )
-    {
-        this.catalogBaseDn = catalogBaseDn;
-    }
-
-
-    /**
-     * @param initialContextFactory The initialContextFactory to set.
-     */
-    public void setInitialContextFactory( String initialContextFactory )
-    {
-        this.initialContextFactory = initialContextFactory;
-    }
-
-
-    /**
-     * @param ipAddress The ipAddress to set.
-     */
-    public void setIpAddress( String ipAddress )
-    {
-        this.ipAddress = ipAddress;
-    }
-
-
-    /**
-     * @param ipPort The ipPort to set.
-     */
-    public void setIpPort( int ipPort )
-    {
-        validatePortNumber( ipPort );
-        this.ipPort = ipPort;
-    }
-
-
-    /**
      * @param searchBaseDn The searchBaseDn to set.
      */
     public void setSearchBaseDn( String searchBaseDn )
     {
         this.searchBaseDn = searchBaseDn;
-    }
-
-
-    /**
-     * @param securityAuthentication The securityAuthentication to set.
-     */
-    public void setSecurityAuthentication( String securityAuthentication )
-    {
-        this.securityAuthentication = securityAuthentication;
-    }
-
-
-    /**
-     * @param securityCredentials The securityCredentials to set.
-     */
-    public void setSecurityCredentials( String securityCredentials )
-    {
-        this.securityCredentials = securityCredentials;
-    }
-
-
-    /**
-     * @param securityPrincipal The securityPrincipal to set.
-     */
-    public void setSecurityPrincipal( String securityPrincipal )
-    {
-        this.securityPrincipal = securityPrincipal;
-    }
-
-
-    /**
-     * Throws a {@link ServiceConfigurationException} if the specified port number
-     * is out of range.
-     * 
-     * @param port the port number to validate
-     */
-    protected void validatePortNumber( int port )
-    {
-        if ( port < 0 || port > 65535 )
-        {
-            throw new ServiceConfigurationException( "Invalid port number: " + port );
-        }
     }
 }

Modified: directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerFastTest.java Mon Oct 15 15:39:36 2007
@@ -214,7 +214,9 @@
         directoryService.startup();
         port = AvailablePortFinder.getNextAvailable( 1024 );
         SocketAcceptor socketAcceptor = new SocketAcceptor( null );
-        ldapServer = new LdapServer( socketAcceptor, directoryService );
+        ldapServer = new LdapServer();
+        ldapServer.setSocketAcceptor( socketAcceptor );
+        ldapServer.setDirectoryService( directoryService );
         ldapServer.setIpPort( port );
         ldapServer.start();
 

Modified: directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java (original)
+++ directory/apacheds/branches/bigbang/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java Mon Oct 15 15:39:36 2007
@@ -220,7 +220,9 @@
         directoryService = new DefaultDirectoryService();
         directoryService.setShutdownHookEnabled( false );
         socketAcceptor = new SocketAcceptor( null );
-        ldapServer = new LdapServer( socketAcceptor, directoryService );
+        ldapServer = new LdapServer();
+        ldapServer.setSocketAcceptor( socketAcceptor );
+        ldapServer.setDirectoryService( directoryService );
         ldapServer.setIpPort( port = AvailablePortFinder.getNextAvailable( 1024 ) );
 
         doDelete( directoryService.getWorkingDirectory() );

Modified: directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java
URL: http://svn.apache.org/viewvc/directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java?rev=584949&r1=584948&r2=584949&view=diff
==============================================================================
--- directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java (original)
+++ directory/installers/branches/bigbang/apacheds-noarch/src/main/java/org/apache/directory/server/Service.java Mon Oct 15 15:39:36 2007
@@ -66,10 +66,14 @@
             DirectoryService directoryService = new DefaultDirectoryService();
             directoryService.startup();
             SocketAcceptor socketAcceptor = new SocketAcceptor( null );
-            LdapServer ldapServer = new LdapServer( socketAcceptor, directoryService );
+            LdapServer ldapServer = new LdapServer();
+            ldapServer.setSocketAcceptor( socketAcceptor );
+            ldapServer.setDirectoryService( directoryService );
             ldapServer.start();
-            LdapServer ldapsServer = new LdapServer( socketAcceptor, directoryService );
+            LdapServer ldapsServer = new LdapServer();
             ldapsServer.setEnableLdaps( true );
+            ldapsServer.setSocketAcceptor( socketAcceptor );
+            ldapsServer.setDirectoryService( directoryService );
             ldapsServer.start();
             apacheDS = new ApacheDS( directoryService, ldapServer, ldapsServer );
         }



Mime
View raw message