|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.dalsemi.shell.TINIShell | +--com.dalsemi.shell.DefaultTINIShell
The default implementation of a TINIShell. In this shell, all users are assigned the
same UID and user name, and all are given adminstrator privileges. This shell has no
commands associated with it. For an example of a complete implementation of a TINIShell,
see the slush
shell that is included with the TINI distribution files.
Fields inherited from class com.dalsemi.shell.TINIShell |
adminUID,
environment |
Constructor Summary | |
DefaultTINIShell()
Creates the initial environment for a shell. |
Method Summary | |
void |
execute(Object[] commandLine,
SystemInputStream in,
SystemPrintStream out,
SystemPrintStream err,
Hashtable env)
Executes a command in the shell. |
Hashtable |
getCurrentEnvironment()
Returns a copy of the current environment. |
byte |
getCurrentUID()
Returns the user ID of the current user. |
String |
getCurrentUserName()
Returns the name of the current user logged in. |
String |
getFromCurrentEnvironment(String key)
Gets the value of the given key from the current environment. |
String |
getName()
Returns the name of the shell. |
int |
getUIDByUserName(String username)
Returns the ID of the user with the given user name. |
String |
getUserNameByUID(byte uid)
Returns the user name of the user with the given user ID. |
String |
getVersion()
Returns the version of the shell. |
int |
login(String userName,
String password)
Logs a user into the system and sets that user's privilege level correctly. |
void |
logout(Object info)
Does nothing in this implementation. |
Methods inherited from class com.dalsemi.shell.TINIShell |
getSystemEnvironment,
isAdmin,
isCurrentUserAdmin |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DefaultTINIShell()
Method Detail |
public String getName()
public String getVersion()
public int login(String userName, String password)
userName
- the user name of the user logging inpassword
- the password for this userpublic void logout(Object info)
info
- any extra information needed in the logout processpublic byte getCurrentUID()
public String getUserNameByUID(byte uid)
uid
- The uid to checkpublic int getUIDByUserName(String username)
username
- the username to checkpublic String getCurrentUserName()
public Hashtable getCurrentEnvironment()
public String getFromCurrentEnvironment(String key)
key
- the key to lookup in the current environmentpublic void execute(Object[] commandLine, SystemInputStream in, SystemPrintStream out, SystemPrintStream err, Hashtable env) throws 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 table of environment variables
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |