Interface IClusterConnection

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
JGroupsClusterConnection

public interface IClusterConnection extends Closeable
Models the connection between nodes in the cluster.
Since:
3.1.0
Author:
XIMA MEDIA GmbH
  • Method Details

    • open

      void open() throws ClusterOpenException
      Opens this connection. When no node exists yet, a new group is created. Otherwise, when a group exists already, joins that groups.
      Throws:
      ClusterOpenException - When the connection could not be opened, such as due to a network failure etc.
    • close

      void close()
      Closes the connection to other nodes. This method closes the entire cluster, so that no more nodes can be added to the group.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • disconnect

      void disconnect()
      Disconnects the node from the cluster. The node can join the cluster again later by calling open().
    • getTopologyObserver

      IClusterTopologyObserver getTopologyObserver()
      Returns:
      The observer that can be used to listen for changes to the cluster topology (e.g. when a node is added or removed from the cluster).
    • getChannelObserver

      IClusterChannelStateObserver getChannelObserver()
      Returns:
      The observer that can be used to listen for changes to the channel state, e.g. when the connection to a node was established or cut, or the channel was closed.
    • getMessageObserver

      IClusterMessageObserver getMessageObserver()
      Returns:
      The observer that can be used to listen for messages sent between nodes.
    • getCluster

      ICluster getCluster()
      Returns:
      The cluster to