public final class ReplicationServiceDiscoveryMechanism extends Object implements org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg>
The partitions returned by this class contain the directory servers that are part of the same topology as the configured replication servers.
It will periodically query the topology to discover any new or removed servers and notify listeners of any changes.
Constructor and Description |
---|
ReplicationServiceDiscoveryMechanism() |
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg configuration) |
void |
deregisterChangeListener(ServiceDiscoveryChangeListener listener)
De-registers a listener from notifications on service changes.
|
void |
finalizeMechanism()
Frees any resources in use, mechanism will not be used anymore afterwards.
|
protected void |
fireConnectionOptionsChanged() |
String |
getName()
Returns the name of the mechanism.
|
Set<Partition> |
getPartitions(Collection<org.forgerock.opendj.ldap.Dn> baseDNs)
Returns the partitions.
|
void |
initializeMechanism(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg config,
ServerContext serverContext)
Initializes the mechanism with the provided configuration.
|
boolean |
isConfigurationAcceptable(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg configuration,
List<LocalizableMessage> unacceptableReasons,
ServerContext serverContext)
Returns whether the provided configuration is correct for the mechanism.
|
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg configuration,
List<LocalizableMessage> unacceptableReasons) |
void |
registerChangeListener(ServiceDiscoveryChangeListener listener)
Registers a listener to be notified when changes in the service occur.
|
String |
toString() |
public ReplicationServiceDiscoveryMechanism()
public void initializeMechanism(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg config, ServerContext serverContext)
ServiceDiscoveryMechanism
initializeMechanism
in interface ServiceDiscoveryMechanism<org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg>
config
- the configuration for initializationserverContext
- the server context for this Directory Server instancepublic Set<Partition> getPartitions(Collection<org.forgerock.opendj.ldap.Dn> baseDNs)
ServiceDiscoveryMechanism
Each Partition
will only contain servers that are known to expose the provided list of
base DNs. An empty list of base DNs will result in all partitions and all servers being
returned. In other words, an empty list of base DNs implies that all servers contain exactly
the same base DNs.
getPartitions
in interface ServiceDiscoveryMechanism<org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg>
baseDNs
- the baseDNs for which to retrieve the partitionspublic boolean isConfigurationAcceptable(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg configuration, List<LocalizableMessage> unacceptableReasons, ServerContext serverContext)
ServiceDiscoveryMechanism
isConfigurationAcceptable
in interface ServiceDiscoveryMechanism<org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg>
configuration
- the configuration to checkunacceptableReasons
- the list of reasons the configuration is not acceptableserverContext
- the server context of this Directory Server instancepublic boolean isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg configuration, List<LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg>
public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg configuration)
applyConfigurationChange
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.ReplicationServiceDiscoveryMechanismCfg>
public final String getName()
ServiceDiscoveryMechanism
getName
in interface ServiceDiscoveryMechanism<C extends org.forgerock.opendj.server.config.server.ServiceDiscoveryMechanismCfg>
public final void finalizeMechanism()
ServiceDiscoveryMechanism
finalizeMechanism
in interface ServiceDiscoveryMechanism<C extends org.forgerock.opendj.server.config.server.ServiceDiscoveryMechanismCfg>
protected final void fireConnectionOptionsChanged()
public final void registerChangeListener(ServiceDiscoveryChangeListener listener)
ServiceDiscoveryMechanism
registerChangeListener
in interface ServiceDiscoveryMechanism<C extends org.forgerock.opendj.server.config.server.ServiceDiscoveryMechanismCfg>
listener
- the listener to register for notificationspublic final void deregisterChangeListener(ServiceDiscoveryChangeListener listener)
ServiceDiscoveryMechanism
deregisterChangeListener
in interface ServiceDiscoveryMechanism<C extends org.forgerock.opendj.server.config.server.ServiceDiscoveryMechanismCfg>
listener
- the listener to de-registerCopyright © 2010-2017 ForgeRock AS. All Rights Reserved.