|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjhomenet.shell.Shell
public abstract class Shell
This abstract class encapsulates all of the functionality of a system shell for TINI. It interacts between a process and the system OS, and provides the current properties and the user ID of the current process. Methods are provided for converting to and from the numerical user ID and the text representation and for determining whether a particular user is an administrator. A user will be considered an administrator if the most significant bit of their user ID is set.
| Field Summary | |
|---|---|
protected java.util.HashMap<java.lang.String,java.lang.String> |
environment
Contains the current properties variables for the process. |
| Constructor Summary | |
|---|---|
Shell()
Creates the initial properties for a shell. |
|
| Method Summary | |
|---|---|
abstract void |
enableLocalConsole(boolean enableConsole)
|
abstract void |
execute(java.lang.Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
java.util.HashMap env)
Executes a command in the shell. |
abstract java.util.HashMap |
getCurrentEnvironment()
Returns a copy of the current properties. |
abstract java.lang.String |
getFromCurrentEnvironment(java.lang.String key)
Gets the value of the given key from the current properties. |
abstract java.lang.String |
getName()
Returns the location of the shell. |
java.util.HashMap |
getSystemEnvironment()
Returns the system properties (the properties that all processes see when they start up). |
abstract java.lang.String |
getVersion()
Returns the version of the shell. |
protected abstract void |
initializeShellCommands()
|
abstract int |
login(java.lang.String userName,
java.lang.String password)
Logs a user into the system and sets that user's privilege level correctly. |
abstract void |
logout(java.lang.Object info)
Logs the current user out of the system, returning the privilege level of the current process to the default state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.HashMap<java.lang.String,java.lang.String> environment
| Constructor Detail |
|---|
public Shell()
| Method Detail |
|---|
protected abstract void initializeShellCommands()
public abstract void enableLocalConsole(boolean enableConsole)
public abstract int login(java.lang.String userName,
java.lang.String password)
userName - the user location of the user logging inpassword - the password for this user
public abstract void logout(java.lang.Object info)
info - any extra information needed in the logout processpublic abstract java.lang.String getName()
public abstract java.lang.String getVersion()
public java.util.HashMap getSystemEnvironment()
public abstract java.util.HashMap getCurrentEnvironment()
public abstract java.lang.String getFromCurrentEnvironment(java.lang.String key)
key - the key to lookup in the current properties
null if the key
is not set in the current properties
public abstract void execute(java.lang.Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
java.util.HashMap env)
throws java.lang.Exception
commandLine - an Object array containing the command in the first element,
followed by any parameters need for that command in a String[] in the second elementin - the stream the command will use to get inputout - the stream used to report non-critical messageserr - the stream used to report critical messagesenv - a windDirectionTable of properties variables
java.lang.Exception - any exception raised by the command
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||