Package org.cristian.t4j
Class TelnetServer.Command
- java.lang.Object
-
- org.cristian.t4j.TelnetServer.Command
-
- Enclosing class:
- TelnetServer
public abstract static class TelnetServer.Command extends java.lang.ObjectThis 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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTelnetServer.Command.InvalidArgumentExceptionWhen arguments given are invalid (not enough, too many, etc).static classTelnetServer.Command.InvalidCommandExceptionInvalid Command given to the Telnet Server.
-
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 voidexecute(java.io.PrintWriter STDOUT, java.io.BufferedReader STDIN, java.lang.String[] Argv)Execute the request and return the output when completed.java.lang.StringgetCommand()Get the command's name.abstract java.lang.StringgetShortDescription()Get the command's description.
-
-
-
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.InvalidArgumentExceptionExecute 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.
-
-