Class 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.
    • 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.
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • 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:
        true if the client connection was properly registered with this request handler, or false if 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.
      • processServerShutdown

        public void processServerShutdown​(org.forgerock.i18n.LocalizableMessage reason)
        Description copied from interface: ServerShutdownListener
        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.
        Specified by:
        processServerShutdown in interface ServerShutdownListener
        Parameters:
        reason - The human-readable reason for the shutdown.