public class LdapServer extends DirectoryBackedService
Modifier and Type | Field and Description |
---|---|
static long |
NO_SIZE_LIMIT
Value (0) for configuration where size limit is unlimited.
|
static int |
NO_TIME_LIMIT
Value (0) for configuration where time limit is unlimited.
|
static String |
SERVICE_NAME
the constant service name of this ldap protocol provider
|
transports
Constructor and Description |
---|
LdapServer()
Creates an LDAP protocol provider.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtendedOperationHandler(ExtendedOperationHandler<? extends org.apache.directory.api.ldap.model.message.ExtendedRequest,? extends org.apache.directory.api.ldap.model.message.ExtendedResponse> eoh)
Registers the specified
ExtendedOperationHandler to this
protocol provider to provide a specific LDAP extended operation. |
MechanismHandler |
addSaslMechanismHandler(String mechanism,
MechanismHandler handler) |
org.apache.mina.handler.demux.MessageHandler<org.apache.directory.api.ldap.model.message.AbandonRequest> |
getAbandonRequestHandler() |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.AddRequest> |
getAddRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.AddResponse> |
getAddResponseHandler() |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.BindRequest> |
getBindRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.BindResponse> |
getBindResponseHandler() |
String |
getCertificatePassword() |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.CompareRequest> |
getCompareRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.CompareResponse> |
getCompareResponseHandler() |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.DeleteRequest> |
getDeleteRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.DeleteResponse> |
getDeleteResponseHandler() |
List<String> |
getEnabledCipherSuites()
Deprecated.
Set this list in the
TcpTransport class |
ExtendedOperationHandler<? extends org.apache.directory.api.ldap.model.message.ExtendedRequest,? extends org.apache.directory.api.ldap.model.message.ExtendedResponse> |
getExtendedOperationHandler(String oid)
Returns an
ExtendedOperationHandler with the specified oid
which is registered to this protocol provider. |
Collection<ExtendedOperationHandler<? extends org.apache.directory.api.ldap.model.message.ExtendedRequest,? extends org.apache.directory.api.ldap.model.message.ExtendedResponse>> |
getExtendedOperationHandlers()
Gets the
ExtendedOperationHandler s. |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.ExtendedRequest> |
getExtendedRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.ExtendedResponse> |
getExtendedResponseHandler() |
org.apache.mina.core.service.IoHandler |
getHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.IntermediateResponse> |
getIntermediateResponseHandler() |
KeyManagerFactory |
getKeyManagerFactory() |
String |
getKeystoreFile() |
LdapSessionManager |
getLdapSessionManager() |
int |
getMaxPDUSize() |
long |
getMaxSizeLimit()
Returns the maximum size limit in number of entries to return for search.
|
int |
getMaxTimeLimit()
Returns the maximum time limit in milliseconds to conduct a search.
|
MechanismHandler |
getMechanismHandler(String mechanism) |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyDnRequest> |
getModifyDnRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyDnResponse> |
getModifyDnResponseHandler() |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyRequest> |
getModifyRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyResponse> |
getModifyResponseHandler() |
String |
getName() |
int |
getPort() |
int |
getPortSSL() |
org.apache.mina.filter.codec.ProtocolCodecFactory |
getProtocolCodecFactory() |
ReplicationRequestHandler |
getReplicationReqHandler() |
int |
getReplPingerSleepTime() |
String |
getSaslHost()
Returns the FQDN of this SASL host, validated during SASL negotiation.
|
Map<String,MechanismHandler> |
getSaslMechanismHandlers() |
String |
getSaslPrincipal()
Returns the Kerberos principal name for this LDAP service, used by GSSAPI.
|
Set<String> |
getSaslQop()
Returns the Set of quality-of-protection, used by DIGEST-MD5 and GSSAPI.
|
String |
getSaslQopString()
Returns the quality-of-protection, used by DIGEST-MD5 and GSSAPI.
|
List<String> |
getSaslRealms()
Returns the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.
|
LdapRequestHandler<org.apache.directory.api.ldap.model.message.SearchRequest> |
getSearchRequestHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultDone> |
getSearchResultDoneHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultEntry> |
getSearchResultEntryHandler() |
LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultReference> |
getSearchResultReferenceHandler() |
Set<String> |
getSupportedControls() |
Set<String> |
getSupportedMechanisms() |
LdapRequestHandler<org.apache.directory.api.ldap.model.message.UnbindRequest> |
getUnbindRequestHandler() |
boolean |
isConfidentialityRequired()
Gets whether or not TLS secured connections are required to perform
operations on this LdapServer.
|
boolean |
isEnableLdaps(Transport transport)
Returns true if LDAPS is enabled.
|
boolean |
isStarted()
Gets whether or not this service has been started.
|
void |
reloadSslContext()
reloads the SSL context by replacing the existing SslFilter
with a new SslFilter after reloading the keystore.
|
void |
removeExtendedOperationHandler(String oid)
Deregister an
ExtendedOperationHandler with the specified oid
from this protocol provider. |
MechanismHandler |
removeSaslMechanismHandler(String mechanism) |
void |
setAbandonHandler(LdapRequestHandler<org.apache.directory.api.ldap.model.message.AbandonRequest> abandonRequestdHandler)
Inject the MessageReceived handler into the IoHandler
|
void |
setAddHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.AddRequest> addRequestHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.AddResponse> addResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setBindHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.BindRequest> bindRequestHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.BindResponse> bindResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setCertificatePassword(String certificatePassword)
Set the certificate password.
|
void |
setCompareHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.CompareRequest> compareRequestHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.CompareResponse> compareResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setConfidentialityRequired(boolean confidentialityRequired)
Sets the mode for this LdapServer to accept requests with or without a
TLS secured connection via either StartTLS extended operations or using
LDAPS.
|
void |
setDeleteHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.DeleteRequest> deleteRequestHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.DeleteResponse> deleteResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setDirectoryService(DirectoryService directoryService)
Set the DirectoryService
|
void |
setEnabledCipherSuites(List<String> enabledCipherSuites)
Deprecated.
Get this list from the
TcpTransport class |
void |
setExtendedHandlers(ExtendedRequestHandler extendedRequestHandler,
ExtendedResponseHandler extendedResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setExtendedOperationHandlers(Collection<ExtendedOperationHandler<org.apache.directory.api.ldap.model.message.ExtendedRequest,org.apache.directory.api.ldap.model.message.ExtendedResponse>> handlers)
Sets the
ExtendedOperationHandler s. |
void |
setIntermediateHandler(LdapResponseHandler<org.apache.directory.api.ldap.model.message.IntermediateResponse> intermediateResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setKeystoreFile(String keystoreFile)
Set the external keystore path
|
void |
setMaxPDUSize(int maxPDUSize)
Set the maximum allowed size for an incoming PDU
|
void |
setMaxSizeLimit(long maxSizeLimit)
Sets the maximum size limit in number of entries to return for search.
|
void |
setMaxTimeLimit(int maxTimeLimit)
Sets the maximum time limit in milliseconds to conduct a search.
|
void |
setModifyDnHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyDnRequest> modifyDnRequestHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyDnResponse> modifyDnResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setModifyHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyRequest> modifyRequestHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyResponse> modifyResponseHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setReplConsumers(List<ReplicationConsumer> replConsumers) |
void |
setReplicationReqHandler(ReplicationRequestHandler replicationProvider) |
void |
setReplPingerSleepTime(int pingerSleepTime)
The number of seconds pinger thread should sleep before pinging the providers
|
void |
setSaslHost(String saslHost)
Sets the FQDN of this SASL host, validated during SASL negotiation.
|
void |
setSaslMechanismHandlers(Map<String,MechanismHandler> saslMechanismHandlers) |
void |
setSaslPrincipal(String saslPrincipal)
Sets the Kerberos principal name for this LDAP service, used by GSSAPI.
|
void |
setSaslRealms(List<String> saslRealms)
Sets the realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.
|
void |
setSearchHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.SearchRequest> searchRequestHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultEntry> searchResultEntryHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultReference> searchResultReferenceHandler,
LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultDone> searchResultDoneHandler)
Inject the MessageReceived and MessageSent handler into the IoHandler
|
void |
setStarted(boolean started) |
void |
setUnbindHandler(LdapRequestHandler<org.apache.directory.api.ldap.model.message.UnbindRequest> unbindRequestHandler)
Inject the MessageReceived handler into the IoHandler
|
void |
start()
Starts this ProtocolService which binds acceptors on the protocol port.
|
void |
startReplicationConsumers()
Starts the replication consumers
|
void |
startReplicationProducer()
Install the replication handler if we have one
|
void |
stop()
Stops this ProtocolService which unbinds acceptors on the protocol port.
|
String |
toString() |
getDirectoryService, getSearchBaseDn, isCatelogBased, setCatelogBased, setSearchBaseDn
addTransports, getDatagramAcceptor, getServiceId, getServiceName, getSocketAcceptor, getTransports, isEnabled, setEnabled, setServiceId, setServiceName, setTransports
public static final long NO_SIZE_LIMIT
public static final int NO_TIME_LIMIT
public static final String SERVICE_NAME
public LdapServer()
public void reloadSslContext() throws Exception
Exception
- If teh SSLContext can't be reloadedpublic void start() throws Exception
ProtocolService
IOException
- if we cannot bind to the specified portException
- if the LDAP server cannot be startedpublic void startReplicationProducer()
public void stop()
public void startReplicationConsumers() throws Exception
org.apache.directory.api.ldap.model.exception.LdapException
- If the consumer can't be startedException
public org.apache.mina.core.service.IoHandler getHandler()
public LdapSessionManager getLdapSessionManager()
public org.apache.mina.filter.codec.ProtocolCodecFactory getProtocolCodecFactory()
public void addExtendedOperationHandler(ExtendedOperationHandler<? extends org.apache.directory.api.ldap.model.message.ExtendedRequest,? extends org.apache.directory.api.ldap.model.message.ExtendedResponse> eoh) throws org.apache.directory.api.ldap.model.exception.LdapException
ExtendedOperationHandler
to this
protocol provider to provide a specific LDAP extended operation.eoh
- an extended operation handlerException
- on failure to add the handlerorg.apache.directory.api.ldap.model.exception.LdapException
public void removeExtendedOperationHandler(String oid)
ExtendedOperationHandler
with the specified oid
from this protocol provider.oid
- the numeric identifier for the extended operation associated with
the handler to removepublic ExtendedOperationHandler<? extends org.apache.directory.api.ldap.model.message.ExtendedRequest,? extends org.apache.directory.api.ldap.model.message.ExtendedResponse> getExtendedOperationHandler(String oid)
ExtendedOperationHandler
with the specified oid
which is registered to this protocol provider.oid
- the oid of the extended request of associated with the extended
request handlerpublic void setConfidentialityRequired(boolean confidentialityRequired)
confidentialityRequired
- true to require confidentialitypublic boolean isConfidentialityRequired()
public boolean isEnableLdaps(Transport transport)
transport
- The LDAP transportpublic void setMaxSizeLimit(long maxSizeLimit)
maxSizeLimit
- the maximum number of entries to return for searchpublic long getMaxSizeLimit()
public void setMaxTimeLimit(int maxTimeLimit)
maxTimeLimit
- the maximum length of time in milliseconds for searchpublic int getMaxTimeLimit()
public Collection<ExtendedOperationHandler<? extends org.apache.directory.api.ldap.model.message.ExtendedRequest,? extends org.apache.directory.api.ldap.model.message.ExtendedResponse>> getExtendedOperationHandlers()
ExtendedOperationHandler
s.ExtendedOperationHandler
s.public void setExtendedOperationHandlers(Collection<ExtendedOperationHandler<org.apache.directory.api.ldap.model.message.ExtendedRequest,org.apache.directory.api.ldap.model.message.ExtendedResponse>> handlers)
ExtendedOperationHandler
s.handlers
- A collection of ExtendedOperationHandler
s.public String getSaslHost()
public void setSaslHost(String saslHost)
saslHost
- The FQDN of this SASL host, validated during SASL negotiation.public String getSaslPrincipal()
public void setSaslPrincipal(String saslPrincipal)
saslPrincipal
- The Kerberos principal name for this LDAP service, used by GSSAPI.public String getSaslQopString()
public Set<String> getSaslQop()
public List<String> getSaslRealms()
public void setSaslRealms(List<String> saslRealms)
saslRealms
- The realms serviced by this SASL host, used by DIGEST-MD5 and GSSAPI.public Map<String,MechanismHandler> getSaslMechanismHandlers()
public void setSaslMechanismHandlers(Map<String,MechanismHandler> saslMechanismHandlers)
public MechanismHandler addSaslMechanismHandler(String mechanism, MechanismHandler handler)
public MechanismHandler removeSaslMechanismHandler(String mechanism)
public MechanismHandler getMechanismHandler(String mechanism)
public Set<String> getSupportedMechanisms()
public void setDirectoryService(DirectoryService directoryService)
DirectoryBackedService
setDirectoryService
in class DirectoryBackedService
directoryService
- The DirectoryService instancepublic Set<String> getSupportedControls()
public org.apache.mina.handler.demux.MessageHandler<org.apache.directory.api.ldap.model.message.AbandonRequest> getAbandonRequestHandler()
public void setAbandonHandler(LdapRequestHandler<org.apache.directory.api.ldap.model.message.AbandonRequest> abandonRequestdHandler)
abandonRequestdHandler
- The AbandonRequest message received handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.AddRequest> getAddRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.AddResponse> getAddResponseHandler()
public void setAddHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.AddRequest> addRequestHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.AddResponse> addResponseHandler)
addRequestHandler
- The AddRequest message received handleraddResponseHandler
- The AddResponse message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.BindRequest> getBindRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.BindResponse> getBindResponseHandler()
public void setBindHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.BindRequest> bindRequestHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.BindResponse> bindResponseHandler)
bindRequestHandler
- The BindRequest message received handlerbindResponseHandler
- The BindResponse message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.CompareRequest> getCompareRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.CompareResponse> getCompareResponseHandler()
public void setCompareHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.CompareRequest> compareRequestHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.CompareResponse> compareResponseHandler)
compareRequestHandler
- The CompareRequest message received handlercompareResponseHandler
- The CompareResponse message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.DeleteRequest> getDeleteRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.DeleteResponse> getDeleteResponseHandler()
public void setDeleteHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.DeleteRequest> deleteRequestHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.DeleteResponse> deleteResponseHandler)
deleteRequestHandler
- The DeleteRequest message received handlerdeleteResponseHandler
- The DeleteResponse message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.ExtendedRequest> getExtendedRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.ExtendedResponse> getExtendedResponseHandler()
public void setExtendedHandlers(ExtendedRequestHandler extendedRequestHandler, ExtendedResponseHandler extendedResponseHandler)
extendedRequestHandler
- The ExtendedRequest message received handlerextendedResponseHandler
- The ExtendedResponse message sent handlerpublic LdapResponseHandler<org.apache.directory.api.ldap.model.message.IntermediateResponse> getIntermediateResponseHandler()
public void setIntermediateHandler(LdapResponseHandler<org.apache.directory.api.ldap.model.message.IntermediateResponse> intermediateResponseHandler)
intermediateResponseHandler
- The IntermediateResponse message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyRequest> getModifyRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyResponse> getModifyResponseHandler()
public void setModifyHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyRequest> modifyRequestHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyResponse> modifyResponseHandler)
modifyRequestHandler
- The ModifyRequest message received handlermodifyResponseHandler
- The ModifyResponse message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyDnRequest> getModifyDnRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyDnResponse> getModifyDnResponseHandler()
public void setModifyDnHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.ModifyDnRequest> modifyDnRequestHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.ModifyDnResponse> modifyDnResponseHandler)
modifyDnRequestHandler
- The ModifyDnRequest message received handlermodifyDnResponseHandler
- The ModifyDnResponse message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.SearchRequest> getSearchRequestHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultEntry> getSearchResultEntryHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultReference> getSearchResultReferenceHandler()
public LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultDone> getSearchResultDoneHandler()
public void setSearchHandlers(LdapRequestHandler<org.apache.directory.api.ldap.model.message.SearchRequest> searchRequestHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultEntry> searchResultEntryHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultReference> searchResultReferenceHandler, LdapResponseHandler<org.apache.directory.api.ldap.model.message.SearchResultDone> searchResultDoneHandler)
searchRequestHandler
- The SearchRequest message received handlersearchResultEntryHandler
- The SearchResultEntry message sent handlersearchResultReferenceHandler
- The SearchResultReference message sent handlersearchResultDoneHandler
- The SearchResultDone message sent handlerpublic LdapRequestHandler<org.apache.directory.api.ldap.model.message.UnbindRequest> getUnbindRequestHandler()
public void setUnbindHandler(LdapRequestHandler<org.apache.directory.api.ldap.model.message.UnbindRequest> unbindRequestHandler)
unbindRequestHandler
- The UnbindRequest message received handlerpublic int getPort()
public int getPortSSL()
public boolean isStarted()
AbstractProtocolService
isStarted
in interface ProtocolService
isStarted
in class AbstractProtocolService
public void setStarted(boolean started)
setStarted
in class AbstractProtocolService
started
- The state of this serverpublic String getKeystoreFile()
public void setKeystoreFile(String keystoreFile)
keystoreFile
- The external keystore pathpublic String getCertificatePassword()
public void setCertificatePassword(String certificatePassword)
certificatePassword
- the certificate passwordpublic void setReplicationReqHandler(ReplicationRequestHandler replicationProvider)
public ReplicationRequestHandler getReplicationReqHandler()
public void setReplConsumers(List<ReplicationConsumer> replConsumers)
public KeyManagerFactory getKeyManagerFactory()
public int getMaxPDUSize()
public void setMaxPDUSize(int maxPDUSize)
maxPDUSize
- A positive number of bytes for the PDU. A negative or
null value will be transformed to Integer.MAX_VALUE
public int getReplPingerSleepTime()
public void setReplPingerSleepTime(int pingerSleepTime)
pingerSleepTime
- The delay between 2 pings@Deprecated public List<String> getEnabledCipherSuites()
TcpTransport
class@Deprecated public void setEnabledCipherSuites(List<String> enabledCipherSuites)
TcpTransport
classenabledCipherSuites
- if null the default cipher suites will be usedpublic String toString()
toString
in class Object
Object.toString()
Copyright © 2003–2020 The Apache Software Foundation. All rights reserved.