Class AbstractSystemCommandHandler

java.lang.Object
com.tenio.common.logger.AbstractLogger
com.tenio.common.logger.SystemLogger
com.tenio.core.handler.AbstractHandler
com.tenio.core.command.system.AbstractSystemCommandHandler
Direct Known Subclasses:
HelpCommand, InfoCommand, ServerCommand, UnBanAddressCommand

public abstract class AbstractSystemCommandHandler extends AbstractHandler
The base class for all self defined commands.
Since:
0.4.0
  • Constructor Details

    • AbstractSystemCommandHandler

      public AbstractSystemCommandHandler()
  • Method Details

    • getLabel

      public String getLabel()
      Retrieves the command label.
      Returns:
      a String value of the command label
    • getUsage

      public String[] getUsage()
      Retrieves the command usage (manual).
      Returns:
      an array of instructions in String values
    • getDescription

      public String getDescription()
      Retrieves the command description.
      Returns:
      a String value of the command description
    • isRunningBackground

      public boolean isRunningBackground()
      Checks whether the command should be running in background.
      Returns:
      true if the command should be running in the background, otherwise, returns false
    • getCommandManager

      public SystemCommandManager getCommandManager()
      Retrieves the system command manager.
      Returns:
      an instance of SystemCommandManager
    • setCommandManager

      public void setCommandManager(SystemCommandManager systemCommandManager)
      Sets a value for system command manager.
      Parameters:
      systemCommandManager - an instance of SystemCommandManager
    • execute

      public abstract void execute(List<String> args)
      It is called when the server invokes a command.
      Parameters:
      args - The arguments to the command
    • toString

      public String toString()
      Overrides:
      toString in class Object