Class InternalConnectionHandler

    • Method Detail

      • getInstance

        public static InternalConnectionHandler getInstance()
        Retrieves the static instance of this internal connection handler.
        Returns:
        The static instance of this internal connection handler.
      • initializeConnectionHandler

        public void initializeConnectionHandler​(ServerContext serverContext,
                                                ConnectionHandlerCfg configuration)
                                         throws ConfigException,
                                                InitializationException
        Initializes this connection handler provider based on the information in the provided connection handler configuration.
        Specified by:
        initializeConnectionHandler in class ConnectionHandler
        Parameters:
        serverContext - The server context.
        configuration - The connection handler configuration that contains the information to use to initialize this connection handler.
        Throws:
        ConfigException - If an unrecoverable problem arises in the process of performing the initialization as a result of the server configuration.
        InitializationException - If a problem occurs during initialization that is not related to the server configuration.
      • finalizeConnectionHandler

        public void finalizeConnectionHandler​(org.forgerock.i18n.LocalizableMessage finalizeReason)
        Closes this connection handler so that it will no longer accept new client connections. Implementations should disconnect any existing connections.
        Specified by:
        finalizeConnectionHandler in class ConnectionHandler
        Parameters:
        finalizeReason - The reason that this connection handler should be finalized.
      • getConnectionHandlerName

        public String getConnectionHandlerName()
        Retrieves a name that may be used to refer to this connection handler. Every connection handler instance (even handlers of the same type) must have a unique name.
        Specified by:
        getConnectionHandlerName in class ConnectionHandler
        Returns:
        A unique name that may be used to refer to this connection handler.
      • getProtocol

        public String getProtocol()
        Retrieves the name of the protocol used to communicate with clients. It should take into account any special naming that may be needed to express any security mechanisms or other constraints in place (e.g., "LDAPS" for LDAP over SSL).
        Specified by:
        getProtocol in class ConnectionHandler
        Returns:
        The name of the protocol used to communicate with clients.
      • getListeners

        public Collection<HostPort> getListeners()
        Retrieves information about the listener(s) that will be used to accept client connections.
        Specified by:
        getListeners in class ConnectionHandler
        Returns:
        Information about the listener(s) that will be used to accept client connections, or an empty list if this connection handler does not accept connections from network clients.
      • getClientConnections

        public Collection<ClientConnection> getClientConnections()
        Retrieves the set of active client connections that have been established through this connection handler.
        Specified by:
        getClientConnections in class ConnectionHandler
        Returns:
        The set of active client connections that have been established through this connection handler.
      • run

        public void run()
        Operates in a loop, accepting new connections and ensuring that requests on those connections are handled properly.
        Specified by:
        run in interface Runnable
        Specified by:
        run in class ConnectionHandler
      • toString

        public String toString()
        Retrieves a string representation of this connection handler.
        Overrides:
        toString in class ConnectionHandler
        Returns:
        A string representation of this connection handler.
      • toString

        public void toString​(StringBuilder buffer)
        Appends a string representation of this connection handler to the provided buffer.
        Specified by:
        toString in class ConnectionHandler
        Parameters:
        buffer - The buffer to which the information should be appended.
      • clearRootClientConnectionAtShutdown

        public static void clearRootClientConnectionAtShutdown()
        Called near the end of server shutdown. This ensures that a new InternalClientConnection is created if the server is immediately restarted as part of an in-core restart.