T
- The type of connection handler configuration handled by this connection handler implementation.public abstract class ConnectionHandler<T extends ConnectionHandlerCfg> extends Object implements Closeable, HealthStatusProvider
Constructor and Description |
---|
ConnectionHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAdditionalMeters(MeterRegistryHolder registry)
Computes additional meters that is specific to the connection handler implementation.
|
protected void |
addAdditionalMonitorObjectClassNames(Attribute ocAttr)
Adds the object class names that should be included in the monitor entry related to this connection handler to
the provided attribute.
|
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 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.
|
String |
getConnectionHandlerType()
Returns the type of 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.
|
HealthStatus |
getHealthStatus()
Returns the
HealthStatus for the underlying component. |
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 String getConnectionHandlerType()
getProtocol()
.
It should be returning the insecure protocol version.public Collection<String> getEnabledSSLCipherSuites()
public Collection<String> getEnabledSSLProtocols()
public abstract 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 ConfigException, InitializationException
serverContext
- The server context.configuration
- The connection handler configuration that contains the information to use to initialize this
connection handler.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 ConfigException, InitializationException
serverContext
- The server context.configuration
- The connection handler configuration that contains the information to use to initialize this
connection handler.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()
public HealthStatus getHealthStatus()
HealthStatusProvider
HealthStatus
for the underlying component.getHealthStatus
in interface HealthStatusProvider
HealthStatus
.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.protected void addAdditionalMeters(MeterRegistryHolder registry)
registry
- where additional meters should be added.protected void addAdditionalMonitorObjectClassNames(Attribute ocAttr)
ocAttr
- The object class attribute on which the object class names are added.Copyright 2010-2022 ForgeRock AS.