Class LDAPConnectionHandler

    • Constructor Detail

      • LDAPConnectionHandler

        public LDAPConnectionHandler()
        Creates a new instance of this LDAP connection handler. It must be initialized before it may be used.
      • LDAPConnectionHandler

        public LDAPConnectionHandler​(QueueingStrategy strategy,
                                     String friendlyName)
        Creates a new instance of this LDAP connection handler, using a queueing strategy. It must be initialized before it may be used.
        Parameters:
        strategy - Request handling strategy.
        friendlyName - The name of of this connection handler, or null if the name should be taken from the configuration.
    • Method Detail

      • allowLDAPv2

        public boolean allowLDAPv2()
        Indicates whether this connection handler should allow interaction with LDAPv2 clients.
        Returns:
        true if LDAPv2 is allowed, or false if not.
      • allowStartTLS

        public boolean allowStartTLS()
        Indicates whether this connection handler should allow the use of the StartTLS extended operation.
        Returns:
        true if StartTLS is allowed, or false if not.
      • finalizeConnectionHandler

        public void finalizeConnectionHandler​(org.forgerock.i18n.LocalizableMessage finalizeReason)
        Description copied from class: ConnectionHandler
        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<LDAPConnectionHandlerCfg>
        Parameters:
        finalizeReason - The reason that this connection handler should be finalized.
      • getAlerts

        public Map<String,​String> getAlerts()
        Retrieves information about the set of alerts that this generator may produce. The map returned should be between the notification type for a particular notification and the human-readable description for that notification. This alert generator must not generate any alerts with types that are not contained in this list.
        Specified by:
        getAlerts in interface AlertGenerator
        Returns:
        Information about the set of alerts that this generator may produce.
      • getClassName

        public String getClassName()
        Retrieves the fully-qualified name of the Java class for this alert generator implementation.
        Specified by:
        getClassName in interface AlertGenerator
        Returns:
        The fully-qualified name of the Java class for this alert generator implementation.
      • getConnectionHandlerName

        public String getConnectionHandlerName()
        Description copied from class: ConnectionHandler
        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<LDAPConnectionHandlerCfg>
        Returns:
        A unique name that may be used to refer to this connection handler.
      • getEnabledSSLCipherSuites

        public Collection<String> getEnabledSSLCipherSuites()
        Description copied from class: ConnectionHandler
        Retrieves an unmodifiable set of enabled SSL cipher suites configured for this connection handler, if applicable. Implementations must return an empty set if use of SSL/TLS is not possible.
        Overrides:
        getEnabledSSLCipherSuites in class ConnectionHandler<LDAPConnectionHandlerCfg>
        Returns:
        The set of enabled SSL cipher suites configured for this connection handler.
      • getListeners

        public Collection<HostPort> getListeners()
        Description copied from class: ConnectionHandler
        Retrieves information about the listener(s) that will be used to accept client connections.
        Specified by:
        getListeners in class ConnectionHandler<LDAPConnectionHandlerCfg>
        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.
      • getListenPort

        public int getListenPort()
        Retrieves the port on which this connection handler is listening for client connections.
        Returns:
        The port on which this connection handler is listening for client connections.
      • getMaxBlockedWriteTimeLimit

        public long getMaxBlockedWriteTimeLimit()
        Retrieves the maximum length of time in milliseconds that attempts to write to LDAP client connections should be allowed to block.
        Returns:
        The maximum length of time in milliseconds that attempts to write to LDAP client connections should be allowed to block, or zero if there should not be any limit imposed.
      • getMaxRequestSize

        public int getMaxRequestSize()
        Retrieves the maximum ASN.1 element value length that will be allowed by this connection handler.
        Returns:
        The maximum ASN.1 element value length that will be allowed by this connection handler.
      • getBufferSize

        public int getBufferSize()
        Retrieves the size in bytes of the LDAP response message write buffer defined for this connection handler.
        Returns:
        The size in bytes of the LDAP response message write buffer.
      • getProtocol

        public String getProtocol()
        Description copied from class: ConnectionHandler
        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<LDAPConnectionHandlerCfg>
        Returns:
        The name of the protocol used to communicate with clients.
      • getSSLClientAuthPolicy

        public SSLClientAuthPolicy getSSLClientAuthPolicy()
        Retrieves the SSL client authentication policy for this connection handler.
        Returns:
        The SSL client authentication policy for this connection handler.
      • getStatTracker

        public LDAPStatistics getStatTracker()
        Retrieves the set of statistics maintained by this connection handler.
        Returns:
        The set of statistics maintained by this connection handler.
      • isConfigurationAcceptable

        public boolean isConfigurationAcceptable​(ConnectionHandlerCfg configuration,
                                                 List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
        Description copied from class: ConnectionHandler
        Indicates whether the provided configuration is acceptable for this connection handler. It should be possible to call this method on an uninitialized connection handler instance in order to determine whether the connection handler would be able to use the provided configuration.

        Note that implementations which use a subclass of the provided configuration class will likely need to cast the configuration to the appropriate subclass type.
        Overrides:
        isConfigurationAcceptable in class ConnectionHandler<LDAPConnectionHandlerCfg>
        Parameters:
        configuration - The connection handler configuration for which to make the determination.
        unacceptableReasons - A list that may be used to hold the reasons that the provided configuration is not acceptable.
        Returns:
        true if the provided configuration is acceptable for this connection handler, or false if not.
      • isConfigurationChangeAcceptable

        public boolean isConfigurationChangeAcceptable​(LDAPConnectionHandlerCfg config,
                                                       List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
        Description copied from interface: ConfigurationChangeListener
        Indicates whether the proposed change to the configuration is acceptable to this change listener.
        Specified by:
        isConfigurationChangeAcceptable in interface ConfigurationChangeListener<LDAPConnectionHandlerCfg>
        Parameters:
        config - The new configuration containing the changes.
        unacceptableReasons - A list that can be used to hold messages about why the provided configuration is not acceptable.
        Returns:
        Returns true if the proposed change is acceptable, or false if it is not.
      • keepStats

        public boolean keepStats()
        Indicates whether this connection handler should maintain usage statistics.
        Returns:
        true if this connection handler should maintain usage statistics, or false if not.
      • 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.
      • start

        public void start()
        Overrides:
        start in class Thread
      • useSSL

        public boolean useSSL()
        Indicates whether this connection handler should use SSL to communicate with clients.
        Returns:
        true if this connection handler should use SSL to communicate with clients, or false if not.
      • getQueueingStrategy

        public QueueingStrategy getQueueingStrategy()
        Get the queueing strategy.
        Returns:
        The queueing strategy.
      • getTLSByteChannel

        public TLSByteChannel getTLSByteChannel​(ByteChannel channel)
                                         throws DirectoryException
        Creates a TLS Byte Channel instance using the specified socket channel.
        Parameters:
        channel - The socket channel to use in the creation.
        Returns:
        A TLS Byte Channel instance.
        Throws:
        DirectoryException - If the channel cannot be created.