From commits-return-19560-apmail-directory-commits-archive=directory.apache.org@directory.apache.org Sun Sep 07 19:00:58 2008 Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 34936 invoked from network); 7 Sep 2008 19:00:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Sep 2008 19:00:58 -0000 Received: (qmail 29298 invoked by uid 500); 7 Sep 2008 19:00:56 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 29265 invoked by uid 500); 7 Sep 2008 19:00:56 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 29256 invoked by uid 99); 7 Sep 2008 19:00:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Sep 2008 12:00:55 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Sep 2008 18:59:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BE0B923889B7; Sun, 7 Sep 2008 12:00:27 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r692919 [1/4] - in /directory/apacheds/trunk: protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/ protocol-ldap/src/main/java/org/apache/directory/server/ldap/ protocol-ldap/src/main/java/org/apache/directory/server/ld... Date: Sun, 07 Sep 2008 19:00:24 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080907190027.BE0B923889B7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: akarasulu Date: Sun Sep 7 12:00:21 2008 New Revision: 692919 URL: http://svn.apache.org/viewvc?rev=692919&view=rev Log: DIRSERVER-1140: Rename LdapServer to LdapService. NOTE: Will impact studio plugins for ApacheDS. Added: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java (with props) Removed: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java Modified: directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/BindHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/LdapRequestHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchAbandonListener.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/UnbindHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/bind/digestMD5/DigestMd5MechanismHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/GracefulShutdownHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/LaunchDiagnosticUiHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StartTlsHandler.java directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/StoredProcedureExtendedOperationHandler.java directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapServerSettingsTest.java directory/apacheds/trunk/protocol-ldap/src/test/java/org/apache/directory/server/ldap/SettingAlternativeHandlersTest.java directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/LdapServerFactory.java directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/ServerIntegrationUtils.java directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/StartedPristineState.java directory/apacheds/trunk/server-integ/src/main/java/org/apache/directory/server/integ/state/TestServerContext.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/KeyDerivationServiceIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/kerberos/PasswordPolicyServiceIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/add/AddingEntriesWithSpecialCharactersInRDNIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/BindIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/MiscBindIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SaslBindIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/bind/SimpleBindIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/CompareIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/compare/MatchingRuleCompareIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/delete/DeleteIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/ExtendedIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/extended/StoredProcedureIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/IllegalModificationIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyAddIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReferralIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyRemoveIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modify/ModifyReplaceIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyDnReferralIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/ModifyRdnIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/modifydn/MoveIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/IndexedNegationSearchIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/NegationSearchIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/ReferralSearchIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SchemaSearchIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/SearchLimitsIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/LdapsIT.java directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/ssl/StartTlsIT.java directory/apacheds/trunk/server-jndi/src/main/java/org/apache/directory/server/configuration/ApacheDS.java directory/apacheds/trunk/server-jndi/src/test/java/org/apache/directory/server/configuration/ApacheDSTest.java directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/CapacityTestCommand.java directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DiagnosticCommand.java directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/DisconnectNotificationCommand.java directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/GracefulShutdownCommand.java directory/apacheds/trunk/server-tools/src/main/java/org/apache/directory/server/tools/ImportCommand.java directory/apacheds/trunk/server-unit/src/main/java/org/apache/directory/server/unit/AbstractServerTest.java directory/apacheds/trunk/server-xml/src/main/resources/server.xml Modified: directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java?rev=692919&r1=692918&r2=692919&view=diff ============================================================================== --- directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java (original) +++ directory/apacheds/trunk/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/kdc/SaslGssapiBindITest.java Sun Sep 7 12:00:21 2008 @@ -83,8 +83,8 @@ { super.setUp(); - ldapServer.setSaslHost( "localhost" ); - ldapServer.setSaslPrincipal( "ldap/localhost@EXAMPLE.COM" ); + ldapService.setSaslHost( "localhost" ); + ldapService.setSaslPrincipal( "ldap/localhost@EXAMPLE.COM" ); KdcServer kdcConfig = new KdcServer(); kdcConfig.setSocketAcceptor( socketAcceptor ); @@ -118,10 +118,10 @@ } LdapDN contextDn = new LdapDN( "dc=example,dc=com" ); - ServerEntry entry = ldapServer.getDirectoryService().newEntry( contextDn ); + ServerEntry entry = ldapService.getDirectoryService().newEntry( contextDn ); entry.add( "objectClass", "top", "domain", "extensibleObject" ); entry.add( "dc", "example" ); - ldapServer.getDirectoryService().getAdminSession().add( entry ); + ldapService.getDirectoryService().getAdminSession().add( entry ); // Get a context, create the ou=users subcontext, then create the 3 principals. Hashtable env = new Hashtable(); Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java?rev=692919&r1=692918&r2=692919&view=diff ============================================================================== --- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java (original) +++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/ExtendedOperationHandler.java Sun Sep 7 12:00:21 2008 @@ -67,7 +67,7 @@ /** * Sets the LDAP server for this extendedOperation handler. * - * @param ldapServer the ldap protocol server + * @param ldapService the ldap protocol server */ - void setLdapServer( LdapServer ldapServer ); + void setLdapServer( LdapService ldapService ); } Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java?rev=692919&r1=692918&r2=692919&view=diff ============================================================================== --- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java (original) +++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolHandler.java Sun Sep 7 12:00:21 2008 @@ -44,10 +44,10 @@ /** * The MINA IoHandler implementation extending {@link DemuxingIoHandler} for - * the LDAP protocol. THe {@link LdapServer} creates this multiplexing + * the LDAP protocol. THe {@link LdapService} creates this multiplexing * {@link IoHandler} handler and populates it with subordinate handlers for * the various kinds of LDAP {@link Request} messages. This is done in the - * setXxxHandler() methods of the LdapServer where Xxxx is Add, Modify, etc. + * setXxxHandler() methods of the LdapService where Xxxx is Add, Modify, etc. * * @author Apache Directory Project * @version $Rev$, $Date$ @@ -57,18 +57,18 @@ /** The logger */ private static final Logger LOG = LoggerFactory.getLogger( LdapProtocolHandler.class ); - /** the {@link LdapServer} this handler is associated with */ - private final LdapServer ldapServer; + /** the {@link LdapService} this handler is associated with */ + private final LdapService ldapService; /** * Creates a new instance of LdapProtocolHandler. * - * @param ldapServer + * @param ldapService */ - LdapProtocolHandler( LdapServer ldapServer ) + LdapProtocolHandler( LdapService ldapService ) { - this.ldapServer = ldapServer; + this.ldapService = ldapService; } @@ -80,8 +80,8 @@ { LdapSession ldapSession = new LdapSession( session ); IoFilterChain filters = session.getFilterChain(); - filters.addLast( "codec", new ProtocolCodecFilter( ldapServer.getProtocolCodecFactory() ) ); - ldapServer.getLdapSessionManager().addLdapSession( ldapSession ); + filters.addLast( "codec", new ProtocolCodecFilter( ldapService.getProtocolCodecFactory() ) ); + ldapService.getLdapSessionManager().addLdapSession( ldapSession ); } @@ -91,7 +91,7 @@ */ public void sessionClosed( IoSession session ) { - LdapSession ldapSession = ldapServer.getLdapSessionManager().removeLdapSession( session ); + LdapSession ldapSession = ldapService.getLdapSessionManager().removeLdapSession( session ); cleanUpSession( ldapSession ); } @@ -167,7 +167,7 @@ for ( Control control1 : req.getControls().values() ) { MutableControl control = ( MutableControl ) control1; - if ( control.isCritical() && ! ldapServer.getSupportedControls().contains( control.getID() ) ) + if ( control.isCritical() && ! ldapService.getSupportedControls().contains( control.getID() ) ) { ResultResponse resp = req.getResultResponse(); resp.getLdapResult().setErrorMessage( "Unsupport critical control: " + control.getID() ); @@ -203,7 +203,7 @@ "Unexpected exception forcing session to close: sending disconnect notice to client.", cause ); session.write( NoticeOfDisconnect.PROTOCOLERROR ); - LdapSession ldapSession = this.ldapServer.getLdapSessionManager().removeLdapSession( session ); + LdapSession ldapSession = this.ldapService.getLdapSessionManager().removeLdapSession( session ); cleanUpSession( ldapSession ); session.close(); } Added: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java?rev=692919&view=auto ============================================================================== --- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java (added) +++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java Sun Sep 7 12:00:21 2008 @@ -0,0 +1,1007 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.server.ldap; + + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.security.KeyStore; +import java.security.Provider; +import java.security.Security; +import java.util.*; + + +import org.apache.directory.server.core.DirectoryService; +import org.apache.directory.server.core.partition.PartitionNexus; +import org.apache.directory.server.core.security.CoreKeyStoreSpi; +import org.apache.directory.server.ldap.handlers.LdapRequestHandler; +import org.apache.directory.server.ldap.handlers.AbandonHandler; +import org.apache.directory.server.ldap.handlers.AddHandler; +import org.apache.directory.server.ldap.handlers.BindHandler; +import org.apache.directory.server.ldap.handlers.CompareHandler; +import org.apache.directory.server.ldap.handlers.DeleteHandler; +import org.apache.directory.server.ldap.handlers.ExtendedHandler; +import org.apache.directory.server.ldap.handlers.ModifyDnHandler; +import org.apache.directory.server.ldap.handlers.ModifyHandler; +import org.apache.directory.server.ldap.handlers.SearchHandler; +import org.apache.directory.server.ldap.handlers.UnbindHandler; +import org.apache.directory.server.ldap.handlers.bind.*; +import org.apache.directory.server.ldap.handlers.ssl.LdapsInitializer; +import org.apache.directory.server.protocol.shared.DirectoryBackedService; +import org.apache.directory.shared.ldap.constants.SaslQoP; +import org.apache.directory.shared.ldap.exception.LdapConfigurationException; +import org.apache.directory.shared.ldap.message.AbandonRequest; +import org.apache.directory.shared.ldap.message.AddRequest; +import org.apache.directory.shared.ldap.message.BindRequest; +import org.apache.directory.shared.ldap.message.CascadeControl; +import org.apache.directory.shared.ldap.message.CompareRequest; +import org.apache.directory.shared.ldap.message.DeleteRequest; +import org.apache.directory.shared.ldap.message.EntryChangeControl; +import org.apache.directory.shared.ldap.message.ExtendedRequest; +import org.apache.directory.shared.ldap.message.ManageDsaITControl; +import org.apache.directory.shared.ldap.message.ModifyDnRequest; +import org.apache.directory.shared.ldap.message.ModifyRequest; +import org.apache.directory.shared.ldap.message.PersistentSearchControl; +import org.apache.directory.shared.ldap.message.SearchRequest; +import org.apache.directory.shared.ldap.message.SubentriesControl; +import org.apache.directory.shared.ldap.message.UnbindRequest; +import org.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect; +import org.apache.mina.common.DefaultIoFilterChainBuilder; +import org.apache.mina.common.IoFilterChainBuilder; +import org.apache.mina.common.IoHandler; +import org.apache.mina.common.IoSession; +import org.apache.mina.common.ThreadModel; +import org.apache.mina.common.WriteFuture; +import org.apache.mina.filter.codec.ProtocolCodecFactory; +import org.apache.mina.handler.demux.MessageHandler; +import org.apache.mina.transport.socket.nio.SocketAcceptorConfig; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +/** + * An LDAP protocol provider implementation which dynamically associates + * handlers. + * + * @author Apache Directory Project + * @version $Rev: 688548 $ + * @org.apache.xbean.XBean + */ +public class LdapService extends DirectoryBackedService +{ + /** Value (0) for configuration where size limit is unlimited. */ + public static final int NO_SIZE_LIMIT = 0; + + /** Value (0) for configuration where time limit is unlimited. */ + public static final int NO_TIME_LIMIT = 0; + + /** the constant service name of this ldap protocol provider **/ + public static final String SERVICE_NAME = "ldap"; + + + + private static final long serialVersionUID = 3757127143811666817L; + + /** logger for this class */ + private static final Logger LOG = LoggerFactory.getLogger( LdapService.class.getName() ); + + /** The default maximum size limit. */ + private static final int MAX_SIZE_LIMIT_DEFAULT = 100; + + /** The default maximum time limit. */ + private static final int MAX_TIME_LIMIT_DEFAULT = 10000; + + /** The default service pid. */ + private static final String SERVICE_PID_DEFAULT = "org.apache.directory.server.ldap"; + + /** The default service name. */ + private static final String SERVICE_NAME_DEFAULT = "ApacheDS LDAP Service"; + + /** The default IP port. */ + private static final int IP_PORT_DEFAULT = 389; + + /** the session manager for this LdapService */ + private LdapSessionManager ldapSessionManager = new LdapSessionManager(); + + /** a set of supported controls */ + private Set supportedControls; + + /** + * The maximum size limit. + * @see {@link LdapService#MAX_SIZE_LIMIT_DEFAULT } + */ + private int maxSizeLimit = MAX_SIZE_LIMIT_DEFAULT; + + /** + * The maximum time limit. + * @see {@link LdapService#MAX_TIME_LIMIT_DEFAULT } + */ + private int maxTimeLimit = MAX_TIME_LIMIT_DEFAULT; + + /** Whether LDAPS is enabled: disabled by default. */ + private boolean enableLdaps; + + /** Whether to allow anonymous access: enabled by default. */ + private boolean allowAnonymousAccess = true; + + /** The extended operation handlers. */ + private final Collection extendedOperationHandlers = + new ArrayList(); + + /** The supported authentication mechanisms. */ + private Map saslMechanismHandlers = + new HashMap(); + + /** The name of this host, validated during SASL negotiation. */ + private String saslHost = "ldap.example.com"; + + /** The service principal, used by GSSAPI. */ + private String saslPrincipal = "ldap/ldap.example.com@EXAMPLE.COM"; + + /** The quality of protection (QoP), used by DIGEST-MD5 and GSSAPI. */ + private Set saslQop; + private String saslQopString; + + /** The list of realms serviced by this host. */ + private List saslRealms; + + private LdapRequestHandler abandonHandler; + private LdapRequestHandler addHandler; + private LdapRequestHandler bindHandler; + private LdapRequestHandler compareHandler; + private LdapRequestHandler deleteHandler; + private LdapRequestHandler extendedHandler; + private LdapRequestHandler modifyHandler; + private LdapRequestHandler modifyDnHandler; + private LdapRequestHandler searchHandler; + private LdapRequestHandler unbindHandler; + + + /** the underlying provider codec factory */ + private ProtocolCodecFactory codecFactory; + + /** the MINA protocol handler */ + private final LdapProtocolHandler handler = new LdapProtocolHandler(this); + + /** tracks start state of the server */ + private boolean started; + + /** + * Whether or not confidentiality (TLS secured connection) is required: + * disabled by default. + */ + private boolean confidentialityRequired; + + + /** + * Creates an LDAP protocol provider. + */ + public LdapService() + { + super.setIpPort( IP_PORT_DEFAULT ); + super.setEnabled( true ); + super.setServiceId( SERVICE_PID_DEFAULT ); + super.setServiceName( SERVICE_NAME_DEFAULT ); + + saslQop = new HashSet(); + saslQop.add( SaslQoP.QOP_AUTH ); + saslQop.add( SaslQoP.QOP_AUTH_INT ); + saslQop.add( SaslQoP.QOP_AUTH_CONF ); + saslQopString = SaslQoP.QOP_AUTH + ',' + SaslQoP.QOP_AUTH_INT + ',' + SaslQoP.QOP_AUTH_CONF; + + saslRealms = new ArrayList(); + saslRealms.add( "example.com" ); + + this.supportedControls = new HashSet(); + this.supportedControls.add( PersistentSearchControl.CONTROL_OID ); + this.supportedControls.add( EntryChangeControl.CONTROL_OID ); + this.supportedControls.add( SubentriesControl.CONTROL_OID ); + this.supportedControls.add( ManageDsaITControl.CONTROL_OID ); + this.supportedControls.add( CascadeControl.CONTROL_OID ); + } + + + /** + * Install the LDAP request handlers. + */ + private void installDefaultHandlers() + { + if ( getAbandonHandler() == null ) + { + setAbandonHandler( new AbandonHandler() ); + } + + if ( getAddHandler() == null ) + { + setAddHandler( new AddHandler() ); + } + + if ( getBindHandler() == null ) + { + BindHandler handler = new BindHandler(); + handler.setSaslMechanismHandlers( saslMechanismHandlers ); + setBindHandler( handler ); + } + + if ( getCompareHandler() == null ) + { + setCompareHandler( new CompareHandler() ); + } + + if ( getDeleteHandler() == null ) + { + setDeleteHandler( new DeleteHandler() ); + } + + if ( getExtendedHandler() == null ) + { + setExtendedHandler( new ExtendedHandler() ); + } + + if ( getModifyHandler() == null ) + { + setModifyHandler( new ModifyHandler() ); + } + + if ( getModifyDnHandler() == null ) + { + setModifyDnHandler( new ModifyDnHandler() ); + } + + if ( getSearchHandler() == null ) + { + setSearchHandler( new SearchHandler() ); + } + + if ( getUnbindHandler() == null ) + { + setUnbindHandler( new UnbindHandler() ); + } + } + + + /** + * @throws IOException if we cannot bind to the specified port + * @throws NamingException if the LDAP server cannot be started + */ + public void start() throws Exception + { + if ( ! isEnabled() ) + { + return; + } + + IoFilterChainBuilder chain; + + if ( isEnableLdaps() ) + { + Provider provider = Security.getProvider( "SUN" ); + LOG.debug( "provider = {}", provider ); + CoreKeyStoreSpi coreKeyStoreSpi = new CoreKeyStoreSpi( getDirectoryService() ); + KeyStore keyStore = new KeyStore( coreKeyStoreSpi, provider, "JKS" ) {}; + try + { + keyStore.load( null, null ); + } + catch ( Exception e ) + { + // nothing really happens with this keystore + } + chain = LdapsInitializer.init( keyStore ); + } + else + { + chain = new DefaultIoFilterChainBuilder(); + } + + /* + * The serveur is now initialized, we can + * install the default requests handlers, which need + * access to the DirectoryServer instance. + */ + installDefaultHandlers(); + + startLDAP0( getIpPort(), chain ); + + started = true; + } + + + public void stop() + { + try + { + // we should unbind the service before we begin sending the notice + // of disconnect so new connections are not formed while we process + List writeFutures = new ArrayList(); + + // If the socket has already been unbound as with a successful + // GracefulShutdownRequest then this will complain that the service + // is not bound - this is ok because the GracefulShutdown has already + // sent notices to to the existing active sessions + List sessions; + + try + { + sessions = new ArrayList( + getSocketAcceptor().getManagedSessions( new InetSocketAddress( getIpPort() ) ) ); + } + catch ( IllegalArgumentException e ) + { + LOG.warn( "Seems like the LDAP service (" + getIpPort() + ") has already been unbound." ); + return; + } + + getSocketAcceptor().unbind( new InetSocketAddress( getIpPort() ) ); + + if ( LOG.isInfoEnabled() ) + { + LOG.info( "Unbind of an LDAP service (" + getIpPort() + ") is complete." ); + LOG.info( "Sending notice of disconnect to existing clients sessions." ); + } + + // Send Notification of Disconnection messages to all connected clients. + if ( sessions != null ) + { + for ( IoSession session:sessions ) + { + writeFutures.add( session.write( NoticeOfDisconnect.UNAVAILABLE ) ); + } + } + + // And close the connections when the NoDs are sent. + Iterator sessionIt = sessions.iterator(); + + for ( WriteFuture future:writeFutures ) + { + future.join( 1000 ); + sessionIt.next().close(); + } + } + catch ( Exception e ) + { + LOG.warn( "Failed to sent NoD.", e ); + } + } + + + private void startLDAP0( int port, IoFilterChainBuilder chainBuilder ) + throws Exception + { + PartitionNexus nexus = getDirectoryService().getPartitionNexus(); + + for ( ExtendedOperationHandler h : extendedOperationHandlers ) + { + LOG.info( "Added Extended Request Handler: " + h.getOid() ); + h.setLdapServer( this ); + nexus.registerSupportedExtensions( h.getExtensionOids() ); + } + + nexus.registerSupportedSaslMechanisms( saslMechanismHandlers.keySet() ); + + try + { + SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig(); + + // Disable the disconnection of the clients on unbind + acceptorCfg.setDisconnectOnUnbind( false ); + acceptorCfg.setReuseAddress( true ); + acceptorCfg.setFilterChainBuilder( chainBuilder ); + acceptorCfg.setThreadModel( ThreadModel.MANUAL ); + + acceptorCfg.getSessionConfig().setTcpNoDelay( true ); + + getSocketAcceptor().bind( new InetSocketAddress( port ), getHandler(), acceptorCfg ); + started = true; + + if ( LOG.isInfoEnabled() ) + { + LOG.info( "Successful bind of an LDAP Service (" + port + ") is complete." ); + } + } + catch ( IOException e ) + { + String msg = "Failed to bind an LDAP service (" + port + ") to the service registry."; + LdapConfigurationException lce = new LdapConfigurationException( msg ); + lce.setRootCause( e ); + LOG.error( msg, e ); + throw lce; + } + } + + + public String getName() + { + return SERVICE_NAME; + } + + + public IoHandler getHandler() + { + return handler; + } + + + public LdapSessionManager getLdapSessionManager() + { + return ldapSessionManager; + } + + + public ProtocolCodecFactory getProtocolCodecFactory() + { + return codecFactory; + } + + + // ------------------------------------------------------------------------ + // Configuration Methods + // ------------------------------------------------------------------------ + + + /** + * Registeres the specified {@link ExtendedOperationHandler} to this + * protocol provider to provide a specific LDAP extended operation. + * + * @param eoh an extended operation handler + * @throws NamingException on failure to add the handler + */ + public void addExtendedOperationHandler( ExtendedOperationHandler eoh ) throws Exception + { + if ( started ) + { + eoh.setLdapServer( this ); + PartitionNexus nexus = getDirectoryService().getPartitionNexus(); + nexus.registerSupportedExtensions( eoh.getExtensionOids() ); + } + else + { + extendedOperationHandlers.add( eoh ); + } + } + + + /** + * Deregisteres an {@link ExtendedOperationHandler} with the specified oid + * from this protocol provider. + * + * @param oid the numeric identifier for the extended operation associated with + * the handler to remove + */ + public void removeExtendedOperationHandler( String oid ) + { + // need to do something like this to make this work right + // PartitionNexus nexus = getDirectoryService().getPartitionNexus(); + // nexus.unregisterSupportedExtensions( eoh.getExtensionOids() ); + + ExtendedOperationHandler handler = null; + for ( ExtendedOperationHandler h : extendedOperationHandlers ) + { + if ( h.getOid().equals( oid ) ) + { + handler = h; + break; + } + } + extendedOperationHandlers.remove( handler ); + } + + + /** + * Returns an {@link ExtendedOperationHandler} with the specified oid + * which is registered to this protocol provider. + * + * @param oid the oid of the extended request of associated with the extended + * request handler + * @return the exnteded operation handler + */ + public ExtendedOperationHandler getExtendedOperationHandler( String oid ) + { + for ( ExtendedOperationHandler h : extendedOperationHandlers ) + { + if ( h.getOid().equals( oid ) ) + { + return h; + } + } + + return null; + } + + + /** + * Sets the mode for this LdapService to accept requests with or without a + * TLS secured connection via either StartTLS extended operations or using + * LDAPS. + * + * @param confidentialityRequired true to require confidentiality + */ + public void setConfidentialityRequired( boolean confidentialityRequired ) + { + this.confidentialityRequired = confidentialityRequired; + } + + + /** + * Gets whether or not TLS secured connections are required to perform + * operations on this LdapService. + * + * @return true if TLS secured connections are required, false otherwise + */ + public boolean isConfidentialityRequired() + { + return confidentialityRequired; + } + + + /** + * Returns true if LDAPS is enabled. + * + * @return True if LDAPS is enabled. + */ + public boolean isEnableLdaps() + { + return enableLdaps; + } + + + /** + * Sets if LDAPS is enabled or not. + * + * @param enableLdaps Whether LDAPS is enabled. + */ + public void setEnableLdaps( boolean enableLdaps ) + { + this.enableLdaps = enableLdaps; + } + + + /** + * Returns true if anonymous access is allowed. + * + * @return True if anonymous access is allowed. + */ + public boolean isAllowAnonymousAccess() + { + return allowAnonymousAccess; + } + + + /** + * Sets whether to allow anonymous access or not. + * + * @param enableAnonymousAccess Set true to allow anonymous access. + */ + public void setAllowAnonymousAccess( boolean enableAnonymousAccess ) + { + this.allowAnonymousAccess = enableAnonymousAccess; + } + + + /** + * Sets the maximum size limit in number of entries to return for search. + * + * @param maxSizeLimit the maximum number of entries to return for search + */ + public void setMaxSizeLimit( int maxSizeLimit ) + { + this.maxSizeLimit = maxSizeLimit; + } + + + /** + * Returns the maximum size limit in number of entries to return for search. + * + * @return The maximum size limit. + */ + public int getMaxSizeLimit() + { + return maxSizeLimit; + } + + + /** + * Sets the maximum time limit in miliseconds to conduct a search. + * + * @param maxTimeLimit the maximum length of time in milliseconds for search + */ + public void setMaxTimeLimit( int maxTimeLimit ) + { + this.maxTimeLimit = maxTimeLimit; + } + + + /** + * Returns the maximum time limit in milliseonds to conduct a search. + * + * @return The maximum time limit in milliseconds for search + */ + public int getMaxTimeLimit() + { + return maxTimeLimit; + } + + + /** + * Gets the {@link ExtendedOperationHandler}s. + * + * @return A collection of {@link ExtendedOperationHandler}s. + */ + public Collection getExtendedOperationHandlers() + { + return new ArrayList( extendedOperationHandlers ); + } + + + /** + * Sets the {@link ExtendedOperationHandler}s. + * + * @org.apache.xbean.Property nestedType="org.apache.directory.server.ldap.ExtendedOperationHandler" + * + * @param handlers A collection of {@link ExtendedOperationHandler}s. + */ + public void setExtendedOperationHandlers( Collection handlers ) + { + this.extendedOperationHandlers.clear(); + this.extendedOperationHandlers.addAll( handlers ); + } + + + /** + * Returns the FQDN of this SASL host, validated during SASL negotiation. + * + * @return The FQDN of this SASL host, validated during SASL negotiation. + */ + public String getSaslHost() + { + return saslHost; + } + + + /** + * Sets the FQDN of this SASL host, validated during SASL negotiation. + * + * @param saslHost The FQDN of this SASL host, validated during SASL negotiation. + */ + public void setSaslHost( String saslHost ) + { + this.saslHost = saslHost; + } + + + /** + * Returns the Kerberos principal name for this LDAP service, used by GSSAPI. + * + * @return The Kerberos principal name for this LDAP service, used by GSSAPI. + */ + public String getSaslPrincipal() + { + return saslPrincipal; + } + + + /** + * Sets the Kerberos principal name for this LDAP service, used by GSSAPI. + * + * @param saslPrincipal The Kerberos principal name for this LDAP service, used by GSSAPI. + */ + public void setSaslPrincipal( String saslPrincipal ) + { + this.saslPrincipal = saslPrincipal; + } + + + /** + * Returns the quality-of-protection, used by DIGEST-MD5 and GSSAPI. + * + * @return The quality-of-protection, used by DIGEST-MD5 and GSSAPI. + */ + public String getSaslQopString() + { + return saslQopString; + } + + + /** + * Returns the Set of quality-of-protection, used by DIGEST-MD5 and GSSAPI. + * + * @return The quality-of-protection, used by DIGEST-MD5 and GSSAPI. + */ + public Set getSaslQop() + { + return saslQop; + } + + + /** + * Sets the desired quality-of-protection, used by DIGEST-MD5 and GSSAPI. + * + * We build a string from this list, where QoP are comma delimited + * + * @org.apache.xbean.Property nestedType="java.lang.String" + * + * @param saslQop The desired quality-of-protection, used by DIGEST-MD5 and GSSAPI. + */ + public void setSaslQop( Set saslQop ) + { + StringBuilder qopList = new StringBuilder(); + boolean isFirst = true; + + for ( String qop:saslQop ) + { + if ( isFirst ) + { + isFirst = false; + } + else + { + qopList.append( ',' ); + } + + qopList.append( qop ); + } + + this.saslQopString = qopList.toString(); + this.saslQop = saslQop; + } + + + /** + * Returns the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI. + * + * @return The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI. + */ + public List getSaslRealms() + { + return saslRealms; + } + + + /** + * Sets the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI. + * + * @org.apache.xbean.Property nestedType="java.lang.String" + * + * @param saslRealms The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI. + */ + public void setSaslRealms( List saslRealms ) + { + this.saslRealms = saslRealms; + } + + + /** + * @org.apache.xbean.Map flat="true" dups="replace" keyName="mech-name" + */ + public Map getSaslMechanismHandlers() + { + return saslMechanismHandlers; + } + + public void setSaslMechanismHandlers( Map saslMechanismHandlers ) + { + this.saslMechanismHandlers = saslMechanismHandlers; + } + + + public MechanismHandler addSaslMechanismHandler( String mechanism, MechanismHandler handler ) + { + return this.saslMechanismHandlers.put( mechanism, handler ); + } + + + public MechanismHandler removeSaslMechanismHandler( String mechanism ) + { + return this.saslMechanismHandlers.remove( mechanism ); + } + + + public MechanismHandler getMechanismHandler( String mechanism ) + { + return this.saslMechanismHandlers.get( mechanism ); + } + + + public Set getSupportedMechanisms() + { + return saslMechanismHandlers.keySet(); + } + + + public void setDirectoryService( DirectoryService directoryService ) + { + super.setDirectoryService( directoryService ); + this.codecFactory = new LdapProtocolCodecFactory( directoryService ); + } + + + public Set getSupportedControls() + { + return supportedControls; + } + + + public void setSupportedControls( Set supportedControls ) + { + this.supportedControls = supportedControls; + } + + + public MessageHandler getAbandonHandler() + { + return abandonHandler; + } + + + public void setAbandonHandler( LdapRequestHandler abandonHandler ) + { + this.handler.removeMessageHandler( AbandonRequest.class ); + this.abandonHandler = abandonHandler; + this.abandonHandler.setLdapServer( this ); + this.handler.addMessageHandler( AbandonRequest.class, this.abandonHandler ); + } + + + public LdapRequestHandler getAddHandler() + { + return addHandler; + } + + + public void setAddHandler( LdapRequestHandler addHandler ) + { + this.handler.removeMessageHandler( AddRequest.class ); + this.addHandler = addHandler; + this.addHandler.setLdapServer( this ); + this.handler.addMessageHandler( AddRequest.class, this.addHandler ); + } + + + public LdapRequestHandler getBindHandler() + { + return bindHandler; + } + + + public void setBindHandler( LdapRequestHandler bindHandler ) + { + this.handler.removeMessageHandler( BindRequest.class ); + this.bindHandler = bindHandler; + this.bindHandler.setLdapServer( this ); + this.handler.addMessageHandler( BindRequest.class, this.bindHandler ); + } + + + public LdapRequestHandler getCompareHandler() + { + return compareHandler; + } + + + public void setCompareHandler( LdapRequestHandler compareHandler ) + { + this.handler.removeMessageHandler( CompareRequest.class ); + this.compareHandler = compareHandler; + this.compareHandler.setLdapServer( this ); + this.handler.addMessageHandler( CompareRequest.class, this.compareHandler ); + } + + + public LdapRequestHandler getDeleteHandler() + { + return deleteHandler; + } + + + public void setDeleteHandler( LdapRequestHandler deleteHandler ) + { + this.handler.removeMessageHandler( DeleteRequest.class ); + this.deleteHandler = deleteHandler; + this.deleteHandler.setLdapServer( this ); + this.handler.addMessageHandler( DeleteRequest.class, this.deleteHandler ); + } + + + public LdapRequestHandler getExtendedHandler() + { + return extendedHandler; + } + + + public void setExtendedHandler( LdapRequestHandler extendedHandler ) + { + this.handler.removeMessageHandler( ExtendedRequest.class ); + this.extendedHandler = extendedHandler; + this.extendedHandler.setLdapServer( this ); + this.handler.addMessageHandler( ExtendedRequest.class, this.extendedHandler ); + } + + + public LdapRequestHandler getModifyHandler() + { + return modifyHandler; + } + + + public void setModifyHandler( LdapRequestHandler modifyHandler ) + { + this.handler.removeMessageHandler( ModifyRequest.class ); + this.modifyHandler = modifyHandler; + this.modifyHandler.setLdapServer( this ); + this.handler.addMessageHandler( ModifyRequest.class, this.modifyHandler ); + } + + + public LdapRequestHandler getModifyDnHandler() + { + return modifyDnHandler; + } + + + public void setModifyDnHandler( LdapRequestHandler modifyDnHandler ) + { + this.handler.removeMessageHandler( ModifyDnRequest.class ); + this.modifyDnHandler = modifyDnHandler; + this.modifyDnHandler.setLdapServer( this ); + this.handler.addMessageHandler( ModifyDnRequest.class, this.modifyDnHandler ); + } + + + public LdapRequestHandler getSearchHandler() + { + return searchHandler; + } + + + public void setSearchHandler( LdapRequestHandler searchHandler ) + { + this.handler.removeMessageHandler( SearchRequest.class ); + this.searchHandler = searchHandler; + this.searchHandler.setLdapServer( this ); + this.handler.addMessageHandler( SearchRequest.class, this.searchHandler ); + } + + + public LdapRequestHandler getUnbindHandler() + { + return unbindHandler; + } + + + public void setUnbindHandler( LdapRequestHandler unbindHandler ) + { + this.handler.removeMessageHandler( UnbindRequest.class ); + this.unbindHandler = unbindHandler; + this.unbindHandler.setLdapServer( this ); + this.handler.addMessageHandler( UnbindRequest.class, this.unbindHandler ); + } + + + public boolean isStarted() + { + return started; + } + + + public void setStarted( boolean started ) + { + this.started = started; + } +} Propchange: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapService.java ------------------------------------------------------------------------------ svn:eol-style = native Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java?rev=692919&r1=692918&r2=692919&view=diff ============================================================================== --- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java (original) +++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSession.java Sun Sep 7 12:00:21 2008 @@ -62,8 +62,8 @@ /** The CoreSession */ private CoreSession coreSession; - /** A reference on the LdapServer instance */ - private LdapServer ldapServer; + /** A reference on the LdapService instance */ + private LdapService ldapService; private Map outstandingRequests; @@ -352,21 +352,21 @@ /** - * @return The LdapServer reference + * @return The LdapService reference */ - public LdapServer getLdapServer() + public LdapService getLdapServer() { - return ldapServer; + return ldapService; } /** - * Store a reference on the LdapServer intance + * Store a reference on the LdapService intance * - * @param ldapServer the LdapServer instance + * @param ldapService the LdapService instance */ - public void setLdapServer( LdapServer ldapServer ) + public void setLdapServer( LdapService ldapService ) { - this.ldapServer = ldapServer; + this.ldapService = ldapService; } } Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java?rev=692919&r1=692918&r2=692919&view=diff ============================================================================== --- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java (original) +++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapSessionManager.java Sun Sep 7 12:00:21 2008 @@ -27,9 +27,9 @@ /** - * Manages sessions in a thread safe manner for the LdapServer. This class is + * Manages sessions in a thread safe manner for the LdapService. This class is * used primarily by the {@link LdapProtocolHandler} to manage sessions and is - * created by the LdapServer which makes it available to the handler. It's job + * created by the LdapService which makes it available to the handler. It's job * is simple and this class was mainly created to be able to expose the session * manager safely to things like the LdapProtocolHandler. * @@ -43,7 +43,7 @@ /** - * Gets the active sessions managed by the LdapServer. + * Gets the active sessions managed by the LdapService. */ public LdapSession[] getSessions() { @@ -52,7 +52,7 @@ /** - * Adds a new LdapSession to the LdapServer. + * Adds a new LdapSession to the LdapService. * * @param ldapSession the newly created {@link LdapSession} */ @@ -66,7 +66,7 @@ /** - * Removes an LdapSession managed by the {@link LdapServer}. This method + * Removes an LdapSession managed by the {@link LdapService}. This method * has no side effects: meaning it does not perform cleanup tasks after * removing the session. This task is handled by the callers. * 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -31,7 +31,7 @@ import javax.swing.JTable; import javax.swing.JButton; -import org.apache.directory.server.ldap.LdapServer; +import org.apache.directory.server.ldap.LdapService; import org.apache.directory.server.ldap.LdapSession; import org.apache.directory.shared.ldap.message.AbandonableRequest; import javax.swing.JTextArea; @@ -51,7 +51,7 @@ private JButton jButton; final LdapSession session; - final LdapServer ldapServer; + final LdapService ldapService; 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, LdapServer ldapServer ) + public OutstandingRequestsDialog( JFrame owner, LdapSession session, LdapService ldapService ) { super( owner, true ); this.session = session; - this.ldapServer = ldapServer; + this.ldapService = ldapService; 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -45,7 +45,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; -import org.apache.directory.server.ldap.LdapServer; +import org.apache.directory.server.ldap.LdapService; 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 LdapServer ldapServer; + private LdapService ldapService; /** * This is the default constructor - * @param ldapServer the session registry + * @param ldapService the session registry */ - public SessionsFrame( LdapServer ldapServer ) + public SessionsFrame( LdapService ldapService ) { super(); - this.ldapServer = ldapServer; + this.ldapService = ldapService; initialize(); } @@ -191,7 +191,7 @@ { sessionsTable = new JTable(); sessionsTable.setSelectionMode( javax.swing.ListSelectionModel.SINGLE_SELECTION ); - sessionsTable.setModel( new SessionsModel( ldapServer.getLdapSessionManager().getSessions() ) ); + sessionsTable.setModel( new SessionsModel( ldapService.getLdapSessionManager().getSessions() ) ); sessionsTable.getSelectionModel().addListSelectionListener( new ListSelectionListener() { public void valueChanged( ListSelectionEvent e ) @@ -363,7 +363,7 @@ { public void actionPerformed( java.awt.event.ActionEvent e ) { - ldapServer.getLdapSessionManager().removeLdapSession( selected.getIoSession() ); + ldapService.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, ldapServer ); + new OutstandingRequestsDialog( SessionsFrame.this, selected, ldapService ); 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( ldapServer.getLdapSessionManager().getSessions() ) ); + sessionsTable.setModel( new SessionsModel( ldapService.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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -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.LdapServer; +import org.apache.directory.server.ldap.LdapService; 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; @@ -233,7 +233,7 @@ private boolean checkMechanism( LdapSession ldapSession, String saslMechanism ) throws Exception { // Guard clause: Reject unsupported SASL mechanisms. - if ( ! ldapServer.getSupportedMechanisms().contains( saslMechanism ) ) + if ( ! ldapService.getSupportedMechanisms().contains( saslMechanism ) ) { LOG.error( "Bind error : {} mechanism not supported. Please check the server.xml " + "configuration file (supportedMechanisms field)", @@ -592,15 +592,15 @@ /** * Create a list of all the configured realms. * - * @param ldapServer the LdapServer for which we want to get the realms + * @param ldapService the LdapService for which we want to get the realms * @return a list of realms, separated by spaces */ - private String getActiveRealms( LdapServer ldapServer ) + private String getActiveRealms( LdapService ldapService ) { StringBuilder realms = new StringBuilder(); boolean isFirst = true; - for ( String realm:ldapServer.getSaslRealms() ) + for ( String realm:ldapService.getSaslRealms() ) { if ( isFirst ) { @@ -618,9 +618,9 @@ } - private Subject getSubject( LdapServer ldapServer ) throws Exception + private Subject getSubject( LdapService ldapService ) throws Exception { - String servicePrincipalName = ldapServer.getSaslPrincipal(); + String servicePrincipalName = ldapService.getSaslPrincipal(); KerberosPrincipal servicePrincipal = new KerberosPrincipal( servicePrincipalName ); GetPrincipal getPrincipal = new GetPrincipal( servicePrincipal ); @@ -629,19 +629,19 @@ try { - entry = findPrincipal( ldapServer, getPrincipal ); + entry = findPrincipal( ldapService, getPrincipal ); } catch ( ServiceConfigurationException sce ) { String message = "Service principal " + servicePrincipalName + " not found at search base DN " - + ldapServer.getSearchBaseDn() + "."; + + ldapService.getSearchBaseDn() + "."; throw new ServiceConfigurationException( message, sce ); } if ( entry == null ) { String message = "Service principal " + servicePrincipalName + " not found at search base DN " - + ldapServer.getSearchBaseDn() + "."; + + ldapService.getSearchBaseDn() + "."; throw new ServiceConfigurationException( message ); } @@ -664,9 +664,9 @@ } - private PrincipalStoreEntry findPrincipal( LdapServer ldapServer, GetPrincipal getPrincipal ) throws Exception + private PrincipalStoreEntry findPrincipal( LdapService ldapService, GetPrincipal getPrincipal ) throws Exception { - CoreSession adminSession = ldapServer.getDirectoryService().getAdminSession(); + CoreSession adminSession = ldapService.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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -21,7 +21,7 @@ import org.apache.directory.server.core.CoreSession; -import org.apache.directory.server.ldap.LdapServer; +import org.apache.directory.server.ldap.LdapService; import org.apache.directory.server.ldap.LdapSession; import org.apache.directory.server.ldap.handlers.extended.StartTlsHandler; import org.apache.directory.shared.ldap.message.AbandonRequest; @@ -46,31 +46,31 @@ public abstract class LdapRequestHandler implements MessageHandler { /** The reference on the Ldap server instance */ - protected LdapServer ldapServer; + protected LdapService ldapService; /** * @return The associated ldap server instance */ - public final LdapServer getLdapServer() + public final LdapService getLdapServer() { - return ldapServer; + return ldapService; } /** * Associates a Ldap server instance to the message handler - * @param ldapServer the associated ldap server instance + * @param ldapService the associated ldap server instance */ - public final void setLdapServer( LdapServer ldapServer ) + public final void setLdapServer( LdapService ldapService ) { - this.ldapServer = ldapServer; + this.ldapService = ldapService; } /** * Checks to see if confidentiality requirements are met. If the - * LdapServer requires confidentiality and the SSLFilter is engaged + * LdapService 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. @@ -85,7 +85,7 @@ public final boolean isConfidentialityRequirementSatisfied( IoSession session ) { - if ( ! ldapServer.isConfidentialityRequired() ) + if ( ! ldapService.isConfidentialityRequired() ) { return true; } @@ -116,12 +116,12 @@ */ public final void messageReceived( IoSession session, T message ) throws Exception { - LdapSession ldapSession = ldapServer.getLdapSessionManager().getLdapSession( session ); + LdapSession ldapSession = ldapService.getLdapSessionManager().getLdapSession( session ); - // TODO - session you get from LdapServer should have the ldapServer + // TODO - session you get from LdapService should have the ldapService // member already set no? Should remove these lines where ever they // may be if that's the case. - ldapSession.setLdapServer( ldapServer ); + ldapSession.setLdapServer( ldapService ); // 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -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.LdapServer; +import org.apache.directory.server.ldap.LdapService; import org.apache.directory.shared.ldap.exception.OperationAbandonedException; import org.apache.directory.shared.ldap.message.AbandonListener; import org.apache.directory.shared.ldap.message.AbandonableRequest; @@ -40,33 +40,33 @@ public class SearchAbandonListener implements AbandonListener { private static final Logger LOG = LoggerFactory.getLogger( SearchAbandonListener.class ); - private final LdapServer ldapServer; + private final LdapService ldapService; private EntryFilteringCursor cursor; private DirectoryListener listener; - public SearchAbandonListener( LdapServer ldapServer, EntryFilteringCursor cursor, DirectoryListener listener ) + public SearchAbandonListener( LdapService ldapService, EntryFilteringCursor cursor, DirectoryListener listener ) { - if ( ldapServer == null ) + if ( ldapService == null ) { - throw new NullPointerException( "ldapServer" ); + throw new NullPointerException( "ldapService" ); } - this.ldapServer = ldapServer; + this.ldapService = ldapService; this.cursor = cursor; this.listener = listener; } - public SearchAbandonListener( LdapServer ldapServer, DirectoryListener listener ) + public SearchAbandonListener( LdapService ldapService, DirectoryListener listener ) { - this ( ldapServer, null, listener ); + this ( ldapService, null, listener ); } - public SearchAbandonListener( LdapServer ldapServer, EntryFilteringCursor cursor ) + public SearchAbandonListener( LdapService ldapService, EntryFilteringCursor cursor ) { - this ( ldapServer, cursor, null ); + this ( ldapService, cursor, null ); } @@ -74,7 +74,7 @@ { if ( listener != null ) { - ldapServer.getDirectoryService().getEventService().removeListener( listener ); + ldapService.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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -57,8 +57,8 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.apache.directory.server.ldap.LdapServer.NO_SIZE_LIMIT; -import static org.apache.directory.server.ldap.LdapServer.NO_TIME_LIMIT; +import static org.apache.directory.server.ldap.LdapService.NO_SIZE_LIMIT; +import static org.apache.directory.server.ldap.LdapService.NO_TIME_LIMIT; import javax.naming.NamingException; @@ -150,7 +150,7 @@ criteria.setScope( req.getScope() ); criteria.setEventMask( EventType.getEventTypes( psearchControl.getChangeTypes() ) ); getLdapServer().getDirectoryService().getEventService().addListener( handler, criteria ); - req.addAbandonListener( new SearchAbandonListener( ldapServer, handler ) ); + req.addAbandonListener( new SearchAbandonListener( ldapService, handler ) ); return; } @@ -235,7 +235,7 @@ * has been configured with unlimited time and the request specifies * unlimited search time */ - if ( ldapServer.getMaxTimeLimit() == NO_TIME_LIMIT && req.getTimeLimit() == NO_TIME_LIMIT ) + if ( ldapService.getMaxTimeLimit() == NO_TIME_LIMIT && req.getTimeLimit() == NO_TIME_LIMIT ) { return; } @@ -247,7 +247,7 @@ */ if ( req.getTimeLimit() == 0 ) { - cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapServer.getMaxTimeLimit(), TimeUnit.SECONDS ) ); + cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapService.getMaxTimeLimit(), TimeUnit.SECONDS ) ); return; } @@ -256,7 +256,7 @@ * less than the maximum limit configured in the server then we * constrain search by the amount specified in the request */ - if ( ldapServer.getMaxTimeLimit() >= req.getTimeLimit() ) + if ( ldapService.getMaxTimeLimit() >= req.getTimeLimit() ) { cursor.setClosureMonitor( new SearchTimeLimitingMonitor( req.getTimeLimit(), TimeUnit.SECONDS ) ); return; @@ -267,14 +267,14 @@ * than what the server's configured maximum limit allows so we limit * the search to the configured limit */ - cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapServer.getMaxTimeLimit(), TimeUnit.SECONDS ) ); + cursor.setClosureMonitor( new SearchTimeLimitingMonitor( ldapService.getMaxTimeLimit(), TimeUnit.SECONDS ) ); } private int getSearchSizeLimits( SearchRequest req, LdapSession session ) { LOG.debug( "req size limit = {}, configured size limit = {}", req.getSizeLimit(), - ldapServer.getMaxSizeLimit() ); + ldapService.getMaxSizeLimit() ); // Don't bother setting size limits for administrators that don't ask for it if ( session.getCoreSession().isAnAdministrator() && req.getSizeLimit() == NO_SIZE_LIMIT ) @@ -293,7 +293,7 @@ * has been configured with unlimited size and the request specifies * unlimited search size */ - if ( ldapServer.getMaxSizeLimit() == NO_SIZE_LIMIT && req.getSizeLimit() == NO_SIZE_LIMIT ) + if ( ldapService.getMaxSizeLimit() == NO_SIZE_LIMIT && req.getSizeLimit() == NO_SIZE_LIMIT ) { return NO_SIZE_LIMIT; } @@ -305,10 +305,10 @@ */ if ( req.getSizeLimit() == 0 ) { - return ldapServer.getMaxSizeLimit(); + return ldapService.getMaxSizeLimit(); } - if ( ldapServer.getMaxSizeLimit() == NO_SIZE_LIMIT ) + if ( ldapService.getMaxSizeLimit() == NO_SIZE_LIMIT ) { return req.getSizeLimit(); } @@ -318,7 +318,7 @@ * less than the maximum limit configured in the server then we * constrain search by the amount specified in the request */ - if ( ldapServer.getMaxSizeLimit() >= req.getSizeLimit() ) + if ( ldapService.getMaxSizeLimit() >= req.getSizeLimit() ) { return req.getSizeLimit(); } @@ -328,7 +328,7 @@ * than what the server's configured maximum limit allows so we limit * the search to the configured limit */ - return ldapServer.getMaxSizeLimit(); + return ldapService.getMaxSizeLimit(); } @@ -356,7 +356,7 @@ { LdapResult ldapResult = req.getResultResponse().getLdapResult(); cursor = session.getCoreSession().search( req ); - req.addAbandonListener( new SearchAbandonListener( ldapServer, cursor ) ); + req.addAbandonListener( new SearchAbandonListener( ldapService, cursor ) ); setTimeLimitsOnCursor( req, session, cursor ); final int sizeLimit = getSearchSizeLimits( req, session ); LOG.debug( "using {} for size limit", sizeLimit ); 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -45,7 +45,7 @@ { session.getCoreSession().unbind( request ); session.getIoSession().close(); - ldapServer.getLdapSessionManager().removeLdapSession( session.getIoSession() ); + ldapService.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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -21,7 +21,7 @@ import org.apache.directory.server.core.CoreSession; -import org.apache.directory.server.ldap.LdapServer; +import org.apache.directory.server.ldap.LdapService; 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 ldapServer the LdapServer for which we want to get the realms + * @param ldapService the LdapService for which we want to get the realms * @return a list of realms, separated by spaces */ - private String getActiveRealms( LdapServer ldapServer ) + private String getActiveRealms( LdapService ldapService ) { StringBuilder realms = new StringBuilder(); boolean isFirst = true; - for ( String realm:ldapServer.getSaslRealms() ) + for ( String realm:ldapService.getSaslRealms() ) { if ( isFirst ) { 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -28,7 +28,7 @@ import java.util.Set; import org.apache.directory.server.ldap.ExtendedOperationHandler; -import org.apache.directory.server.ldap.LdapServer; +import org.apache.directory.server.ldap.LdapService; import org.apache.directory.server.ldap.LdapSession; import org.apache.directory.shared.ldap.message.ExtendedRequest; import org.apache.directory.shared.ldap.message.ResultCodeEnum; @@ -307,7 +307,7 @@ } - public void setLdapServer( LdapServer ldapServer ) + public void setLdapServer( LdapService ldapService ) { } } 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -40,7 +40,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.LdapServer; +import org.apache.directory.server.ldap.LdapService; import org.apache.directory.server.ldap.LdapSession; import org.apache.directory.server.ldap.gui.SessionsFrame; import org.apache.directory.shared.ldap.constants.AuthenticationLevel; @@ -67,7 +67,7 @@ EXTENSION_OIDS = Collections.unmodifiableSet( set ); } - private LdapServer ldapServer; + private LdapService ldapService; public String getOid() @@ -117,9 +117,9 @@ } } - SessionsFrame sessions = new SessionsFrame( ldapServer ); + SessionsFrame sessions = new SessionsFrame( ldapService ); sessions.setRequestor( requestor.getIoSession() ); - sessions.setLdapProvider( ldapServer.getHandler() ); + sessions.setLdapProvider( ldapService.getHandler() ); Point pos = getCenteredPosition( sessions ); pos.y = launchedWindowCount * 20 + pos.y; double multiplier = getAspectRatio() * 20.0; @@ -154,8 +154,8 @@ } - public void setLdapServer( LdapServer ldapServer ) + public void setLdapServer( LdapService ldapService ) { - this.ldapServer = ldapServer; + this.ldapService = ldapService; } } 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -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.LdapServer; +import org.apache.directory.server.ldap.LdapService; import org.apache.directory.server.ldap.LdapSession; import org.apache.directory.shared.ldap.message.ExtendedRequest; import org.apache.directory.shared.ldap.message.ExtendedResponse; @@ -137,12 +137,12 @@ } - public void setLdapServer( LdapServer ldapServer ) + public void setLdapServer( LdapService ldapService ) { LOG.debug( "Setting LDAP Service" ); Provider provider = Security.getProvider( "SUN" ); LOG.debug( "provider = {}", provider ); - CoreKeyStoreSpi coreKeyStoreSpi = new CoreKeyStoreSpi( ldapServer.getDirectoryService() ); + CoreKeyStoreSpi coreKeyStoreSpi = new CoreKeyStoreSpi( ldapService.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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -37,7 +37,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.LdapServer; +import org.apache.directory.server.ldap.LdapService; import org.apache.directory.server.ldap.LdapSession; import org.apache.directory.shared.asn1.ber.Asn1Decoder; import org.apache.directory.shared.asn1.ber.IAsn1Container; @@ -157,7 +157,7 @@ } - public void setLdapServer( LdapServer ldapServer ) + public void setLdapServer( LdapService ldapService ) { } } 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=692919&r1=692918&r2=692919&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 Sep 7 12:00:21 2008 @@ -26,7 +26,7 @@ import static org.junit.Assert.assertTrue; import org.apache.directory.server.ldap.ExtendedOperationHandler; -import org.apache.directory.server.ldap.LdapServer; +import org.apache.directory.server.ldap.LdapService; 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 LdapServer bean. + * Test to confirm correct behavoir for settings on LdapService bean. * * @author Apache Directory Project * @version $$Rev$$ @@ -49,7 +49,7 @@ @Test public void testAddExtendedOperationHandler() throws Exception { - LdapServer server = new LdapServer(); + LdapService server = new LdapService(); StartTlsHandler handler = new StartTlsHandler(); server.addExtendedOperationHandler( handler ); assertEquals( handler, server.getExtendedOperationHandler( handler.getOid() ) ); @@ -61,7 +61,7 @@ @Test public void testSetExtendedOperationHandlers() { - LdapServer server = new LdapServer(); + LdapService server = new LdapService(); StartTlsHandler handler = new StartTlsHandler(); List handlers = new ArrayList(); handlers.add( handler ); @@ -75,7 +75,7 @@ @Test public void testSetSaslMechanismHandlers() { - LdapServer server = new LdapServer(); + LdapService server = new LdapService(); Map handlers = new HashMap(); MechanismHandler handler = new PlainMechanismHandler(); handlers.put( SupportedSaslMechanisms.PLAIN, handler );