Interface ClusterListener

All Superinterfaces:
EventListener
All Known Implementing Classes:
ClusterListenerAdapter

public interface ClusterListener extends EventListener
A listener for cluster-related events.

It does not have to be thread-safe. All events received by ClusterListener, ServerListener, ServerMonitorListener are totally ordered (and the event order implies the happens-before order), provided that the listeners are not shared by different MongoClients. This means that even if you have a single class implementing all of ClusterListener, ServerListener, ServerMonitorListener, it does not have to be thread-safe.

Since:
3.3
See Also:
  • Method Details

    • clusterOpening

      default void clusterOpening(ClusterOpeningEvent event)
      Invoked when a cluster is opened.
      Parameters:
      event - the event
    • clusterClosed

      default void clusterClosed(ClusterClosedEvent event)
      Invoked when a cluster is closed.
      Parameters:
      event - the event
    • clusterDescriptionChanged

      default void clusterDescriptionChanged(ClusterDescriptionChangedEvent event)
      Invoked when a cluster description changes.
      Parameters:
      event - the event