Package org.opends.server.protocols.ldap
Class LDAPRequestHandler
- java.lang.Object
-
- java.lang.Thread
-
- org.opends.server.api.DirectoryThread
-
- org.opends.server.protocols.ldap.LDAPRequestHandler
-
- All Implemented Interfaces:
Runnable,ServerShutdownListener
public class LDAPRequestHandler extends DirectoryThread implements ServerShutdownListener
This class defines an LDAP request handler, which is associated with an LDAP connection handler and is responsible for reading and decoding any requests that LDAP clients may send to the server. Multiple request handlers may be used in conjunction with a single connection handler for better performance and scalability.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opends.server.api.DirectoryThread
DirectoryThread.Factory
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class org.opends.server.api.DirectoryThread
DIRECTORY_THREAD_GROUP
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description LDAPRequestHandler(LDAPConnectionHandler connectionHandler, int requestHandlerID)Creates a new LDAP request handler that will be associated with the provided connection handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<LDAPClientConnection>getClientConnections()Retrieves the set of all client connections that are currently registered with this request handler.StringgetShutdownListenerName()Retrieves the human-readable name for this shutdown listener.voidprocessServerShutdown(org.forgerock.i18n.LocalizableMessage reason)Indicates that the Directory Server has received a request to stop running and that this shutdown listener should take any action necessary to prepare for it.booleanregisterClient(LDAPClientConnection clientConnection)Registers the provided client connection with this request handler so that any requests received from that client will be processed.voidrun()Operates in a loop, waiting for client requests to arrive and ensuring that they are processed properly.-
Methods inherited from class org.opends.server.api.DirectoryThread
getAssociatedTask, getCreationStackTrace, getDebugProperties, getParentThread, initiateShutdown, isShutdownInitiated, setAssociatedTask, startWork, stopWork
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
LDAPRequestHandler
public LDAPRequestHandler(LDAPConnectionHandler connectionHandler, int requestHandlerID) throws InitializationException
Creates a new LDAP request handler that will be associated with the provided connection handler.- Parameters:
connectionHandler- The LDAP connection handler with which this request handler is associated.requestHandlerID- The integer value that may be used to distinguish this request handler from others associated with the same connection handler.- Throws:
InitializationException- If a problem occurs while initializing this request handler.
-
-
Method Detail
-
run
public void run()
Operates in a loop, waiting for client requests to arrive and ensuring that they are processed properly.
-
registerClient
public boolean registerClient(LDAPClientConnection clientConnection)
Registers the provided client connection with this request handler so that any requests received from that client will be processed.- Parameters:
clientConnection- The client connection to be registered with this request handler.- Returns:
trueif the client connection was properly registered with this request handler, orfalseif not.
-
getClientConnections
public Collection<LDAPClientConnection> getClientConnections()
Retrieves the set of all client connections that are currently registered with this request handler.- Returns:
- The set of all client connections that are currently registered with this request handler.
-
getShutdownListenerName
public String getShutdownListenerName()
Description copied from interface:ServerShutdownListenerRetrieves the human-readable name for this shutdown listener.- Specified by:
getShutdownListenerNamein interfaceServerShutdownListener- Returns:
- The human-readable name for this shutdown listener.
-
processServerShutdown
public void processServerShutdown(org.forgerock.i18n.LocalizableMessage reason)
Description copied from interface:ServerShutdownListenerIndicates that the Directory Server has received a request to stop running and that this shutdown listener should take any action necessary to prepare for it.- Specified by:
processServerShutdownin interfaceServerShutdownListener- Parameters:
reason- The human-readable reason for the shutdown.
-
-