Package org.forgerock.opendj.discovery
Interface ServiceDiscoveryMechanism
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
ReplicationServiceDiscoveryMechanism
,StaticServiceDiscoveryMechanism
public interface ServiceDiscoveryMechanism extends Closeable
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
close()
Frees any resources in use, mechanism will not be used anymore afterwards.void
deregisterChangeListener(ServiceDiscoveryChangeListener listener)
De-registers a listener from notifications on service changes.Partition
getPartition(Collection<Dn> baseDNs)
Returns the partition.void
registerChangeListener(ServiceDiscoveryChangeListener listener)
Registers a listener to be notified when changes in the service occur.
-
-
-
Method Detail
-
close
void close()
Frees any resources in use, mechanism will not be used anymore afterwards.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
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 partition.The
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 partition that can serve the provided base DNs
-
-