Interface ServiceDiscoveryMechanism

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
ReplicationServiceDiscoveryMechanism, StaticServiceDiscoveryMechanism

public interface ServiceDiscoveryMechanism extends Closeable
Maintains a set of Partitions keeping it up to date according to a specific discovery mechanism.
  • Method Details

    • close

      void close()
      Frees any resources in use, mechanism will not be used anymore afterwards.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • 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