Class NetConnectionHandler

java.lang.Object
org.opends.server.api.ConnectionHandler<NetConnectionHandlerCfg>
org.opends.server.protocols.net.NetConnectionHandler
All Implemented Interfaces:
Closeable, AutoCloseable, ConfigurationChangeListener<NetConnectionHandlerCfg>, ServerShutdownListener

Network protocol (LDAP/HTTP) connection handler.
  • Constructor Details

    • NetConnectionHandler

      public NetConnectionHandler()
      Default constructor called by config framework for non-administrative connection handlers.
  • Method Details

    • newAdministrativeConnectionHandler

      public static NetConnectionHandler newAdministrativeConnectionHandler()
      Returns a new administrative connection handler.
      Returns:
      a new administrative connection handler
    • isConfigurationAcceptable

      public boolean isConfigurationAcceptable(ServerContext serverContext, NetConnectionHandlerCfg config, List<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.
      Overrides:
      isConfigurationAcceptable in class ConnectionHandler<NetConnectionHandlerCfg>
      Parameters:
      serverContext - The server context
      config - 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.
    • getConnectionSecurity

      public ConnectionSecurity getConnectionSecurity()
      Indicates the connection security used by this connection handler.
      Returns:
      the connection security.
    • doInitializeConnectionHandler

      protected void doInitializeConnectionHandler(ServerContext serverContext, NetConnectionHandlerCfg config) throws InitializationException
      Description copied from class: ConnectionHandler
      Initializes this connection handler provider based on the information in the provided connection handler configuration.
      Specified by:
      doInitializeConnectionHandler in class ConnectionHandler<NetConnectionHandlerCfg>
      Parameters:
      serverContext - The server context.
      config - The connection handler configuration that contains the information to use to initialize this connection handler.
      Throws:
      InitializationException - If a problem occurs during initialization that is not related to the server configuration.
    • isConfigurationChangeAcceptable

      public boolean isConfigurationChangeAcceptable(NetConnectionHandlerCfg configuration, List<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<NetConnectionHandlerCfg>
      Parameters:
      configuration - 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.
    • applyConfigurationChange

      public ConfigChangeResult applyConfigurationChange(NetConnectionHandlerCfg config)
      Description copied from interface: ConfigurationChangeListener
      Applies the configuration changes to this change listener.
      Specified by:
      applyConfigurationChange in interface ConfigurationChangeListener<NetConnectionHandlerCfg>
      Parameters:
      config - The new configuration containing the changes.
      Returns:
      Returns information about the result of changing the configuration.
    • 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<NetConnectionHandlerCfg>
      Returns:
      A unique name that may be used to refer to this connection handler.
    • getConnectionHandlerType

      public String getConnectionHandlerType()
      Description copied from class: ConnectionHandler
      Returns the type of this connection handler. It should be returning the insecure protocol version.
      Specified by:
      getConnectionHandlerType in class ConnectionHandler<NetConnectionHandlerCfg>
      Returns:
      the type of this connection handler
    • isAdministrative

      public boolean isAdministrative()
      Description copied from class: ConnectionHandler
      Indicates if the connection is on the Administration Connector which may mean it is excluded from certain checks.
      Overrides:
      isAdministrative in class ConnectionHandler<NetConnectionHandlerCfg>
      Returns:
      true if the connection is on the Administration Connector.
    • 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<NetConnectionHandlerCfg>
      Returns:
      The set of enabled SSL cipher suites configured for this connection handler.
    • getEnabledSslProtocols

      public Collection<String> getEnabledSslProtocols()
      Description copied from class: ConnectionHandler
      Retrieves the set of enabled SSL protocols configured for this connection handler. Implementations must return an empty set if use of SSL/TLS is not possible.
      Overrides:
      getEnabledSslProtocols in class ConnectionHandler<NetConnectionHandlerCfg>
      Returns:
      The set of enabled SSL protocols configured for this connection handler.
    • getComponentEntryDn

      public Dn getComponentEntryDn()
      Description copied from class: ConnectionHandler
      Returns the DN of the configuration entry with which this alert generator is associated.
      Specified by:
      getComponentEntryDn in class ConnectionHandler<NetConnectionHandlerCfg>
      Returns:
      the DN of the configuration entry with which this alert generator is associated
    • 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<NetConnectionHandlerCfg>
      Returns:
      The name of the protocol used to communicate with clients.
    • addAdditionalMeters

      protected void addAdditionalMeters(MeterRegistryHolder registry)
      Description copied from class: ConnectionHandler
      Computes additional meters that is specific to the connection handler implementation. The default implementation is to do nothing.
      Overrides:
      addAdditionalMeters in class ConnectionHandler<NetConnectionHandlerCfg>
      Parameters:
      registry - where additional meters should be added.
    • addAdditionalMonitorObjectClassNames

      protected void addAdditionalMonitorObjectClassNames(Attribute ocAttr)
      Description copied from class: ConnectionHandler
      Adds the object class names that should be included in the monitor entry related to this connection handler to the provided attribute.
      Overrides:
      addAdditionalMonitorObjectClassNames in class ConnectionHandler<NetConnectionHandlerCfg>
      Parameters:
      ocAttr - The object class attribute on which the object class names are added.
    • getListeners

      public Collection<com.forgerock.opendj.util.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<NetConnectionHandlerCfg>
      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()
      Description copied from class: ConnectionHandler
      Returns the set of active client connections that have been established through this connection handler.
      Specified by:
      getClientConnections in class ConnectionHandler<NetConnectionHandlerCfg>
      Returns:
      the set of active client connections that have been established through this connection handler
    • bind

      public void bind() throws IOException
      Description copied from class: ConnectionHandler
      Operates in a loop, accepting new connections and ensuring that requests on those connections are handled properly.
      Specified by:
      bind in class ConnectionHandler<NetConnectionHandlerCfg>
      Throws:
      IOException - If the ConnectionHandler cannot be bound.
    • doClose

      protected void doClose()
      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 and release any other resources associated with the connection handler.
      Overrides:
      doClose in class ConnectionHandler<NetConnectionHandlerCfg>
    • processServerShutdown

      public void processServerShutdown(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.
    • getLdapStatistics

      public LdapStatistics getLdapStatistics()
      Returns the set of statistics maintained by this connection handler.
      Returns:
      the set of statistics maintained by this connection handler