Class UI

  • All Implemented Interfaces:
    IUserInterface

    public class UI
    extends UITemplateHeadless
    implements IUserInterface
    this is a telnet UI that starts up a server socket that listens for new connections on a (configurable) port. when an incoming connection is recieved, we check the host against our list of allowed hosts and if this host is permitted, we start a new command line interface for that connection.
    • Constructor Summary

      Constructors 
      Constructor Description
      UI()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void buildCommandLine​(org.apache.commons.cli.Options options)  
      void coreCreated​(Core core)
      Core has been created, but not fully initialize (No GlobalManager, etc)
      void createNewConsoleInput​(java.lang.String consoleName, java.io.InputStream inputStream, java.io.PrintStream outputStream, UserProfile profile)
      creates a new console input using the specified input/output streams.
      private UserManager initUserManager()  
      java.lang.String[] processArgs​(org.apache.commons.cli.CommandLine commands, java.lang.String[] args)
      Process arguments coming either from command line, or from startserver
      private void startUI()
      start up a server socket thread on an appropriate port as obtained from the configuration manager.
      • Methods inherited from class java.lang.Object

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

      • UI

        public UI()
    • Method Detail

      • buildCommandLine

        public void buildCommandLine​(org.apache.commons.cli.Options options)
        Specified by:
        buildCommandLine in interface IUserInterface
      • processArgs

        public java.lang.String[] processArgs​(org.apache.commons.cli.CommandLine commands,
                                              java.lang.String[] args)
        Description copied from interface: IUserInterface
        Process arguments coming either from command line, or from startserver

        may be called before core is started

        Specified by:
        processArgs in interface IUserInterface
        Specified by:
        processArgs in class UITemplate
        Parameters:
        commands - query-able list of command line options
        args - all the arguments
        Returns:
        Unhandled arguments, or null you don't want any other UIs to be triggered
      • startUI

        private void startUI()
        start up a server socket thread on an appropriate port as obtained from the configuration manager.
      • initUserManager

        private UserManager initUserManager()
        Returns:
        user manager instance if multi user is enabled, otherwise null
      • createNewConsoleInput

        public void createNewConsoleInput​(java.lang.String consoleName,
                                          java.io.InputStream inputStream,
                                          java.io.PrintStream outputStream,
                                          UserProfile profile)
        creates a new console input using the specified input/output streams. we create the new input in non-controlling mode because we don't want the 'quit' command to shut down the whole interface - simply this clients connection.
        Parameters:
        consoleName -
        inputStream -
        outputStream -
        profile -