|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjhomenet.shell.Shell
jhomenet.shell.JHomenetShell
public class JHomenetShell
Slush system shell. Provides an interface between the underlying OS and multiple user login sessions. Also performs many common operating system tasks, such as providing a way to view directory listings, change directories, run programs, etc.
| Field Summary | |
|---|---|
static long |
bootTime
Keep track of the shell start time. |
static java.lang.String |
EMPTY
|
static java.lang.String |
LOG_FILE
Define the shell log file. |
static java.lang.Object |
passwdLock
|
static java.lang.String |
PASSWORD_FILE
Define the password file. |
static java.lang.String |
PERM_DENIED
|
static java.lang.String |
SHELL_NAME
Define the shell name. |
static java.lang.String |
SHELL_VERSION
Shell version. |
static java.lang.String |
STARTUP_FILE
Define the startup file that should be parsed at startup. |
| Fields inherited from class jhomenet.shell.Shell |
|---|
environment |
| Method Summary | |
|---|---|
void |
broadcast(java.lang.String sendThis)
Broadcast a message to all users connected to the serial and Telnet servers. |
void |
enableLocalConsole(boolean enableConsole)
|
void |
execute(java.lang.Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
java.util.HashMap env)
Executes a command in the shell. |
java.util.HashMap |
getCurrentEnvironment()
Returns a copy of the currently executing Session's properties. |
java.lang.String |
getFromCurrentEnvironment(java.lang.String key)
Gets the value of the given key from the currently executing Session's properties. |
static JHomenetShell |
getInstance()
|
java.lang.String |
getName()
Returns the location of the shell. |
java.lang.String[] |
getTelnetUsers()
Gets the usernames of all users logged in to the Telnet server. |
java.lang.String |
getVersion()
Returns the version of the shell. |
protected void |
initializeShellCommands()
Initialize each command and add to list of known commands. |
boolean |
isTelnetServerRunning()
Indicates whether or not the Telnet server is up and running. |
int |
login(java.lang.String userName,
java.lang.String password)
This method is called to log a user into the system and set his privilege level correctly. |
void |
logout(java.lang.Object threadID)
This method logs the current user out of the system, returning the privilege level of the current process to the default state. |
static void |
main(java.lang.String[] args)
Create an instance of the slush shell. |
void |
shutDownLocalServer()
Bring down the local server. |
void |
shutDownTelnetServer()
Bring down the Telnet server. |
void |
startupLocalServer()
|
void |
startupNetworkServers()
Bring up the Telnet and FTP servers. |
void |
startupTelnetServer()
Initialize and start the Telnet server. |
| Methods inherited from class jhomenet.shell.Shell |
|---|
getSystemEnvironment |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static long bootTime
public static java.lang.String STARTUP_FILE
public static final java.lang.Object passwdLock
public static java.lang.String SHELL_VERSION
public static java.lang.String SHELL_NAME
public static java.lang.String PASSWORD_FILE
public static java.lang.String LOG_FILE
public static java.lang.String PERM_DENIED
public static java.lang.String EMPTY
| Method Detail |
|---|
public static JHomenetShell getInstance()
public void enableLocalConsole(boolean enableConsole)
enableLocalConsole in class ShellShell.enableLocalConsole(boolean)public void startupNetworkServers()
protected void initializeShellCommands()
initializeShellCommands in class Shell
public void execute(java.lang.Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
java.util.HashMap env)
throws java.lang.Exception
execute in class ShellcommandLine - An Object array containing the command in the first element,
followed by any parameters need for that command in a String[]
in the second element.in - The stream the command will use to get input.out - The stream used to report non-critical messages.err - The stream used to report critical messages.env - A windDirectionTable of properties variables.
java.lang.Exception - Any exception raised by the command.public java.lang.String getName()
getName in class Shellpublic java.lang.String getVersion()
getVersion in class Shellpublic java.lang.String getFromCurrentEnvironment(java.lang.String key)
getFromCurrentEnvironment in class Shellkey - The key to lookup in the current properties.
null if the key is not
set in the current properties.public java.util.HashMap getCurrentEnvironment()
getCurrentEnvironment in class Shellpublic void startupTelnetServer()
public void shutDownTelnetServer()
public void startupLocalServer()
public void shutDownLocalServer()
public java.lang.String[] getTelnetUsers()
public boolean isTelnetServerRunning()
true if the Telnet server is running.
public int login(java.lang.String userName,
java.lang.String password)
login in class ShelluserName - The user location of the user logging inpassword - The password for this user
public void logout(java.lang.Object threadID)
logout in class ShellthreadID - ThreadID of session logging out.public void broadcast(java.lang.String sendThis)
sendThis - Message to send.public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||