public class StaticServiceDiscoveryMechanism extends Object implements ConfigurationChangeListener<StaticServiceDiscoveryMechanismCfg>
Constructor and Description |
---|
StaticServiceDiscoveryMechanism() |
Modifier and Type | Method and Description |
---|---|
ConfigChangeResult |
applyConfigurationChange(StaticServiceDiscoveryMechanismCfg configuration)
Applies the configuration changes to this change listener.
|
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<Dn> baseDns)
Returns the partitions.
|
void |
initializeMechanism(StaticServiceDiscoveryMechanismCfg cfg,
ServerContext serverContext)
Initializes the mechanism with the provided configuration.
|
boolean |
isConfigurationAcceptable(StaticServiceDiscoveryMechanismCfg configuration,
List<LocalizableMessage> unacceptableReasons,
ServerContext serverContext)
Returns whether the provided configuration is correct for the mechanism.
|
boolean |
isConfigurationChangeAcceptable(StaticServiceDiscoveryMechanismCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable
to this change listener.
|
void |
registerChangeListener(ServiceDiscoveryChangeListener listener)
Registers a listener to be notified when changes in the service occur.
|
String |
toString() |
public void initializeMechanism(StaticServiceDiscoveryMechanismCfg cfg, ServerContext serverContext)
ServiceDiscoveryMechanism
initializeMechanism
in interface ServiceDiscoveryMechanism<StaticServiceDiscoveryMechanismCfg>
cfg
- the configuration for initializationserverContext
- the server context for this Directory Server instancepublic Set<Partition> getPartitions(Collection<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<StaticServiceDiscoveryMechanismCfg>
baseDns
- the baseDNs for which to retrieve the partitionspublic boolean isConfigurationChangeAcceptable(StaticServiceDiscoveryMechanismCfg configuration, List<LocalizableMessage> unacceptableReasons)
ConfigurationChangeListener
isConfigurationChangeAcceptable
in interface ConfigurationChangeListener<StaticServiceDiscoveryMechanismCfg>
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.true
if the proposed change is acceptable,
or false
if it is not.public boolean isConfigurationAcceptable(StaticServiceDiscoveryMechanismCfg configuration, List<LocalizableMessage> unacceptableReasons, ServerContext serverContext)
ServiceDiscoveryMechanism
isConfigurationAcceptable
in interface ServiceDiscoveryMechanism<StaticServiceDiscoveryMechanismCfg>
configuration
- the configuration to checkunacceptableReasons
- the list of reasons the configuration is not acceptableserverContext
- the server context of this Directory Server instancepublic ConfigChangeResult applyConfigurationChange(StaticServiceDiscoveryMechanismCfg configuration)
ConfigurationChangeListener
applyConfigurationChange
in interface ConfigurationChangeListener<StaticServiceDiscoveryMechanismCfg>
configuration
- The new configuration containing the changes.public final String getName()
ServiceDiscoveryMechanism
getName
in interface ServiceDiscoveryMechanism<C extends ServiceDiscoveryMechanismCfg>
public final void finalizeMechanism()
ServiceDiscoveryMechanism
finalizeMechanism
in interface ServiceDiscoveryMechanism<C extends ServiceDiscoveryMechanismCfg>
protected final void fireConnectionOptionsChanged()
public final void registerChangeListener(ServiceDiscoveryChangeListener listener)
ServiceDiscoveryMechanism
registerChangeListener
in interface ServiceDiscoveryMechanism<C extends ServiceDiscoveryMechanismCfg>
listener
- the listener to register for notificationspublic final void deregisterChangeListener(ServiceDiscoveryChangeListener listener)
ServiceDiscoveryMechanism
deregisterChangeListener
in interface ServiceDiscoveryMechanism<C extends ServiceDiscoveryMechanismCfg>
listener
- the listener to de-registerCopyright 2010-2022 ForgeRock AS.