Package org.opends.server.config
Class AdministrationConnector
- java.lang.Object
-
- org.opends.server.config.AdministrationConnector
-
- All Implemented Interfaces:
ConfigurationChangeListener<AdministrationConnectorCfg>
public final class AdministrationConnector extends Object implements ConfigurationChangeListener<AdministrationConnectorCfg>
This class is a wrapper on top of LDAPConnectionHandler2 to manage the administration connector, which is an LDAPConnectionHandler2 with specific (limited) configuration properties.
-
-
Field Summary
Fields Modifier and Type Field Description static intADMIN_CERT_VALIDITYValidity (in days) of the generated certificate.static intDEFAULT_ADMINISTRATION_CONNECTOR_PORTDefault Administration Connector port.
-
Constructor Summary
Constructors Constructor Description AdministrationConnector(ServerContext serverContext)Creates an instance of the administration connector.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResultapplyConfigurationChange(AdministrationConnectorCfg configuration)Applies the configuration changes to this change listener.static voidcreateSelfSignedCertificateIfNeeded(ServerContext serverContext)Creates a self-signed JKS certificate if needed.LDAPConnectionHandler2getConnectionHandler()Retrieves the connection handler linked to this administration connector.voidinitializeAdministrationConnector(AdministrationConnectorCfg configuration)Initializes this administration connector provider based on the information in the provided administration connector configuration.booleanisConfigurationChangeAcceptable(AdministrationConnectorCfg configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)Indicates whether the proposed change to the configuration is acceptable to this change listener.
-
-
-
Field Detail
-
DEFAULT_ADMINISTRATION_CONNECTOR_PORT
public static final int DEFAULT_ADMINISTRATION_CONNECTOR_PORT
Default Administration Connector port.- See Also:
- Constant Field Values
-
ADMIN_CERT_VALIDITY
public static final int ADMIN_CERT_VALIDITY
Validity (in days) of the generated certificate.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AdministrationConnector
public AdministrationConnector(ServerContext serverContext)
Creates an instance of the administration connector.- Parameters:
serverContext- The server context.
-
-
Method Detail
-
initializeAdministrationConnector
public void initializeAdministrationConnector(AdministrationConnectorCfg configuration) throws ConfigException, InitializationException
Initializes this administration connector provider based on the information in the provided administration connector configuration.- Parameters:
configuration- The connection handler configuration that contains the information to use to initialize this connection handler.- Throws:
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.
-
getConnectionHandler
public LDAPConnectionHandler2 getConnectionHandler()
Retrieves the connection handler linked to this administration connector.- Returns:
- The connection handler linked to this administration connector.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(AdministrationConnectorCfg configuration, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptablein interfaceConfigurationChangeListener<AdministrationConnectorCfg>- 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
trueif the proposed change is acceptable, orfalseif it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(AdministrationConnectorCfg configuration)
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChangein interfaceConfigurationChangeListener<AdministrationConnectorCfg>- Parameters:
configuration- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
createSelfSignedCertificateIfNeeded
public static void createSelfSignedCertificateIfNeeded(ServerContext serverContext) throws InitializationException
Creates a self-signed JKS certificate if needed.- Parameters:
serverContext- The server context.- Throws:
InitializationException- If an unexpected error occurred whilst trying to create the certificate.
-
-