Class Cluster

java.lang.Object
org.jgroups.ReceiverAdapter
com.logicaldoc.enterprise.cluster.Cluster
All Implemented Interfaces:
org.jgroups.blocks.RequestHandler, org.jgroups.MembershipListener, org.jgroups.MessageListener, org.jgroups.Receiver

public class Cluster extends org.jgroups.ReceiverAdapter implements org.jgroups.blocks.RequestHandler
Object representation of a Cluster of LogicalDOC instances
Since:
6.5
Author:
Marco Meschieri - LogicalDOC
  • Constructor Details

    • Cluster

      public Cluster()
  • Method Details

    • isActive

      public boolean isActive()
    • getLocalNode

      public Node getLocalNode()
      Return the current Node
      Returns:
      object representation of the node
    • getNode

      public Node getNode(String id)
      Gets a node by its identifier
      Parameters:
      id - identifier of the node
      Returns:
      object representation of the node
    • getNodes

      public List<Node> getNodes()
      Retrieves the list of nodes member of the cluster
      Returns:
      list of all the nodes
    • sendMessage

      public List<Object> sendMessage(Payload payload)
      Sends a message to all the cluster and waits for the response.
      Parameters:
      payload - The payload of the message to send
      Returns:
      List of all the answers
    • getNodeId

      public String getNodeId()
      The unique identifier of the local node
      Returns:
      identifier of the current node
    • setChannelFactory

      public void setChannelFactory(ChannelFactory channelFactory)
    • isCoordinator

      public boolean isCoordinator()
    • receive

      public void receive(org.jgroups.Message msg)
      Specified by:
      receive in interface org.jgroups.MessageListener
      Overrides:
      receive in class org.jgroups.ReceiverAdapter
    • handle

      public Object handle(org.jgroups.Message msg) throws Exception
      Specified by:
      handle in interface org.jgroups.blocks.RequestHandler
      Throws:
      Exception
    • setConfig

      public void setConfig(com.logicaldoc.util.config.ContextProperties config)
    • addHandler

      public void addHandler(String type, PayloadHandler handler)