Class UI
java.lang.Object
com.biglybt.ui.common.UITemplate
com.biglybt.ui.common.UITemplateHeadless
com.biglybt.ui.telnet.UI
- All Implemented Interfaces:
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 Summary
FieldsFields inherited from class UITemplate
core -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildCommandLine(org.apache.commons.cli.Options options) voidcoreCreated(Core core) Core has been created, but not fully initialize (No GlobalManager, etc)voidcreateNewConsoleInput(String consoleName, InputStream inputStream, PrintStream outputStream, UserProfile profile) creates a new console input using the specified input/output streams.private UserManagerString[]processArgs(org.apache.commons.cli.CommandLine commands, String[] args) Process arguments coming either from command line, or from startserverprivate voidstartUI()start up a server socket thread on an appropriate port as obtained from the configuration manager.Methods inherited from class UITemplate
hasOthers, init, isFirst, takeMainThreadMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IUserInterface
init, takeMainThread
-
Field Details
-
userManager
-
-
Constructor Details
-
UI
public UI()
-
-
Method Details
-
buildCommandLine
public void buildCommandLine(org.apache.commons.cli.Options options) - Specified by:
buildCommandLinein interfaceIUserInterface
-
processArgs
Description copied from interface:IUserInterfaceProcess arguments coming either from command line, or from startserver may be called before core is started- Specified by:
processArgsin interfaceIUserInterface- Specified by:
processArgsin classUITemplate- Parameters:
commands- query-able list of command line optionsargs- all the arguments- Returns:
- Unhandled arguments, or null you don't want any other UIs to be triggered
-
coreCreated
Description copied from interface:IUserInterfaceCore has been created, but not fully initialize (No GlobalManager, etc) Add yourCore.addLifecycleListener(CoreLifecycleListener)to get your GlobalManager reference- Specified by:
coreCreatedin interfaceIUserInterface- Overrides:
coreCreatedin classUITemplate
-
startUI
private void startUI()start up a server socket thread on an appropriate port as obtained from the configuration manager. -
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-
-