You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2009/06/14 11:14:34 UTC
svn commit: r784530 [2/5] - in /directory:
apacheds/trunk/core/src/main/java/org/apache/directory/server/core/
apacheds/trunk/core/src/test/java/org/apache/directory/server/core/authz/support/
apacheds/trunk/core/src/test/java/org/apache/directory/serv...
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java Sun Jun 14 09:14:31 2009
@@ -31,7 +31,7 @@
import javax.swing.JTable;
import javax.swing.JButton;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.shared.ldap.message.InternalAbandonableRequest;
import javax.swing.JTextArea;
@@ -51,7 +51,7 @@
private JButton jButton;
final LdapSession session;
- final LdapService ldapService;
+ final LdapServer ldapServer;
private JPanel jPanel2;
private JTextArea jTextArea;
@@ -65,11 +65,11 @@
* @param session the MINA IoSession to get outstanding requests for
* @param sessionRegistry the session registry
*/
- public OutstandingRequestsDialog( JFrame owner, LdapSession session, LdapService ldapService )
+ public OutstandingRequestsDialog( JFrame owner, LdapSession session, LdapServer ldapServer )
{
super( owner, true );
this.session = session;
- this.ldapService = ldapService;
+ this.ldapServer = ldapServer;
StringBuffer buf = new StringBuffer();
buf.append( "Outstanding Requests: " );
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java Sun Jun 14 09:14:31 2009
@@ -45,7 +45,7 @@
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.server.ldap.handlers.extended.GracefulShutdownHandler;
import org.apache.directory.shared.ldap.message.extended.GracefulDisconnect;
@@ -92,17 +92,17 @@
private LdapSession selected;
private JMenuItem unbindItem;
private JMenuItem bindItem;
- private LdapService ldapService;
+ private LdapServer ldapServer;
/**
* This is the default constructor
- * @param ldapService the session registry
+ * @param ldapServer the session registry
*/
- public SessionsFrame( LdapService ldapService )
+ public SessionsFrame( LdapServer ldapServer )
{
super();
- this.ldapService = ldapService;
+ this.ldapServer = ldapServer;
initialize();
}
@@ -191,7 +191,7 @@
{
sessionsTable = new JTable();
sessionsTable.setSelectionMode( javax.swing.ListSelectionModel.SINGLE_SELECTION );
- sessionsTable.setModel( new SessionsModel( ldapService.getLdapSessionManager().getSessions() ) );
+ sessionsTable.setModel( new SessionsModel( ldapServer.getLdapSessionManager().getSessions() ) );
sessionsTable.getSelectionModel().addListSelectionListener( new ListSelectionListener()
{
public void valueChanged( ListSelectionEvent e )
@@ -363,7 +363,7 @@
{
public void actionPerformed( java.awt.event.ActionEvent e )
{
- ldapService.getLdapSessionManager().removeLdapSession( selected.getIoSession() );
+ ldapServer.getLdapSessionManager().removeLdapSession( selected.getIoSession() );
try
{
Thread.sleep( 250 );
@@ -548,7 +548,7 @@
public void actionPerformed( java.awt.event.ActionEvent e )
{
OutstandingRequestsDialog dialog =
- new OutstandingRequestsDialog( SessionsFrame.this, selected, ldapService );
+ new OutstandingRequestsDialog( SessionsFrame.this, selected, ldapServer );
dialog.addWindowListener( new WindowAdapter()
{
public void windowClosed( WindowEvent e )
@@ -691,7 +691,7 @@
private void refresh()
{
LOG.info( "Refreshing Sessions UI" );
- sessionsTable.setModel( new SessionsModel( ldapService.getLdapSessionManager().getSessions() ) );
+ sessionsTable.setModel( new SessionsModel( ldapServer.getLdapSessionManager().getSessions() ) );
closeItem.setEnabled( false );
menuSendNoD.setEnabled( false );
showRequests.setEnabled( false );
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java Sun Jun 14 09:14:31 2009
@@ -40,7 +40,7 @@
import org.apache.directory.server.kerberos.shared.store.PrincipalStoreEntry;
import org.apache.directory.server.kerberos.shared.store.operations.GetPrincipal;
import org.apache.directory.server.ldap.LdapProtocolUtils;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.server.ldap.handlers.bind.MechanismHandler;
import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
@@ -243,7 +243,7 @@
private boolean checkMechanism( LdapSession ldapSession, String saslMechanism ) throws Exception
{
// Guard clause: Reject unsupported SASL mechanisms.
- if ( ! ldapService.getSupportedMechanisms().contains( saslMechanism ) )
+ if ( ! ldapServer.getSupportedMechanisms().contains( saslMechanism ) )
{
LOG.error( "Bind error : {} mechanism not supported. Please check the server.xml " +
"configuration file (supportedMechanisms field)",
@@ -610,15 +610,15 @@
/**
* Create a list of all the configured realms.
*
- * @param ldapService the LdapService for which we want to get the realms
+ * @param ldapServer the LdapServer for which we want to get the realms
* @return a list of realms, separated by spaces
*/
- private String getActiveRealms( LdapService ldapService )
+ private String getActiveRealms( LdapServer ldapServer )
{
StringBuilder realms = new StringBuilder();
boolean isFirst = true;
- for ( String realm:ldapService.getSaslRealms() )
+ for ( String realm:ldapServer.getSaslRealms() )
{
if ( isFirst )
{
@@ -636,9 +636,9 @@
}
- private Subject getSubject( LdapService ldapService ) throws Exception
+ private Subject getSubject( LdapServer ldapServer ) throws Exception
{
- String servicePrincipalName = ldapService.getSaslPrincipal();
+ String servicePrincipalName = ldapServer.getSaslPrincipal();
KerberosPrincipal servicePrincipal = new KerberosPrincipal( servicePrincipalName );
GetPrincipal getPrincipal = new GetPrincipal( servicePrincipal );
@@ -647,19 +647,19 @@
try
{
- entry = findPrincipal( ldapService, getPrincipal );
+ entry = findPrincipal( ldapServer, getPrincipal );
}
catch ( ServiceConfigurationException sce )
{
String message = "Service principal " + servicePrincipalName + " not found at search base DN "
- + ldapService.getSearchBaseDn() + ".";
+ + ldapServer.getSearchBaseDn() + ".";
throw new ServiceConfigurationException( message, sce );
}
if ( entry == null )
{
String message = "Service principal " + servicePrincipalName + " not found at search base DN "
- + ldapService.getSearchBaseDn() + ".";
+ + ldapServer.getSearchBaseDn() + ".";
throw new ServiceConfigurationException( message );
}
@@ -682,9 +682,9 @@
}
- private PrincipalStoreEntry findPrincipal( LdapService ldapService, GetPrincipal getPrincipal ) throws Exception
+ private PrincipalStoreEntry findPrincipal( LdapServer ldapServer, GetPrincipal getPrincipal ) throws Exception
{
- CoreSession adminSession = ldapService.getDirectoryService().getAdminSession();
+ CoreSession adminSession = ldapServer.getDirectoryService().getAdminSession();
return ( PrincipalStoreEntry ) getPrincipal.execute( adminSession, null );
}
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java Sun Jun 14 09:14:31 2009
@@ -23,7 +23,7 @@
import javax.naming.NamingException;
import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
import org.apache.directory.shared.ldap.exception.LdapException;
@@ -59,31 +59,31 @@
private static final Logger LOG = LoggerFactory.getLogger( LdapRequestHandler.class );
/** The reference on the Ldap server instance */
- protected LdapService ldapService;
+ protected LdapServer ldapServer;
/**
* @return The associated ldap server instance
*/
- public final LdapService getLdapServer()
+ public final LdapServer getLdapServer()
{
- return ldapService;
+ return ldapServer;
}
/**
* Associates a Ldap server instance to the message handler
- * @param ldapService the associated ldap server instance
+ * @param ldapServer the associated ldap server instance
*/
- public final void setLdapServer( LdapService ldapService )
+ public final void setLdapServer( LdapServer ldapServer )
{
- this.ldapService = ldapService;
+ this.ldapServer = ldapServer;
}
/**
* Checks to see if confidentiality requirements are met. If the
- * LdapService requires confidentiality and the SSLFilter is engaged
+ * LdapServer requires confidentiality and the SSLFilter is engaged
* this will return true. If confidentiality is not required this
* will return true. If confidentially is required and the SSLFilter
* is not engaged in the IoFilterChain this will return false.
@@ -98,7 +98,7 @@
public final boolean isConfidentialityRequirementSatisfied( IoSession session )
{
- if ( ! ldapService.isConfidentialityRequired() )
+ if ( ! ldapServer.isConfidentialityRequired() )
{
return true;
}
@@ -120,13 +120,13 @@
public final void handleMessage( IoSession session, T message ) throws Exception
{
- LdapSession ldapSession = ldapService.getLdapSessionManager().getLdapSession( session );
+ LdapSession ldapSession = ldapServer.getLdapSessionManager().getLdapSession( session );
//handle( ldapSession, message );
- // TODO - session you get from LdapService should have the ldapService
+ // TODO - session you get from LdapServer should have the ldapServer
// member already set no? Should remove these lines where ever they
// may be if that's the case.
- ldapSession.setLdapServer( ldapService );
+ ldapSession.setLdapServer( ldapServer );
// protect against insecure conns when confidentiality is required
if ( ! isConfidentialityRequirementSatisfied( session ) )
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java Sun Jun 14 09:14:31 2009
@@ -22,7 +22,7 @@
import org.apache.directory.server.core.event.DirectoryListener;
import org.apache.directory.server.core.filtering.EntryFilteringCursor;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.shared.ldap.exception.OperationAbandonedException;
import org.apache.directory.shared.ldap.message.AbandonListener;
import org.apache.directory.shared.ldap.message.InternalAbandonableRequest;
@@ -40,33 +40,33 @@
public class SearchAbandonListener implements AbandonListener
{
private static final Logger LOG = LoggerFactory.getLogger( SearchAbandonListener.class );
- private final LdapService ldapService;
+ private final LdapServer ldapServer;
private EntryFilteringCursor cursor;
private DirectoryListener listener;
- public SearchAbandonListener( LdapService ldapService, EntryFilteringCursor cursor, DirectoryListener listener )
+ public SearchAbandonListener( LdapServer ldapServer, EntryFilteringCursor cursor, DirectoryListener listener )
{
- if ( ldapService == null )
+ if ( ldapServer == null )
{
- throw new NullPointerException( "ldapService" );
+ throw new NullPointerException( "ldapServer" );
}
- this.ldapService = ldapService;
+ this.ldapServer = ldapServer;
this.cursor = cursor;
this.listener = listener;
}
- public SearchAbandonListener( LdapService ldapService, DirectoryListener listener )
+ public SearchAbandonListener( LdapServer ldapServer, DirectoryListener listener )
{
- this ( ldapService, null, listener );
+ this ( ldapServer, null, listener );
}
- public SearchAbandonListener( LdapService ldapService, EntryFilteringCursor cursor )
+ public SearchAbandonListener( LdapServer ldapServer, EntryFilteringCursor cursor )
{
- this ( ldapService, cursor, null );
+ this ( ldapServer, cursor, null );
}
@@ -74,7 +74,7 @@
{
if ( listener != null )
{
- ldapService.getDirectoryService().getEventService().removeListener( listener );
+ ldapServer.getDirectoryService().getEventService().removeListener( listener );
}
try
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Sun Jun 14 09:14:31 2009
@@ -62,8 +62,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import static org.apache.directory.server.ldap.LdapService.NO_SIZE_LIMIT;
-import static org.apache.directory.server.ldap.LdapService.NO_TIME_LIMIT;
+import static org.apache.directory.server.ldap.LdapServer.NO_SIZE_LIMIT;
+import static org.apache.directory.server.ldap.LdapServer.NO_TIME_LIMIT;
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
@@ -159,7 +159,7 @@
criteria.setScope( req.getScope() );
criteria.setEventMask( EventType.getEventTypes( psearchControl.getChangeTypes() ) );
getLdapServer().getDirectoryService().getEventService().addListener( handler, criteria );
- req.addAbandonListener( new SearchAbandonListener( ldapService, handler ) );
+ req.addAbandonListener( new SearchAbandonListener( ldapServer, handler ) );
return;
}
@@ -244,7 +244,7 @@
* has been configured with unlimited time and the request specifies
* unlimited search time
*/
- if ( ldapService.getMaxTimeLimit() == NO_TIME_LIMIT && req.getTimeLimit() == NO_TIME_LIMIT )
+ if ( ldapServer.getMaxTimeLimit() == NO_TIME_LIMIT && req.getTimeLimit() == NO_TIME_LIMIT )
{
return;
}
@@ -256,7 +256,7 @@
*/
if ( req.getTimeLimit() == 0 )
{
- cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapService.getMaxTimeLimit(), TimeUnit.SECONDS ) );
+ cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapServer.getMaxTimeLimit(), TimeUnit.SECONDS ) );
return;
}
@@ -265,7 +265,7 @@
* less than the maximum limit configured in the server then we
* constrain search by the amount specified in the request
*/
- if ( ldapService.getMaxTimeLimit() >= req.getTimeLimit() )
+ if ( ldapServer.getMaxTimeLimit() >= req.getTimeLimit() )
{
cursor.setClosureMonitor( new SearchTimeLimitingMonitor( req.getTimeLimit(), TimeUnit.SECONDS ) );
return;
@@ -276,7 +276,7 @@
* than what the server's configured maximum limit allows so we limit
* the search to the configured limit
*/
- cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapService.getMaxTimeLimit(), TimeUnit.SECONDS ) );
+ cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapServer.getMaxTimeLimit(), TimeUnit.SECONDS ) );
}
@@ -298,13 +298,13 @@
}
else
{
- if ( ldapService.getMaxSizeLimit() == NO_SIZE_LIMIT )
+ if ( ldapServer.getMaxSizeLimit() == NO_SIZE_LIMIT )
{
return Integer.MAX_VALUE;
}
else
{
- return ldapService.getMaxSizeLimit();
+ return ldapServer.getMaxSizeLimit();
}
}
}
@@ -346,7 +346,7 @@
EntryFilteringCursor cursor, int sizeLimit, int pagedLimit, boolean isPaged,
PagedSearchContext pagedContext, PagedResultsControl pagedResultsControl ) throws Exception
{
- req.addAbandonListener( new SearchAbandonListener( ldapService, cursor ) );
+ req.addAbandonListener( new SearchAbandonListener( ldapServer, cursor ) );
setTimeLimitsOnCursor( req, session, cursor );
LOG.debug( "using <{},{}> for size limit", sizeLimit, pagedLimit );
int cookieValue = 0;
@@ -713,7 +713,7 @@
int requestLimit = req.getSizeLimit() == 0 ?
Integer.MAX_VALUE : req.getSizeLimit();
- req.addAbandonListener( new SearchAbandonListener( ldapService, cursor ) );
+ req.addAbandonListener( new SearchAbandonListener( ldapServer, cursor ) );
setTimeLimitsOnCursor( req, session, cursor );
LOG.debug( "using <{},{}> for size limit", requestLimit, serverLimit );
int sizeLimit = min( requestLimit, serverLimit );
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java Sun Jun 14 09:14:31 2009
@@ -45,7 +45,7 @@
{
session.getCoreSession().unbind( request );
session.getIoSession().close( true );
- ldapService.getLdapSessionManager().removeLdapSession( session.getIoSession() );
+ ldapServer.getLdapSessionManager().removeLdapSession( session.getIoSession() );
}
catch ( Throwable t )
{
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java Sun Jun 14 09:14:31 2009
@@ -21,7 +21,7 @@
import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.server.ldap.handlers.bind.AbstractMechanismHandler;
import org.apache.directory.server.ldap.handlers.bind.SaslConstants;
@@ -48,15 +48,15 @@
/**
* Create a list of all the configured realms.
*
- * @param ldapService the LdapService for which we want to get the realms
+ * @param ldapServer the LdapServer for which we want to get the realms
* @return a list of realms, separated by spaces
*/
- private String getActiveRealms( LdapService ldapService )
+ private String getActiveRealms( LdapServer ldapServer )
{
StringBuilder realms = new StringBuilder();
boolean isFirst = true;
- for ( String realm:ldapService.getSaslRealms() )
+ for ( String realm:ldapServer.getSaslRealms() )
{
if ( isFirst )
{
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/CertGenerationRequestHandler.java Sun Jun 14 09:14:31 2009
@@ -28,7 +28,7 @@
import org.apache.directory.server.core.entry.ClonedServerEntry;
import org.apache.directory.server.core.security.TlsKeyGenerator;
import org.apache.directory.server.ldap.ExtendedOperationHandler;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.shared.asn1.ber.Asn1Decoder;
import org.apache.directory.shared.asn1.codec.DecoderException;
@@ -103,7 +103,7 @@
}
- public void setLdapServer( LdapService ldapService )
+ public void setLdapServer( LdapServer ldapServer )
{
}
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java Sun Jun 14 09:14:31 2009
@@ -28,7 +28,7 @@
import java.util.Set;
import org.apache.directory.server.ldap.ExtendedOperationHandler;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.shared.ldap.message.InternalExtendedRequest;
import org.apache.directory.shared.ldap.message.ResultCodeEnum;
@@ -307,7 +307,7 @@
}
- public void setLdapServer( LdapService ldapService )
+ public void setLdapServer( LdapServer ldapServer )
{
}
}
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java Sun Jun 14 09:14:31 2009
@@ -39,7 +39,7 @@
import org.apache.directory.server.core.partition.impl.btree.BTreePartition;
import org.apache.directory.server.core.partition.impl.btree.gui.PartitionFrame;
import org.apache.directory.server.ldap.ExtendedOperationHandler;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.server.ldap.gui.SessionsFrame;
import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
@@ -66,7 +66,7 @@
EXTENSION_OIDS = Collections.unmodifiableSet( set );
}
- private LdapService ldapService;
+ private LdapServer ldapServer;
public String getOid()
@@ -116,9 +116,9 @@
}
}
- SessionsFrame sessions = new SessionsFrame( ldapService );
+ SessionsFrame sessions = new SessionsFrame( ldapServer );
sessions.setRequestor( requestor.getIoSession() );
- sessions.setLdapProvider( ldapService.getHandler() );
+ sessions.setLdapProvider( ldapServer.getHandler() );
Point pos = getCenteredPosition( sessions );
pos.y = launchedWindowCount * 20 + pos.y;
double multiplier = getAspectRatio() * 20.0;
@@ -153,8 +153,8 @@
}
- public void setLdapServer( LdapService ldapService )
+ public void setLdapServer( LdapServer ldapServer )
{
- this.ldapService = ldapService;
+ this.ldapServer = ldapServer;
}
}
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java Sun Jun 14 09:14:31 2009
@@ -37,7 +37,7 @@
import org.apache.directory.server.core.security.CoreKeyStoreSpi;
import org.apache.directory.server.ldap.ExtendedOperationHandler;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.shared.ldap.message.InternalExtendedRequest;
import org.apache.directory.shared.ldap.message.InternalExtendedResponse;
@@ -137,12 +137,12 @@
}
- public void setLdapServer( LdapService ldapService )
+ public void setLdapServer( LdapServer ldapServer )
{
LOG.debug( "Setting LDAP Service" );
Provider provider = Security.getProvider( "SUN" );
LOG.debug( "provider = {}", provider );
- CoreKeyStoreSpi coreKeyStoreSpi = new CoreKeyStoreSpi( ldapService.getDirectoryService() );
+ CoreKeyStoreSpi coreKeyStoreSpi = new CoreKeyStoreSpi( ldapServer.getDirectoryService() );
KeyStore keyStore = new KeyStore( coreKeyStoreSpi, provider, "JKS" ) {};
try
Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java Sun Jun 14 09:14:31 2009
@@ -35,7 +35,7 @@
import org.apache.directory.server.core.sp.StoredProcExecutionManager;
import org.apache.directory.server.core.sp.java.JavaStoredProcEngineConfig;
import org.apache.directory.server.ldap.ExtendedOperationHandler;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.apache.directory.shared.asn1.ber.Asn1Decoder;
import org.apache.directory.shared.asn1.ber.IAsn1Container;
@@ -155,7 +155,7 @@
}
- public void setLdapServer( LdapService ldapService )
+ public void setLdapServer( LdapServer ldapServer )
{
}
}
Modified: directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java Sun Jun 14 09:14:31 2009
@@ -26,7 +26,7 @@
import static org.junit.Assert.assertTrue;
import org.apache.directory.server.ldap.ExtendedOperationHandler;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.handlers.bind.MechanismHandler;
import org.apache.directory.server.ldap.handlers.bind.plain.PlainMechanismHandler;
import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler;
@@ -39,7 +39,7 @@
/**
- * Test to confirm correct behavoir for settings on LdapService bean.
+ * Test to confirm correct behavoir for settings on LdapServer bean.
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $$Rev$$
@@ -49,7 +49,7 @@
@Test
public void testAddExtendedOperationHandler() throws Exception
{
- LdapService server = new LdapService();
+ LdapServer server = new LdapServer();
StartTlsHandler handler = new StartTlsHandler();
server.addExtendedOperationHandler( handler );
assertEquals( handler, server.getExtendedOperationHandler( handler.getOid() ) );
@@ -61,7 +61,7 @@
@Test
public void testSetExtendedOperationHandlers()
{
- LdapService server = new LdapService();
+ LdapServer server = new LdapServer();
StartTlsHandler handler = new StartTlsHandler();
List<ExtendedOperationHandler> handlers = new ArrayList<ExtendedOperationHandler>();
handlers.add( handler );
@@ -75,7 +75,7 @@
@Test
public void testSetSaslMechanismHandlers()
{
- LdapService server = new LdapService();
+ LdapServer server = new LdapServer();
Map<String, MechanismHandler> handlers = new HashMap<String,MechanismHandler>();
MechanismHandler handler = new PlainMechanismHandler();
handlers.put( SupportedSaslMechanisms.PLAIN, handler );
Modified: directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java Sun Jun 14 09:14:31 2009
@@ -22,7 +22,7 @@
import junit.framework.TestCase;
import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.handlers.AbandonHandler;
import org.apache.directory.server.ldap.handlers.AddHandler;
import org.apache.directory.server.ldap.handlers.BindHandler;
@@ -54,24 +54,24 @@
*/
public class SettingAlternativeHandlersTest extends TestCase
{
- LdapService ldapService;
+ LdapServer ldapServer;
public void setUp() throws Exception
{
- ldapService = new LdapService();
+ ldapServer = new LdapServer();
if ( getName().equals( "testAlternativeConfiguration" ) )
{
- ldapService.setAbandonHandler( new BogusAbandonHandler() );
- ldapService.setAddHandler( new BogusAddHandler() );
- ldapService.setBindHandler( new BogusBindHandler() );
- ldapService.setCompareHandler( new BogusCompareHandler() );
- ldapService.setDeleteHandler( new BogusDeleteHandler() );
- ldapService.setModifyDnHandler( new BogusModifyDnHandler() );
- ldapService.setModifyHandler( new BogusModifyHandler() );
- ldapService.setSearchHandler( new BogusSearchHandler() );
- ldapService.setUnbindHandler( new BogusUnbindHandler() );
+ ldapServer.setAbandonHandler( new BogusAbandonHandler() );
+ ldapServer.setAddHandler( new BogusAddHandler() );
+ ldapServer.setBindHandler( new BogusBindHandler() );
+ ldapServer.setCompareHandler( new BogusCompareHandler() );
+ ldapServer.setDeleteHandler( new BogusDeleteHandler() );
+ ldapServer.setModifyDnHandler( new BogusModifyDnHandler() );
+ ldapServer.setModifyHandler( new BogusModifyHandler() );
+ ldapServer.setSearchHandler( new BogusSearchHandler() );
+ ldapServer.setUnbindHandler( new BogusUnbindHandler() );
}
}
@@ -85,7 +85,7 @@
*/
public void testDefaultOperation() throws LdapNamingException
{
- assertEquals( ldapService.getName(), LdapService.SERVICE_NAME );
+ assertEquals( ldapServer.getName(), LdapServer.SERVICE_NAME );
}
@@ -98,16 +98,16 @@
*/
public void testAlternativeConfiguration() throws LdapNamingException
{
- assertEquals( ldapService.getAbandonHandler().getClass(), BogusAbandonHandler.class );
- assertEquals( ldapService.getAddHandler().getClass(), BogusAddHandler.class );
- assertEquals( ldapService.getBindHandler().getClass(), BogusBindHandler.class );
- assertEquals( ldapService.getCompareHandler().getClass(), BogusCompareHandler.class );
- assertEquals( ldapService.getDeleteHandler().getClass(), BogusDeleteHandler.class );
- assertEquals( ldapService.getModifyDnHandler().getClass(), BogusModifyDnHandler.class );
- assertEquals( ldapService.getModifyHandler().getClass(), BogusModifyHandler.class );
- assertEquals( ldapService.getSearchHandler().getClass(), BogusSearchHandler.class );
- assertEquals( ldapService.getUnbindHandler().getClass(), BogusUnbindHandler.class );
- assertEquals( ldapService.getName(), LdapService.SERVICE_NAME );
+ assertEquals( ldapServer.getAbandonHandler().getClass(), BogusAbandonHandler.class );
+ assertEquals( ldapServer.getAddHandler().getClass(), BogusAddHandler.class );
+ assertEquals( ldapServer.getBindHandler().getClass(), BogusBindHandler.class );
+ assertEquals( ldapServer.getCompareHandler().getClass(), BogusCompareHandler.class );
+ assertEquals( ldapServer.getDeleteHandler().getClass(), BogusDeleteHandler.class );
+ assertEquals( ldapServer.getModifyDnHandler().getClass(), BogusModifyDnHandler.class );
+ assertEquals( ldapServer.getModifyHandler().getClass(), BogusModifyHandler.class );
+ assertEquals( ldapServer.getSearchHandler().getClass(), BogusSearchHandler.class );
+ assertEquals( ldapServer.getUnbindHandler().getClass(), BogusUnbindHandler.class );
+ assertEquals( ldapServer.getName(), LdapServer.SERVICE_NAME );
}
Modified: directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/main/java/org/apache/directory/server/ntp/NtpServer.java Sun Jun 14 09:14:31 2009
@@ -24,12 +24,16 @@
import org.apache.directory.server.ntp.protocol.NtpProtocolHandler;
import org.apache.directory.server.protocol.shared.AbstractProtocolService;
import org.apache.directory.server.protocol.shared.transport.Transport;
+import org.apache.directory.server.protocol.shared.transport.UdpTransport;
import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
+import org.apache.mina.core.service.IoAcceptor;
import org.apache.mina.core.service.IoHandler;
import org.apache.mina.filter.codec.ProtocolCodecFilter;
import org.apache.mina.transport.socket.DatagramAcceptor;
import org.apache.mina.transport.socket.DatagramSessionConfig;
import org.apache.mina.transport.socket.SocketAcceptor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import java.io.IOException;
@@ -43,19 +47,18 @@
*/
public class NtpServer extends AbstractProtocolService
{
+ /** logger for this class */
+ private static final Logger LOG = LoggerFactory.getLogger( NtpServer.class.getName() );
+
/**
* The default IP port.
*/
private static final int IP_PORT_DEFAULT = 123;
- /**
- * The default service pid.
- */
+ /** The default service pid. */
private static final String SERVICE_PID_DEFAULT = "org.apache.directory.server.ntp";
- /**
- * The default service name.
- */
+ /** The default service name. */
private static final String SERVICE_NAME_DEFAULT = "ApacheDS NTP Service";
@@ -84,12 +87,14 @@
DefaultIoFilterChainBuilder ntpChain = new DefaultIoFilterChainBuilder();
ntpChain.addLast( "codec", new ProtocolCodecFilter( NtpProtocolCodecFactory.getInstance() ) );
- Transport udpTransport = getUdpTransport();
-
- if ( udpTransport != null )
+ if ( ( transports == null ) || ( transports.length == 0 ) )
{
+ // Default to UDP with port 123
// We have to create a DatagramAcceptor
- DatagramAcceptor acceptor = (DatagramAcceptor)udpTransport.getAcceptor();
+ UdpTransport transport = new UdpTransport( IP_PORT_DEFAULT );
+ setTransports( transport );
+
+ DatagramAcceptor acceptor = (DatagramAcceptor)transport.getAcceptor();
// Set the handler
acceptor.setHandler( ntpProtocolHandler );
@@ -103,46 +108,62 @@
// Start the listener
acceptor.bind();
}
-
- Transport tcpTransport = getTcpTransport();
-
- if ( tcpTransport != null )
+ else
{
- // It's a SocketAcceptor
- SocketAcceptor acceptor = (SocketAcceptor)tcpTransport.getAcceptor();
-
- // Set the handler
- acceptor.setHandler( ntpProtocolHandler );
-
- // Disable the disconnection of the clients on unbind
- acceptor.setCloseOnDeactivation( false );
-
- // Allow the port to be reused even if the socket is in TIME_WAIT state
- acceptor.setReuseAddress( true );
-
- // No Nagle's algorithm
- acceptor.getSessionConfig().setTcpNoDelay( true );
-
- // Inject the chain
- acceptor.setFilterChainBuilder( ntpChain );
-
- // Start the listener
- acceptor.bind();
+ for ( Transport transport:transports )
+ {
+ IoAcceptor acceptor = transport.getAcceptor();
+
+ // Set the handler
+ acceptor.setHandler( ntpProtocolHandler );
+
+ if ( transport instanceof UdpTransport )
+ {
+ // Allow the port to be reused even if the socket is in TIME_WAIT state
+ ((DatagramSessionConfig)acceptor.getSessionConfig()).setReuseAddress( true );
+ }
+ else
+ {
+ // Disable the disconnection of the clients on unbind
+ acceptor.setCloseOnDeactivation( false );
+
+ // Allow the port to be reused even if the socket is in TIME_WAIT state
+ ((SocketAcceptor)acceptor).setReuseAddress( true );
+
+ // No Nagle's algorithm
+ ((SocketAcceptor)acceptor).getSessionConfig().setTcpNoDelay( true );
+ }
+
+ // Inject the chain
+ acceptor.setFilterChainBuilder( ntpChain );
+
+ // Start the listener
+ acceptor.bind();
+ }
}
+
+ LOG.info( "NTP server started." );
+ System.out.println( "NTP server started." );
}
+ /**
+ * {@inheritDoc}
+ */
public void stop()
{
- if ( getDatagramAcceptor() != null )
+ for ( Transport transport :getTransports() )
{
- getDatagramAcceptor().dispose();
- }
-
- if ( getSocketAcceptor() != null )
- {
- getSocketAcceptor().dispose();
+ IoAcceptor acceptor = transport.getAcceptor();
+
+ if ( acceptor != null )
+ {
+ acceptor.dispose();
+ }
}
+
+ LOG.info( "NTP Server stopped." );
+ System.out.println( "NTP Server stopped." );
}
@@ -153,16 +174,14 @@
{
StringBuilder sb = new StringBuilder();
- sb.append( "NTPServer[" ).append( getServiceName() ).append( "] :" ).append( '\n' );
+ sb.append( "NTPServer[" ).append( getServiceName() ).append( "], listening on :" ).append( '\n' );
- if ( getUdpTransport() != null )
- {
- sb.append( " Listening on UDP:" ).append( getUdpTransport().getPort() ).append( '\n' );
- }
-
- if ( getTcpTransport() != null )
+ if ( getTransports() != null )
{
- sb.append( " Listening on TCP:" ).append( getTcpTransport().getPort() ).append( '\n' );
+ for ( Transport transport:getTransports() )
+ {
+ sb.append( " " ).append( transport ).append( '\n' );
+ }
}
return sb.toString();
Modified: directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java (original)
+++ directory/apacheds/trunk/protocol-ntp/src/test/java/org/apache/directory/server/ntp/NtpITest.java Sun Jun 14 09:14:31 2009
@@ -57,10 +57,11 @@
{
ntpConfig = new NtpServer( );
port = AvailablePortFinder.getNextAvailable( 10123 );
- ntpConfig.setTcpTransport( new TcpTransport( port ) );
- ntpConfig.setUdpTransport( new UdpTransport( port ) );
- ntpConfig.getDatagramAcceptor().getFilterChain().addLast( "executor", new ExecutorFilter( Executors.newCachedThreadPool() ) );
- ntpConfig.getSocketAcceptor().getFilterChain().addLast( "executor", new ExecutorFilter( Executors.newCachedThreadPool() ) );
+ TcpTransport tcpTransport = new TcpTransport( port );
+ UdpTransport udpTransport = new UdpTransport( port );
+ ntpConfig.setTransports( tcpTransport, udpTransport );
+ ntpConfig.getDatagramAcceptor( udpTransport ).getFilterChain().addLast( "executor", new ExecutorFilter( Executors.newCachedThreadPool() ) );
+ ntpConfig.getSocketAcceptor( tcpTransport ).getFilterChain().addLast( "executor", new ExecutorFilter( Executors.newCachedThreadPool() ) );
ntpConfig.setEnabled( true );
ntpConfig.start();
Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractProtocolService.java Sun Jun 14 09:14:31 2009
@@ -20,20 +20,16 @@
import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.protocol.shared.transport.TcpTransport;
-import org.apache.directory.server.protocol.shared.transport.UdpTransport;
+import org.apache.directory.server.protocol.shared.transport.Transport;
import org.apache.mina.transport.socket.DatagramAcceptor;
import org.apache.mina.transport.socket.SocketAcceptor;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
/**
* An abstract base class for a ProtocolService. The start/stop methods have
* not been implemented.
- *
+ *
+ * @org.apache.xbean.XBean
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
* @version $Rev$, $Date$
*/
@@ -51,53 +47,8 @@
/** The service name */
private String serviceName;
- protected TcpTransport tcpTransport;
-
- protected UdpTransport udpTransport;
-
- /** The server IP address */
- //private String ipAddress;
-
- /** The service's port, if there is only one (TCP or UDP) */
- //private int ipPort = -1;
-
- /** The TCP port, if defined. */
- //private int tcpPort = -1;
-
- /** The UDP port, if defined. */
- //private int udpPort = -1;
-
- private Set<TransportProtocol> transportProtocols;
-
- /** The IoAcceptor used to accept UDP requests */
- //private DatagramAcceptor datagramAcceptor;
-
- /** The IoAcceptor used to accept TCP requests */
- //private SocketAcceptor socketAcceptor;
-
- /** The number of threads to use for the IoAcceptor executor */
- //private int nbThreads;
-
- /**
- * The number of threads to use for the TCP transport
- * protocol based IoAcceptor executor
- **/
- //private int nbTcpThreads;
-
- /**
- * The number of threads to use for the UDP transport
- * protocol based IoAcceptor executor
- **/
- //private int nbUdpThreads;
-
- /** The backlog for all the transport services */
- //private int ipBacklog;
-
- /** The backlog for the TCP transport services */
- //private int tcpBacklog;
-
- /** The backlog for the UDP transport services */
- //private int udpBacklog;
+ /** The service transports. We may have more than one */
+ protected Transport[] transports;
/** directory service core where protocol data is backed */
private DirectoryService directoryService;
@@ -181,166 +132,43 @@
{
this.serviceName = name;
}
-
-
- /*
- public String getIpAddress()
- {
- return ipAddress;
- }
-
-
- public void setIpAddress( String ipAddress )
- {
- this.ipAddress = ipAddress;
- }
-
-
- /**
- * {@inheritDoc}
- *
- public int getIpPort()
- {
- return ipPort;
- }
-
-
- /**
- * {@inheritDoc}
- *
- public int getTcpPort()
- {
- return tcpPort;
- }
-
-
- /**
- * {@inheritDoc}
- *
- public int getUdpPort()
- {
- return udpPort;
- }
- */
-
- /**
- * {@inheritDoc}
- *
- public void setIpPort( int ipPort )
- {
- if ( ( ipPort < 0 ) || ( ipPort > 65535 ) )
- {
- throw new IllegalArgumentException( "Invalid port number: " + ipPort );
- }
-
- this.ipPort = ipPort;
-
- // Now, substitute the existing values by the new one
- udpPort = ipPort;
- tcpPort = ipPort;
- }
-
-
- /**
- * {@inheritDoc}
- *
- public void setTcpPort( int tcpPort )
- {
- if ( ( tcpPort < 0 ) || ( tcpPort > 65535 ) )
- {
- throw new IllegalArgumentException( "Invalid port number: " + tcpPort );
- }
-
- this.tcpPort = tcpPort;
- }
-
-
- /**
- * {@inheritDoc}
- *
- public void setUdpPort( int udpPort )
- {
- if ( ( udpPort < 0 ) || ( udpPort > 65535 ) )
- {
- throw new IllegalArgumentException( "Invalid port number: " + udpPort );
- }
-
- this.udpPort = udpPort;
- }
-
-
- public Set<TransportProtocol> getTransportProtocols()
- {
- return transportProtocols;
- }
- */
/**
- * @return the TCP transport
+ * @return the transport
*/
- public TcpTransport getTcpTransport()
+ public Transport[] getTransports()
{
- return tcpTransport;
+ return transports;
}
/**
- * Set the underlying TCP transport
- * @param transport The TCP transport
- */
- public void setTcpTransport( TcpTransport transport )
- {
- tcpTransport = transport;
-
- if ( ( transport != null ) && ( transport.getAcceptor() == null ) )
- {
- transport.init();
- }
-
- }
-
-
- /**
- * Set the underlying UDP transport
- * @param transport The UDP transport
+ * Set the underlying transports
+ * @param transport The transports
*/
- public void setUdpTransport( UdpTransport transport )
+ public void setTransports( Transport... transports )
{
- udpTransport = transport;
-
- if ( ( transport != null ) && ( transport.getAcceptor() == null ) )
+ if ( transports != null )
{
- transport.init();
+ this.transports = new Transport[ transports.length ];
+ System.arraycopy( transports, 0, this.transports, 0, transports.length );
+
+ for ( Transport transport:transports )
+ {
+ if ( transport.getAcceptor() == null )
+ {
+ transport.init();
+ }
+ }
}
-
}
/**
- * @return the UDP transport
- */
- public UdpTransport getUdpTransport()
- {
- return udpTransport;
- }
-
-
- /**
- * @org.apache.xbean.Property hidden="true"
- */
- public void setTransportProtocols( Set<TransportProtocol> transportProtocols )
- {
- Set<TransportProtocol> copy = new HashSet<TransportProtocol>( transportProtocols.size() );
- copy.addAll( transportProtocols );
- this.transportProtocols = Collections.unmodifiableSet( copy );
- }
-
-
- /**
* {@inheritDoc}
*/
- public DatagramAcceptor getDatagramAcceptor()
+ public DatagramAcceptor getDatagramAcceptor( Transport udpTransport )
{
return (DatagramAcceptor)udpTransport.getAcceptor();
}
@@ -348,151 +176,9 @@
/**
* {@inheritDoc}
- * @org.apache.xbean.Property hidden="true"
- *
- public void setDatagramAcceptor( DatagramAcceptor datagramAcceptor )
- {
- udpTransport.setAcceptor( datagramAcceptor );
- }
-
-
- /**
- * {@inheritDoc}
*/
- public SocketAcceptor getSocketAcceptor()
+ public SocketAcceptor getSocketAcceptor( Transport tcpTransport )
{
return (SocketAcceptor)tcpTransport.getAcceptor();
}
-
-
- /**
- * {@inheritDoc}
- * @org.apache.xbean.Property hidden="true"
- *
- public void setSocketAcceptor( SocketAcceptor socketAcceptor )
- {
- tcpTransport.setAcceptor( socketAcceptor );
- }
-
-
- /**
- * @return The number of thread used in the IoAcceptor executor. It is
- * used if no specific transport protocol is defined, and will be
- * overloaded by the specific NbUdpThreads or nbTcpThreads if those
- * transport protocols are defined.
- *
- public int getNbThreads()
- {
- return nbThreads;
- }
-
-
- /**
- * @return The number of thread used in the IoAcceptor executor for
- * a TCP transport protocol based Acceptor.
- *
- public int getNbTcpThreads()
- {
- return nbTcpThreads;
- }
-
-
- /**
- * @return The number of thread used in the IoAcceptor executor for
- * a UDP transport protocol based Acceptor.
- *
- public int getNbUdpThreads()
- {
- return nbUdpThreads;
- }
-
-
- /**
- * @param nbThreads The number of thread to affect to the IoAcceptor
- * executor. This number will be injected into the UDP and TCP
- * nbThreads value.
- *
- public void setNbThreads(int nbThreads)
- {
- this.nbThreads = nbThreads;
- this.nbTcpThreads = nbThreads;
- this.nbUdpThreads = nbThreads;
- }
-
-
- /**
- * @param nbThreads The number of thread to affect to the
- * TCP transport protocol based IoAcceptor executor
- *
- public void setNbTcpThreads(int nbTcpThreads)
- {
- this.nbTcpThreads = nbTcpThreads;
- }
-
-
- /**
- * @param nbThreads The number of thread to affect to the
- * UDP transport protocol based IoAcceptor executor
- *
- public void setNbUdpThreads(int nbUdpThreads)
- {
- this.nbUdpThreads = nbUdpThreads;
- }
-
-
- /**
- * @return the ipBacklog
- *
- public int getIpBacklog() {
- return ipBacklog;
- }
-
-
- /**
- * @param ipBacklog the ipBacklog to set
- *
- public void setIpBacklog(int ipBacklog) {
- if ( ipBacklog < 0 )
- {
- throw new IllegalArgumentException( "Invalid backlog number: " + ipBacklog );
- }
-
- this.ipBacklog = ipBacklog;
-
- // Now, substitute the existing values by the new one
- tcpBacklog = ipBacklog;
- udpBacklog = ipBacklog;
- }
-
-
- /**
- * @return the tcpBacklog
- *
- public int getTcpBacklog() {
- return tcpBacklog;
- }
-
-
- /**
- * @param tcpBacklog the tcpBacklog to set
- *
- public void setTcpBacklog(int tcpBacklog) {
- this.tcpBacklog = tcpBacklog;
- }
-
-
- /**
- * @return the udpBacklog
- *
- public int getUdpBacklog() {
- return udpBacklog;
- }
-
-
- /**
- * @param udpBacklog the udpBacklog to set
- *
- public void setUdpBacklog(int udpBacklog) {
- this.udpBacklog = udpBacklog;
- }*/
}
Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/ProtocolService.java Sun Jun 14 09:14:31 2009
@@ -20,11 +20,10 @@
import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.protocol.shared.transport.Transport;
import org.apache.mina.transport.socket.DatagramAcceptor;
import org.apache.mina.transport.socket.SocketAcceptor;
-import java.util.Set;
-
/**
* Minimum functionality required by an ApacheDS protocol service.
@@ -64,7 +63,7 @@
*
* @return the MINA DatagramAcceptor used for UDP transports
*/
- DatagramAcceptor getDatagramAcceptor();
+ DatagramAcceptor getDatagramAcceptor( Transport transport );
/**
@@ -73,7 +72,7 @@
*
* @return the MINA SocketAcceptor used for TCP transport
*/
- SocketAcceptor getSocketAcceptor();
+ SocketAcceptor getSocketAcceptor( Transport transport );
/**
@@ -128,24 +127,6 @@
/**
- * Gets the transport protocols used by this service. At this point services
- * which support more than one transport are configured to bind to that transport
- * on the same port.
- *
- * @return the transport protocols used by this service
- */
- //Set<TransportProtocol> getTransportProtocols();
-
-
- /**
- * Sets the transport protocols used by this service.
- *
- * @param transportProtocols the transport protocols to be used by this service
- */
- void setTransportProtocols( Set<TransportProtocol> transportProtocols );
-
-
- /**
* Gets the DirectoryService assigned to this ProtocolService.
*
* @return the directory service core assigned to this service
Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/AbstractTransport.java Sun Jun 14 09:14:31 2009
@@ -29,6 +29,9 @@
/** The service's port */
private int port = -1;
+ /** A flag set if SSL is enabled */
+ private boolean sslEnabled = false;
+
/** The number of threads to use for the IoAcceptor executor */
private int nbThreads;
@@ -38,10 +41,13 @@
/** The IoAcceptor used to accept requests */
protected IoAcceptor acceptor;
+ /** The default backlog queue size */
protected static final int DEFAULT_BACKLOG_NB = 50;
+ /** The default hostname */
protected static final String LOCAL_HOST = "localhost";
+ /** The default number of threads */
protected static final int DEFAULT_NB_THREADS = 3;
/**
@@ -185,16 +191,6 @@
/**
- * Set the IoAcceptor
- * @param acceptor The IoAcceptor to set
- *
- public void setAcceptor ( IoAcceptor acceptor )
- {
- this.acceptor = acceptor;
- }
-
-
- /**
* {@inheritDoc}
*/
public int getNbThreads()
@@ -228,4 +224,62 @@
{
this.backlog = backLog;
}
+
+
+ /**
+ * Enable or disable SSL
+ * @param enableSSL if <code>true</code>, SSL is enabled.
+ */
+ public void setEnableSSL( boolean sslEnabled )
+ {
+ this.sslEnabled = sslEnabled;
+ }
+
+
+ /**
+ * Enable or disable SSL
+ * @param enableSSL if <code>true</code>, SSL is enabled.
+ */
+ public void enableSSL( boolean sslEnabled )
+ {
+ this.sslEnabled = sslEnabled;
+ }
+
+
+ /**
+ * @return <code>true</code> id SSL is enabled for this transport
+ */
+ public boolean isSSLEnabled()
+ {
+ return sslEnabled;
+ }
+
+ /**
+ * @return <code>true</code> id SSL is enabled for this transport
+ */
+ public boolean getEnableSSL()
+ {
+ return sslEnabled;
+ }
+
+
+ /**
+ * @see Object#toString()
+ */
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append( "[<" ).append( address ).append( ':' ).append( port );
+ sb.append( "], backlog=" ).append( backlog );
+ sb.append( ", nbThreads = " ).append( nbThreads );
+
+ if ( sslEnabled )
+ {
+ sb.append( ", SSL" );
+ }
+
+ sb.append( ']' );
+
+ return sb.toString() ;
+ }
}
Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/TcpTransport.java Sun Jun 14 09:14:31 2009
@@ -165,4 +165,13 @@
{
return acceptor == null ? null : (SocketAcceptor)acceptor;
}
+
+
+ /**
+ * @see Object#toString()
+ */
+ public String toString()
+ {
+ return "TcpTransport" + super.toString();
+ }
}
Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/Transport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/Transport.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/Transport.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/Transport.java Sun Jun 14 09:14:31 2009
@@ -96,4 +96,24 @@
* @param backLog The queue size
*/
void setBackLog( int backLog );
+
+
+ /**
+ * Enable or disable SSL
+ * @param sslEnabled if <code>true</code>, SSL is enabled.
+ */
+ void setEnableSSL( boolean sslEnabled );
+
+
+ /**
+ * Enable or disable SSL
+ * @param sslEnabled if <code>true</code>, SSL is enabled.
+ */
+ void enableSSL( boolean sslEnabled );
+
+
+ /**
+ * @return <code>true</code> id SSL is enabled for this transport
+ */
+ boolean isSSLEnabled();
}
Modified: directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java (original)
+++ directory/apacheds/trunk/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/transport/UdpTransport.java Sun Jun 14 09:14:31 2009
@@ -118,4 +118,13 @@
return acceptor;
}
+
+
+ /**
+ * @see Object#toString()
+ */
+ public String toString()
+ {
+ return "UdpTransport" + super.toString();
+ }
}
Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java Sun Jun 14 09:14:31 2009
@@ -25,7 +25,7 @@
import org.apache.directory.server.core.DefaultDirectoryService;
import org.apache.directory.server.core.DirectoryService;
import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.handlers.bind.MechanismHandler;
import org.apache.directory.server.ldap.handlers.bind.SimpleMechanismHandler;
import org.apache.directory.server.ldap.handlers.bind.cramMD5.CramMd5MechanismHandler;
@@ -56,7 +56,7 @@
*/
LdapServerFactory DEFAULT = new LdapServerFactory()
{
- public LdapService newInstance() throws Exception
+ public LdapServer newInstance() throws Exception
{
DirectoryService service = new DefaultDirectoryService();
IntegrationUtils.doDelete( service.getWorkingDirectory() );
@@ -67,12 +67,12 @@
// on the system and somewhere either under target directory
// or somewhere in a temp area of the machine.
- LdapService ldapService = new LdapService();
- ldapService.setDirectoryService( service );
+ LdapServer ldapServer = new LdapServer();
+ ldapServer.setDirectoryService( service );
int port = AvailablePortFinder.getNextAvailable( 1024 );
- ldapService.setTcpTransport( new TcpTransport( port, 3 ) );
- ldapService.addExtendedOperationHandler( new StartTlsHandler() );
- ldapService.addExtendedOperationHandler( new StoredProcedureExtendedOperationHandler() );
+ ldapServer.setTransports( new TcpTransport( port, 3 ) );
+ ldapServer.addExtendedOperationHandler( new StartTlsHandler() );
+ ldapServer.addExtendedOperationHandler( new StoredProcedureExtendedOperationHandler() );
// Setup SASL Mechanisms
@@ -92,12 +92,12 @@
mechanismHandlerMap.put( SupportedSaslMechanisms.NTLM, ntlmMechanismHandler );
mechanismHandlerMap.put( SupportedSaslMechanisms.GSS_SPNEGO, ntlmMechanismHandler );
- ldapService.setSaslMechanismHandlers( mechanismHandlerMap );
+ ldapServer.setSaslMechanismHandlers( mechanismHandlerMap );
- return ldapService;
+ return ldapServer;
}
};
- LdapService newInstance() throws Exception;
+ LdapServer newInstance() throws Exception;
}
Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java Sun Jun 14 09:14:31 2009
@@ -30,7 +30,7 @@
import org.apache.directory.server.constants.ServerDNConstants;
import org.apache.directory.server.core.integ.IntegrationUtils;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -53,13 +53,13 @@
* SUN LDAP provider. The connection is made using the administrative
* user as the principalDN. The context is to the rootDSE.
*
- * @param ldapService the LDAP server to get the connection to
+ * @param ldapServer the LDAP server to get the connection to
* @return an LdapContext as the administrative user to the RootDSE
* @throws Exception if there are problems creating the context
*/
- public static LdapContext getWiredContext( LdapService ldapService ) throws Exception
+ public static LdapContext getWiredContext( LdapServer ldapServer ) throws Exception
{
- return getWiredContext( ldapService, null );
+ return getWiredContext( ldapServer, null );
}
@@ -68,17 +68,17 @@
* SUN LDAP provider. The connection is made using the administrative
* user as the principalDN. The context is to the rootDSE.
*
- * @param ldapService the LDAP server to get the connection to
+ * @param ldapServer the LDAP server to get the connection to
* @return an LdapContext as the administrative user to the RootDSE
* @throws Exception if there are problems creating the context
*/
- public static LdapContext getWiredContext( LdapService ldapService, String principalDn, String password )
+ public static LdapContext getWiredContext( LdapServer ldapServer, String principalDn, String password )
throws Exception
{
- LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapService.getPort() );
+ LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapServer.getPort() );
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, CTX_FACTORY );
- env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapService.getPort() );
+ env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapServer.getPort() );
env.put( Context.SECURITY_PRINCIPAL, principalDn );
env.put( Context.SECURITY_CREDENTIALS, password );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -91,16 +91,16 @@
* SUN LDAP provider. The connection is made using the administrative
* user as the principalDN. The context is to the rootDSE.
*
- * @param ldapService the LDAP server to get the connection to
+ * @param ldapServer the LDAP server to get the connection to
* @return an LdapContext as the administrative user to the RootDSE
* @throws Exception if there are problems creating the context
*/
- public static LdapContext getWiredContext( LdapService ldapService, Control[] controls ) throws Exception
+ public static LdapContext getWiredContext( LdapServer ldapServer, Control[] controls ) throws Exception
{
- LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapService.getPort() );
+ LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapServer.getPort() );
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, CTX_FACTORY );
- env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapService.getPort() );
+ env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapServer.getPort() );
env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -113,16 +113,16 @@
* SUN LDAP provider. The connection is made using the administrative
* user as the principalDN. The context is to the rootDSE.
*
- * @param ldapService the LDAP server to get the connection to
+ * @param ldapServer the LDAP server to get the connection to
* @return an LdapContext as the administrative user to the RootDSE
* @throws Exception if there are problems creating the context
*/
- public static LdapContext getWiredContextThrowOnRefferal( LdapService ldapService ) throws Exception
+ public static LdapContext getWiredContextThrowOnRefferal( LdapServer ldapServer ) throws Exception
{
- LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapService.getPort() );
+ LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapServer.getPort() );
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, CTX_FACTORY );
- env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapService.getPort() );
+ env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapServer.getPort() );
env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -136,16 +136,16 @@
* SUN LDAP provider. The connection is made using the administrative
* user as the principalDN. The context is to the rootDSE.
*
- * @param ldapService the LDAP server to get the connection to
+ * @param ldapServer the LDAP server to get the connection to
* @return an LdapContext as the administrative user to the RootDSE
* @throws Exception if there are problems creating the context
*/
- public static LdapContext getWiredContextRefferalIgnore( LdapService ldapService ) throws Exception
+ public static LdapContext getWiredContextRefferalIgnore( LdapServer ldapServer ) throws Exception
{
- LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapService.getPort() );
+ LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapServer.getPort() );
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, CTX_FACTORY );
- env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapService.getPort() );
+ env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapServer.getPort() );
env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -159,16 +159,16 @@
* SUN LDAP provider. The connection is made using the administrative
* user as the principalDN. The context is to the rootDSE.
*
- * @param ldapService the LDAP server to get the connection to
+ * @param ldapServer the LDAP server to get the connection to
* @return an LdapContext as the administrative user to the RootDSE
* @throws Exception if there are problems creating the context
*/
- public static LdapContext getWiredContextFollowOnRefferal( LdapService ldapService ) throws Exception
+ public static LdapContext getWiredContextFollowOnRefferal( LdapServer ldapServer ) throws Exception
{
- LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapService.getPort() );
+ LOG.debug( "Creating a wired context to local LDAP server on port {}", ldapServer.getPort() );
Hashtable<String, String> env = new Hashtable<String, String>();
env.put( Context.INITIAL_CONTEXT_FACTORY, CTX_FACTORY );
- env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapService.getPort() );
+ env.put( Context.PROVIDER_URL, "ldap://localhost:" + ldapServer.getPort() );
env.put( Context.SECURITY_PRINCIPAL, ServerDNConstants.ADMIN_SYSTEM_DN );
env.put( Context.SECURITY_CREDENTIALS, "secret" );
env.put( Context.SECURITY_AUTHENTICATION, "simple" );
@@ -177,13 +177,13 @@
}
- public static LDAPConnection getWiredConnection( LdapService ldapService ) throws Exception
+ public static LDAPConnection getWiredConnection( LdapServer ldapServer ) throws Exception
{
String testServer = System.getProperty( "ldap.test.server", null );
if ( testServer == null )
{
- return getWiredConnection( ldapService, ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
+ return getWiredConnection( ldapServer, ServerDNConstants.ADMIN_SYSTEM_DN, "secret" );
}
LOG.debug( "ldap.test.server = " + testServer );
@@ -206,11 +206,11 @@
}
- public static LDAPConnection getWiredConnection( LdapService ldapService, String principalDn, String password )
+ public static LDAPConnection getWiredConnection( LdapServer ldapServer, String principalDn, String password )
throws Exception
{
LDAPConnection conn = new LDAPConnection();
- conn.connect( 3, "localhost", ldapService.getPort(), principalDn, password );
+ conn.connect( 3, "localhost", ldapServer.getPort(), principalDn, password );
return conn;
}
}
Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/StartedPristineState.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/StartedPristineState.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/StartedPristineState.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/StartedPristineState.java Sun Jun 14 09:14:31 2009
@@ -24,7 +24,7 @@
import java.io.IOException;
import org.apache.directory.server.integ.InheritableServerSettings;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.model.Statement;
import org.junit.runners.model.TestClass;
@@ -78,7 +78,7 @@
public void startup() throws Exception
{
LOG.debug( "calling start()" );
- LdapService server = context.getLdapServer();
+ LdapServer server = context.getLdapServer();
server.getDirectoryService().startup();
server.start();
}
@@ -92,7 +92,7 @@
public void shutdown() throws Exception
{
LOG.debug( "calling stop()" );
- LdapService server = context.getLdapServer();
+ LdapServer server = context.getLdapServer();
server.stop();
server.getDirectoryService().shutdown();
}
Modified: directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/TestServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/TestServerContext.java?rev=784530&r1=784529&r2=784530&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/TestServerContext.java (original)
+++ directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/TestServerContext.java Sun Jun 14 09:14:31 2009
@@ -26,7 +26,7 @@
import javax.naming.NamingException;
import org.apache.directory.server.integ.InheritableServerSettings;
-import org.apache.directory.server.ldap.LdapService;
+import org.apache.directory.server.ldap.LdapServer;
import org.junit.runner.Description;
import org.junit.runner.notification.Failure;
import org.junit.runner.notification.RunNotifier;
@@ -66,7 +66,7 @@
private TestServerState state = nonExistentState;
/** the ldap server managed by this context */
- private LdapService ldapService;
+ private LdapServer ldapServer;
/**
@@ -212,7 +212,7 @@
{
try
{
- Field field = testClass.getJavaClass().getDeclaredField( "ldapService" );
+ Field field = testClass.getJavaClass().getDeclaredField( "ldapServer" );
field.set( testClass.getJavaClass(), getServerContext().getLdapServer() );
notifier.fireTestStarted( description );
@@ -293,15 +293,15 @@
}
- LdapService getLdapServer()
+ LdapServer getLdapServer()
{
- return ldapService;
+ return ldapServer;
}
- void setLdapServer( LdapService ldapService )
+ void setLdapServer( LdapServer ldapServer )
{
- this.ldapService = ldapService;
+ this.ldapServer = ldapServer;
}