Package com.biglybt.ui.telnet
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 com.biglybt.ui.common.UITemplate
core
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildCommandLine
(org.apache.commons.cli.Options options) void
coreCreated
(Core core) Core has been created, but not fully initialize (No GlobalManager, etc)void
createNewConsoleInput
(String consoleName, InputStream inputStream, PrintStream outputStream, UserProfile profile) creates a new console input using the specified input/output streams.private UserManager
String[]
processArgs
(org.apache.commons.cli.CommandLine commands, String[] args) Process arguments coming either from command line, or from startserverprivate void
startUI()
start up a server socket thread on an appropriate port as obtained from the configuration manager.Methods inherited from class com.biglybt.ui.common.UITemplate
hasOthers, init, isFirst, takeMainThread
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.biglybt.ui.common.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:
buildCommandLine
in interfaceIUserInterface
-
processArgs
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 interfaceIUserInterface
- Specified by:
processArgs
in 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:IUserInterface
Core has been created, but not fully initialize (No GlobalManager, etc) Add yourCore.addLifecycleListener(CoreLifecycleListener)
to get your GlobalManager reference- Specified by:
coreCreated
in interfaceIUserInterface
- Overrides:
coreCreated
in 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
-
-