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 received, 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.
  • Field Details

  • Constructor Details

    • UI

      public UI()
  • Method Details

    • buildCommandLine

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

      public String[] processArgs(org.apache.commons.cli.CommandLine commands, 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
    • coreCreated

      public void coreCreated(Core core)
      Description copied from interface: IUserInterface
      Core has been created, but not fully initialize (No GlobalManager, etc)

      Add your Core.addLifecycleListener(CoreLifecycleListener) to get your GlobalManager reference

      Specified by:
      coreCreated in interface IUserInterface
      Overrides:
      coreCreated in class UITemplate
    • 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(String consoleName, InputStream inputStream, 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 -