Class TelnetServer.Command

  • Enclosing class:
    TelnetServer

    public abstract static class TelnetServer.Command
    extends java.lang.Object
    This is the class that should be extended when wanting to add available commands to the Telnet Monitor. TODO: Usage example, and auto validation of arguments and command help (ie "command help" prints help for the command).
    • Constructor Summary

      Constructors 
      Constructor Description
      Command​(java.lang.String Command)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract void execute​(java.io.PrintWriter STDOUT, java.io.BufferedReader STDIN, java.lang.String[] Argv)
      Execute the request and return the output when completed.
      java.lang.String getCommand()
      Get the command's name.
      abstract java.lang.String getShortDescription()
      Get the command's description.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Command

        public Command​(java.lang.String Command)
    • Method Detail

      • getCommand

        public java.lang.String getCommand()
        Get the command's name.
        Returns:
        Command name.
      • getShortDescription

        public abstract java.lang.String getShortDescription()
        Get the command's description.
        Returns:
        A Short Description of the command.
      • execute

        public abstract void execute​(java.io.PrintWriter STDOUT,
                                     java.io.BufferedReader STDIN,
                                     java.lang.String[] Argv)
                              throws TelnetServer.Command.InvalidArgumentException
        Execute the request and return the output when completed.
        Parameters:
        STDOUT - The output writer (PrintWriter) used to supply user with output (if required during task).
        STDIN - The input reader (BufferedReader) used to fetch user input (if required during task).
        Argv - The argument vector.
        Throws:
        TelnetServer.Command.InvalidArgumentException - Raised when this command gets invalid arguments.