Class ClusterController

    • Field Detail

      • MY_DOMAIN_NAME_PROP_KEY

        public static final java.lang.String MY_DOMAIN_NAME_PROP_KEY
        See Also:
        Constant Field Values
      • MY_DOMAIN_NAME_PROP_VAL

        public static final java.lang.String MY_DOMAIN_NAME_PROP_VAL
        See Also:
        Constant Field Values
    • Constructor Detail

      • ClusterController

        public ClusterController()
    • Method Detail

      • processPacket

        public void processPacket​(Packet packet,
                                  java.util.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
      • sendToNodes

        public void sendToNodes​(java.lang.String command,
                                java.util.Map<java.lang.String,​java.lang.String> data,
                                java.util.Queue<Element> packets,
                                JID fromNode,
                                java.util.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​(java.lang.String command,
                                java.util.Queue<Element> packets,
                                JID fromNode,
                                java.util.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​(java.lang.String command,
                                java.util.Map<java.lang.String,​java.lang.String> data,
                                JID fromNode,
                                java.util.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​(java.lang.String command,
                                java.util.Map<java.lang.String,​java.lang.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​(java.lang.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​(java.lang.String command,
                                Element packet,
                                JID fromNode,
                                java.util.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​(java.lang.String command,
                                java.util.Map<java.lang.String,​java.lang.String> data,
                                Element packet,
                                JID fromNode,
                                java.util.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 java.lang.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 java.lang.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.
      • setName

        public void setName​(java.lang.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