Package org.opends.server.protocols
Class LdifConnectionHandler
java.lang.Object
org.opends.server.api.ConnectionHandler<LdifConnectionHandlerCfg>
org.opends.server.protocols.LdifConnectionHandler
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Runnable
,ConfigurationChangeListener<LdifConnectionHandlerCfg>
,AlertGenerator
public final class LdifConnectionHandler
extends ConnectionHandler<LdifConnectionHandlerCfg>
implements Runnable, ConfigurationChangeListener<LdifConnectionHandlerCfg>, AlertGenerator
This class defines an LDIF connection handler, which can be used to watch for new LDIF files to be placed in a
specified directory. If a new LDIF file is detected, the connection handler will process any changes contained in
that file as internal operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapplyConfigurationChange
(LdifConnectionHandlerCfg configuration) Applies the configuration changes to this change listener.void
bind()
Operates in a loop, accepting new connections and ensuring that requests on those connections are handled properly.void
doClose()
Closes this connection handler so that it will no longer accept new client connections.void
doInitializeConnectionHandler
(ServerContext serverContext, LdifConnectionHandlerCfg configuration) Initializes this connection handler provider based on the information in the provided connection handler configuration.Retrieves information about the set of alerts that this generator may produce.Returns the set of active client connections that have been established through this connection handler.Returns the DN of the configuration entry with which this alert generator is associated.Retrieves a name that may be used to refer to this connection handler.Returns the type of this connection handler.Collection
<com.forgerock.opendj.util.HostPort> Retrieves information about the listener(s) that will be used to accept client connections.Retrieves the name of the protocol used to communicate with clients.boolean
isConfigurationChangeAcceptable
(LdifConnectionHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) Indicates whether the proposed change to the configuration is acceptable to this change listener.void
run()
Methods inherited from class org.opends.server.api.ConnectionHandler
addAdditionalMeters, addAdditionalMonitorObjectClassNames, close, getEnabledSslCipherSuites, getEnabledSslProtocols, getServerContext, initializeConnectionHandler, isAdministrative, isConfigurationAcceptable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opends.server.api.AlertGenerator
getClassName
-
Constructor Details
-
LdifConnectionHandler
public LdifConnectionHandler()
-
-
Method Details
-
doInitializeConnectionHandler
public void doInitializeConnectionHandler(ServerContext serverContext, LdifConnectionHandlerCfg configuration) Description copied from class:ConnectionHandler
Initializes this connection handler provider based on the information in the provided connection handler configuration.- Specified by:
doInitializeConnectionHandler
in classConnectionHandler<LdifConnectionHandlerCfg>
- Parameters:
serverContext
- The server context.configuration
- The connection handler configuration that contains the information to use to initialize this connection handler.
-
bind
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 classConnectionHandler<LdifConnectionHandlerCfg>
- Throws:
IOException
- If theConnectionHandler
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 classConnectionHandler<LdifConnectionHandlerCfg>
-
getComponentEntryDn
Description copied from class:ConnectionHandler
Returns the DN of the configuration entry with which this alert generator is associated.- Specified by:
getComponentEntryDn
in interfaceAlertGenerator
- Specified by:
getComponentEntryDn
in classConnectionHandler<LdifConnectionHandlerCfg>
- Returns:
- the DN of the configuration entry with which this alert generator is associated
-
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 classConnectionHandler<LdifConnectionHandlerCfg>
- Returns:
- A unique name that may be used to refer to this connection handler.
-
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 classConnectionHandler<LdifConnectionHandlerCfg>
- Returns:
- the type of this connection handler
-
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 classConnectionHandler<LdifConnectionHandlerCfg>
- Returns:
- The name of the protocol used to communicate with clients.
-
getListeners
Description copied from class:ConnectionHandler
Retrieves information about the listener(s) that will be used to accept client connections.- Specified by:
getListeners
in classConnectionHandler<LdifConnectionHandlerCfg>
- 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
Description copied from class:ConnectionHandler
Returns the set of active client connections that have been established through this connection handler.- Specified by:
getClientConnections
in classConnectionHandler<LdifConnectionHandlerCfg>
- Returns:
- the set of active client connections that have been established through this connection handler
-
run
public void run() -
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(LdifConnectionHandlerCfg 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 interfaceConfigurationChangeListener<LdifConnectionHandlerCfg>
- 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, orfalse
if it is not.
-
applyConfigurationChange
Description copied from interface:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in interfaceConfigurationChangeListener<LdifConnectionHandlerCfg>
- Parameters:
configuration
- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
getAlerts
Description copied from interface:AlertGenerator
Retrieves information about the set of alerts that this generator may produce. The map returned should be between the notification type for a particular notification and the human-readable description for that notification. This alert generator must not generate any alerts with types that are not contained in this list.- Specified by:
getAlerts
in interfaceAlertGenerator
- Returns:
- Information about the set of alerts that this generator may produce.
-