Class ClusterController

All Implemented Interfaces:
ClusterControllerIfc, ClusteredComponentIfc, Configurable, XMPPService, ConfigurationChangedAware, Initializable, ComponentRegistrator, ServerComponent, VHostListener

Describe class ClusterController here.
Created: Mon Jun 9 20:03:28 2008
Author:
Artur Hefczyc
  • Field Details

  • Constructor Details

    • ClusterController

      public ClusterController()
  • Method Details

    • componentAdded

      public void componentAdded(ClusteredComponentIfc component)
      Description copied from class: AbstractComponentRegistrator
      Method provides a callback mechanism signaling that a new component implementing special interface has been added to the internal components collection.
      Specified by:
      componentAdded in class AbstractComponentRegistrator<ClusteredComponentIfc>
      Parameters:
      component - is a reference to the component just added to the collection.
    • componentRemoved

      public void componentRemoved(ClusteredComponentIfc component)
      Description copied from class: AbstractComponentRegistrator
      Method provides a callback mechanism signaling that a component implementing special interface has been removed from the internal components collection.
      Specified by:
      componentRemoved in class AbstractComponentRegistrator<ClusteredComponentIfc>
      Parameters:
      component - is a reference to the component removed from the collection.
    • handleClusterPacket

      public void handleClusterPacket(Element packet)
      Description copied from interface: ClusterControllerIfc
      Method handles cluster packet received from cluster connection.
      Specified by:
      handleClusterPacket in interface ClusterControllerIfc
      Parameters:
      packet - which should be handled
    • nodeConnected

      public void nodeConnected(String node)
      Description copied from interface: ClusteredComponentIfc
      Method is called on cluster node connection event. This is a notification to the component that a new cluster node has connected.
      Specified by:
      nodeConnected in interface ClusterControllerIfc
      Specified by:
      nodeConnected in interface ClusteredComponentIfc
      Overrides:
      nodeConnected in class BasicComponent
      Parameters:
      node - is a hostname of a cluster node generating the event.
    • nodeDisconnected

      public void nodeDisconnected(String node)
      Description copied from interface: ClusteredComponentIfc
      Method is called on cluster node disconnection event. This is a notification to the component that there was network connection lost to one of the cluster nodes.
      Specified by:
      nodeDisconnected in interface ClusterControllerIfc
      Specified by:
      nodeDisconnected in interface ClusteredComponentIfc
      Overrides:
      nodeDisconnected in class BasicComponent
      Parameters:
      node - is a hostname of a cluster node generating the event.
    • processPacket

      public void processPacket(Packet packet, Queue<Packet> results)
      Description copied from interface: ServerComponent
      processPacket is a blocking processing method implemented by all components. This method processes packet and returns results instantly without waiting for any resources.
      Specified by:
      processPacket in interface ServerComponent
      Overrides:
      processPacket in class BasicComponent
      Parameters:
      packet - a Packet value
    • removeCommandListener

      public void removeCommandListener(CommandListener listener)
      Specified by:
      removeCommandListener in interface ClusterControllerIfc
    • sendToNodes

      public void sendToNodes(String command, Map<String,String> data, Queue<Element> packets, JID fromNode, Set<JID> visitedNodes, JID... toNodes)
      Description copied from interface: ClusterControllerIfc
      Method which sends command to desired nodes
      Specified by:
      sendToNodes in interface ClusterControllerIfc
      Parameters:
      command - ID string of the command
      data - additional data to be included in the packet
      packets - collection of elements to be send to desired nodes
      fromNode - address of the source node
      visitedNodes - list of all already visited nodes
      toNodes - list of nodes to which packet should be sent
    • sendToNodes

      public void sendToNodes(String command, Queue<Element> packets, JID fromNode, Set<JID> visitedNodes, JID... toNodes)
      Description copied from interface: ClusterControllerIfc
      Method which sends command to desired nodes
      Specified by:
      sendToNodes in interface ClusterControllerIfc
      Parameters:
      command - ID string of the command
      packets - collection of elements to be send to desired nodes
      fromNode - address of the source node
      visitedNodes - list of all already visited nodes
      toNodes - list of nodes to which packet should be sent
    • sendToNodes

      public void sendToNodes(String command, Map<String,String> data, JID fromNode, Set<JID> visitedNodes, JID... toNodes)
      Description copied from interface: ClusterControllerIfc
      Method which sends command to desired nodes
      Specified by:
      sendToNodes in interface ClusterControllerIfc
      Parameters:
      command - ID string of the command
      data - additional data to be included in the packet
      fromNode - address of the source node
      visitedNodes - list of all already visited nodes
      toNodes - list of nodes to which packet should be sent
    • sendToNodes

      public void sendToNodes(String command, Map<String,String> data, JID fromNode, JID... toNodes)
      Description copied from interface: ClusterControllerIfc
      Method which sends command to desired nodes
      Specified by:
      sendToNodes in interface ClusterControllerIfc
      Parameters:
      command - ID string of the command
      data - additional data to be included in the packet
      fromNode - address of the source node
      toNodes - list of nodes to which packet should be sent
    • sendToNodes

      public void sendToNodes(String command, JID fromNode, JID... toNodes)
      Description copied from interface: ClusterControllerIfc
      Method which sends command to desired nodes
      Specified by:
      sendToNodes in interface ClusterControllerIfc
      Parameters:
      command - ID string of the command
      fromNode - address of the source node
      toNodes - list of nodes to which packet should be sent
    • sendToNodes

      public void sendToNodes(String command, Element packet, JID fromNode, Set<JID> visitedNodes, JID... toNodes)
      Description copied from interface: ClusterControllerIfc
      Method which sends command to desired nodes
      Specified by:
      sendToNodes in interface ClusterControllerIfc
      Parameters:
      command - ID string of the command
      packet - collection of elements to be send to desired nodes
      fromNode - address of the source node
      visitedNodes - list of all already visited nodes
      toNodes - list of nodes to which packet should be sent
    • sendToNodes

      public void sendToNodes(String command, Map<String,String> data, Element packet, JID fromNode, Set<JID> visitedNodes, JID... toNodes)
      Description copied from interface: ClusterControllerIfc
      Method which sends command to desired nodes
      Specified by:
      sendToNodes in interface ClusterControllerIfc
      Parameters:
      command - ID string of the command
      data - additional data to be included in the packet
      packet - element to be send to desired nodes
      fromNode - address of the source node
      visitedNodes - list of all already visited nodes
      toNodes - list of nodes to which packet should be sent
    • getDiscoCategoryType

      public String getDiscoCategoryType()
      Description copied from class: BasicComponent
      Method returns component category type used for service discovery responses.
      Overrides:
      getDiscoCategoryType in class BasicComponent
      Returns:
      category type of a component
    • getDiscoDescription

      public String getDiscoDescription()
      Description copied from class: BasicComponent
      Method returns description used for service discovery responses.
      Overrides:
      getDiscoDescription in class BasicComponent
      Returns:
      description of a component
    • isCorrectType

      public boolean isCorrectType(ServerComponent component)
      Description copied from class: AbstractComponentRegistrator
      Method checks whether the component provides as method parameter is correct type that is implements special interface or extends special class. Result of the method determines whether the component can be added to the internal components collection.
      Specified by:
      isCorrectType in class AbstractComponentRegistrator<ClusteredComponentIfc>
      Parameters:
      component - is a reference to the component being checked.
      Returns:
      a boolean value of true if the component is of a correct type and false otherwise.
    • setCommandListener

      public void setCommandListener(CommandListener listener)
      Specified by:
      setCommandListener in interface ClusterControllerIfc
    • setName

      public void setName(String name)
      Description copied from interface: ServerComponent
      Method used to assign component name (localpart of the component)
      Specified by:
      setName in interface ServerComponent
      Overrides:
      setName in class BasicComponent
      Parameters:
      name - to be assigned