Class JmxConnectionHandler

java.lang.Object
org.opends.server.api.ConnectionHandler<JmxConnectionHandlerCfg>
org.opends.server.protocols.jmx.JmxConnectionHandler
All Implemented Interfaces:
Closeable, AutoCloseable, Runnable, ConfigurationChangeListener<JmxConnectionHandlerCfg>, ServerShutdownListener

This class defines a connection handler that will be used for communicating with administrative clients over JMX. The connection handler is responsible for accepting new connections, reading requests from the clients and parsing them as operations. A single request handler should be used.
  • Constructor Details

    • JmxConnectionHandler

      public JmxConnectionHandler()
  • Method Details

    • applyConfigurationChange

      public ConfigChangeResult applyConfigurationChange(JmxConnectionHandlerCfg config)
      Description copied from interface: ConfigurationChangeListener
      Applies the configuration changes to this change listener.
      Specified by:
      applyConfigurationChange in interface ConfigurationChangeListener<JmxConnectionHandlerCfg>
      Parameters:
      config - The new configuration containing the changes.
      Returns:
      Returns information about the result of changing the configuration.
    • 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<JmxConnectionHandlerCfg>
      Throws:
      IOException - If the ConnectionHandler cannot be bound.
    • doClose

      public 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<JmxConnectionHandlerCfg>
    • 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<JmxConnectionHandlerCfg>
      Returns:
      The set of active client connections that have been established through this connection handler.
    • getComponentEntryDN

      public Dn getComponentEntryDN()
      Retrieves the DN of the configuration entry with which this alert generator is associated.
      Specified by:
      getComponentEntryDN in class ConnectionHandler<JmxConnectionHandlerCfg>
      Returns:
      The DN of the configuration entry with which this alert generator is associated.
    • 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<JmxConnectionHandlerCfg>
      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. By default this returns ConnectionHandler.getProtocol(). It should be returning the insecure protocol version.
      Overrides:
      getConnectionHandlerType in class ConnectionHandler<JmxConnectionHandlerCfg>
      Returns:
      The type of this connection handler.
    • getKeyManagerProviderDN

      public Dn getKeyManagerProviderDN()
      Retrieves the DN of the key manager provider that should be used for operations associated with this connection handler which need access to a key manager.
      Returns:
      The DN of the key manager provider that should be used for operations associated with this connection handler which need access to a key manager, or null if no key manager provider has been configured for this connection handler.
    • getListenAddress

      public com.forgerock.opendj.util.Host getListenAddress()
      Get the JMX connection handler's listen address.
      Returns:
      Returns the JMX connection handler's listen address.
    • getListenPort

      public int getListenPort()
      Get the JMX connection handler's listen port.
      Returns:
      Returns the JMX connection handler's listen port.
    • getRmiPort

      public int getRmiPort()
      Get the JMX connection handler's rmi port.
      Returns:
      Returns the JMX connection handler's rmi port.
    • getRMIConnector

      Get the JMX connection handler's RMI connector.
      Returns:
      Returns the JMX connection handler's RMI connector.
    • getSSLServerCertNicknames

      public SortedSet<String> getSSLServerCertNicknames()
      Retrieves the nicknames of the server certificates that should be used in conjunction with this JMX connection handler.
      Returns:
      The nicknames of the server certificates that should be used in conjunction with this JMX connection handler.
    • doInitializeConnectionHandler

      public void doInitializeConnectionHandler(ServerContext serverContext, JmxConnectionHandlerCfg config)
      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<JmxConnectionHandlerCfg>
      Parameters:
      serverContext - The server context.
      config - The connection handler configuration that contains the information to use to initialize this connection handler.
    • 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<JmxConnectionHandlerCfg>
      Returns:
      The name of the protocol used to communicate with clients.
    • 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<JmxConnectionHandlerCfg>
      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.
    • isConfigurationAcceptable

      public boolean isConfigurationAcceptable(ServerContext serverContext, JmxConnectionHandlerCfg 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<JmxConnectionHandlerCfg>
      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.
    • isConfigurationChangeAcceptable

      public boolean isConfigurationChangeAcceptable(JmxConnectionHandlerCfg config, 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<JmxConnectionHandlerCfg>
      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.
    • isUseSSL

      public boolean isUseSSL()
      Determines whether clients are allowed to connect over JMX using SSL.
      Returns:
      Returns true if clients are allowed to connect over JMX using SSL.
    • 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.
    • registerClientConnection

      public void registerClientConnection(ClientConnection connection)
      Registers a client connection with this JMX connection handler.
      Parameters:
      connection - The client connection.
    • unregisterClientConnection

      public void unregisterClientConnection(ClientConnection connection)
      Unregisters a client connection from this JMX connection handler.
      Parameters:
      connection - The client connection.
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • toString

      public void toString(StringBuilder buffer)
      Description copied from class: ConnectionHandler
      Appends a string representation of this connection handler to the provided buffer.
      Specified by:
      toString in class ConnectionHandler<JmxConnectionHandlerCfg>
      Parameters:
      buffer - The buffer to which the information should be appended.