T
- The type of connection handler configuration handled by this connection handler implementation.public abstract class ConnectionHandler<T extends org.forgerock.opendj.server.config.server.ConnectionHandlerCfg> extends Object implements Closeable
Constructor and Description |
---|
ConnectionHandler() |
Modifier and Type | Method and Description |
---|---|
abstract void |
bind()
Operates in a loop, accepting new connections and ensuring that requests on those connections are handled
properly.
|
void |
close()
Closes this connection handler so that it will no longer accept new client connections, disconnecting any
existing connections, and releasing any other resources associated with the connection handler.
|
protected void |
doClose()
Closes this connection handler so that it will no longer accept new client connections.
|
protected abstract void |
doInitializeConnectionHandler(ServerContext serverContext,
T configuration)
Initializes this connection handler provider based on the information in the provided connection handler
configuration.
|
abstract Collection<ClientConnection> |
getClientConnections()
Retrieves the set of active client connections that have been established through this connection handler.
|
abstract org.forgerock.opendj.ldap.Dn |
getComponentEntryDN()
Retrieves the DN of the configuration entry with which this alert generator is associated.
|
abstract String |
getConnectionHandlerName()
Retrieves a name that may be used to refer to this connection handler.
|
Collection<String> |
getEnabledSSLCipherSuites()
Retrieves an unmodifiable set of enabled SSL cipher suites configured for this connection handler, if applicable.
|
Collection<String> |
getEnabledSSLProtocols()
Retrieves the set of enabled SSL protocols configured for this connection handler.
|
abstract Collection<HostPort> |
getListeners()
Retrieves information about the listener(s) that will be used to accept client connections.
|
protected int |
getNumRequestHandlers(Integer numRequestHandlers,
String friendlyName)
Determine the number of request handlers.
|
abstract String |
getProtocol()
Retrieves the name of the protocol used to communicate with clients.
|
void |
initializeConnectionHandler(ServerContext serverContext,
T configuration)
Initializes this connection handler provider based on the information in the provided connection handler
configuration.
|
boolean |
isConfigurationAcceptable(T configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for this connection handler.
|
void |
setAdminConnectionHandler()
Sets this connection handler as the admin connection handler.
|
String |
toString()
Retrieves a string representation of this connection handler.
|
abstract void |
toString(StringBuilder buffer)
Appends a string representation of this connection handler to the provided buffer.
|
public abstract String getConnectionHandlerName()
public Collection<String> getEnabledSSLCipherSuites()
public Collection<String> getEnabledSSLProtocols()
public abstract org.forgerock.opendj.ldap.Dn getComponentEntryDN()
public abstract String getProtocol()
public abstract Collection<HostPort> getListeners()
public abstract Collection<ClientConnection> getClientConnections()
public final void initializeConnectionHandler(ServerContext serverContext, T configuration) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
serverContext
- The server context.configuration
- The connection handler configuration that contains the information to use to initialize this
connection handler.org.forgerock.opendj.config.server.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.protected abstract void doInitializeConnectionHandler(ServerContext serverContext, T configuration) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
serverContext
- The server context.configuration
- The connection handler configuration that contains the information to use to initialize this
connection handler.org.forgerock.opendj.config.server.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.public boolean isConfigurationAcceptable(T configuration, List<LocalizableMessage> unacceptableReasons)
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.true
if the provided configuration is acceptable for this connection handler, or false
if
not.public abstract void bind() throws IOException
IOException
- If the ConnectionHandler
cannot be bound.public final void close()
close
in interface Closeable
close
in interface AutoCloseable
protected void doClose()
public void setAdminConnectionHandler()
protected int getNumRequestHandlers(Integer numRequestHandlers, String friendlyName)
numRequestHandlers
- the number of request handlers from the configuration.friendlyName
- the friendly name of this connection handlerpublic String toString()
public abstract void toString(StringBuilder buffer)
buffer
- The buffer to which the information should be appended.Copyright © 2010–2017 ForgeRock AS. All rights reserved.