Package org.opends.server.discovery
Interface ServiceDiscoveryMechanism<C extends ServiceDiscoveryMechanismCfg>
-
- Type Parameters:
C
- the configuration for the Service Discovery
- All Known Implementing Classes:
ReplicationServiceDiscoveryMechanism
,StaticServiceDiscoveryMechanism
public interface ServiceDiscoveryMechanism<C extends ServiceDiscoveryMechanismCfg>
Maintains a set ofPartition
s keeping it up to date according to a specific discovery mechanism.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.String
getName()
Returns the name of the mechanism.Partition
getPartition(Collection<Dn> baseDNs)
Returns the partitions.void
initializeMechanism(C configuration, ServerContext serverContext)
Initializes the mechanism with the provided configuration.boolean
isConfigurationAcceptable(C configuration, List<LocalizableMessage> unacceptableReasons, ServerContext serverContext)
Returns whether the provided configuration is correct for the mechanism.void
registerChangeListener(ServiceDiscoveryChangeListener listener)
Registers a listener to be notified when changes in the service occur.
-
-
-
Method Detail
-
getName
String getName()
Returns the name of the mechanism.- Returns:
- the name of the mechanism
-
isConfigurationAcceptable
boolean isConfigurationAcceptable(C configuration, List<LocalizableMessage> unacceptableReasons, ServerContext serverContext)
Returns whether the provided configuration is correct for the mechanism. It should be possible to call this method on an uninitialized mechanism to check the configuration for correctness.- Parameters:
configuration
- the configuration to checkunacceptableReasons
- the list of reasons the configuration is not acceptableserverContext
- the server context of this Directory Server instance- Returns:
- if the provided configuration is correct for the mechanism.
-
initializeMechanism
void initializeMechanism(C configuration, ServerContext serverContext)
Initializes the mechanism with the provided configuration.- Parameters:
configuration
- the configuration for initializationserverContext
- the server context for this Directory Server instance
-
finalizeMechanism
void finalizeMechanism()
Frees any resources in use, mechanism will not be used anymore afterwards.
-
registerChangeListener
void registerChangeListener(ServiceDiscoveryChangeListener listener)
Registers a listener to be notified when changes in the service occur.- Parameters:
listener
- the listener to register for notifications
-
deregisterChangeListener
void deregisterChangeListener(ServiceDiscoveryChangeListener listener)
De-registers a listener from notifications on service changes.- Parameters:
listener
- the listener to de-register
-
getPartition
Partition getPartition(Collection<Dn> baseDNs)
Returns the partitions.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.- Parameters:
baseDNs
- the baseDNs for which to retrieve the partitions- Returns:
- the partitions that can serve the provided base DNs
-
-