Package tigase.cluster.api

# Interface CommandListener

All Superinterfaces:
  `Comparable<CommandListener>`

All Known Implementing Classes:
  `AmpComponentClustered.PacketForwardCommand`, `CommandListenerAbstract`, `PacketForwardCmd`

public interface CommandListener extends Comparable<CommandListener>

Author:
  Artur Hefczyc Created Mar 16, 2011

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `executeCommand(JID fromNode, Set<JID> visitedNodes, Map<String,String> data, Queue<Element> packets)`
  Method is responsible for executing commands from other nodes and appropriate processing
  `String`
  `getName()`
  Method allows retrieval name of the particular command
  `Priority`
  `getPriority()`
  Method returns priority of particular command which should be used to assign proper priority for processing of this command
  `void`
  `getStatistics(StatisticsList list)`
  Method allows retrieval possible statistics for particular command
  `void`
  `setName(String name)`
  Method allows setting name of the command

  ### Methods inherited from interface java.lang.Comparable

  `compareTo`

- ## Method Details

  - ### executeCommand

    void executeCommand(JID fromNode, Set<JID> visitedNodes, Map<String,String> data, Queue<Element> packets) throws ClusterCommandException
    Method is responsible for executing commands from other nodes and appropriate processing
    Parameters:
      `fromNode` - address of the node from which command was received
      `visitedNodes` - collection of already visited nodes
      `data` - additional data associated with the command in addition to the main `Element`
      `packets` - collection of `Element` commands to be executed
    Throws:
      `ClusterCommandException` - execution exception

  - ### getName

    String getName()
    Method allows retrieval name of the particular command
    Returns:
      a value of `String` name of the command

  - ### setName

    void setName(String name)
    Method allows setting name of the command
    Parameters:
      `name` - to be used

  - ### getPriority

    Priority getPriority()
    Method returns priority of particular command which should be used to assign proper priority for processing of this command

  - ### getStatistics

    void getStatistics(StatisticsList list)
    Method allows retrieval possible statistics for particular command
    Parameters:
      `list` - collection to which statistics should be appended