Class TelnetServer

  • All Implemented Interfaces:
    java.lang.Runnable

    public class TelnetServer
    extends java.lang.Thread
    Telnet Monitor Service (Thread) which allows users to telnet in and request/monitor internal services.
    • Method Detail

      • terminate

        public void terminate()
        Safely kill the thread.
      • removeHandler

        public void removeHandler​(java.lang.String Name)
        Remove a handler from this server.
        Parameters:
        Name - The handler's name.
      • registerCommand

        public void registerCommand​(TelnetServer.Command Command)
        Register a Telnet command on this server.
        Parameters:
        Command - The Telnet Command.
      • getRequest

        public java.util.Optional<TelnetServer.Command> getRequest​(java.lang.String CommandInput)
        Match a user input to a registered command.
        Parameters:
        CommandInput - The user input.
        Returns:
        A Command if there is one, empty otherwise.
      • getAvailableCommands

        public java.lang.String getAvailableCommands()
        Get the available commands on this server.
        Returns:
        A list of all available commands.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class java.lang.Thread
      • getWelcomeMessage

        public java.lang.String getWelcomeMessage()
        Get the server's welcome message.
        Returns:
        The Welcome Message that is given to user on first connections.
      • getCommandPrompt

        public java.lang.String getCommandPrompt()
        Get the server's prompt line.
        Returns:
        The command prompt.