T
- The type of connection handler configuration handled by
this connection handler implementation.@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=true, mayInvoke=false) public abstract class ConnectionHandler<T extends ConnectionHandlerCfg> extends DirectoryThread
DirectoryThread.Factory
Thread.State, Thread.UncaughtExceptionHandler
DIRECTORY_THREAD_GROUP
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier | Constructor and Description |
---|---|
protected |
ConnectionHandler(String threadName)
Creates a new instance of this connection handler.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
finalizeConnectionHandler(LocalizableMessage finalizeReason)
Closes this connection handler so that it will no longer accept
new client connections.
|
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.
|
ConnectionHandlerMonitor |
getConnectionHandlerMonitor()
Retrieves the monitor instance for this connection handler.
|
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.
|
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.
|
abstract void |
initializeConnectionHandler(ServerContext serverContext,
T configuration)
Initializes this connection handler provider based on the
information in the provided connection handler configuration.
|
boolean |
isAdminConnectionHandler()
Returns whether this connection handler is the admin
connection handler.
|
boolean |
isConfigurationAcceptable(ConnectionHandlerCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for
this connection handler.
|
abstract void |
run()
Operates in a loop, accepting new connections and ensuring that
requests on those connections are handled properly.
|
void |
setAdminConnectionHandler()
Sets this connection handler as the admin connection handler.
|
void |
setConnectionHandlerMonitor(ConnectionHandlerMonitor monitor)
Sets the monitor instance for this 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.
|
getAssociatedTask, getCreationStackTrace, getDebugProperties, getParentThread, initiateShutdown, isShutdownInitiated, setAssociatedTask, startWork, stopWork
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, yield
protected ConnectionHandler(String threadName)
threadName
- The name to use for this thread.public abstract void finalizeConnectionHandler(LocalizableMessage finalizeReason)
finalizeReason
- The reason that this connection handler should be
finalized.public abstract String getConnectionHandlerName()
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 abstract 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.public boolean isConfigurationAcceptable(ConnectionHandlerCfg 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 run()
public final ConnectionHandlerMonitor getConnectionHandlerMonitor()
null
if none has been provided.public final void setConnectionHandlerMonitor(ConnectionHandlerMonitor monitor)
monitor
- The monitor instance for this connection
handler.public void setAdminConnectionHandler()
public boolean isAdminConnectionHandler()
public int getNumRequestHandlers(Integer numRequestHandlers, String friendlyName)
numRequestHandlers
- the number of request handlers from the configuration.friendlyName
- the friendly name of this connection handlerpublic abstract void toString(StringBuilder buffer)
buffer
- The buffer to which the information should be appended.Copyright © 2010-2016 ForgeRock AS. All Rights Reserved.