public class ShellCommandBase extends java.lang.Object implements ShellCommandHandler
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
itsCommandName |
protected ShellBase |
itsShell |
| Constructor and Description |
|---|
ShellCommandBase() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCommandName() |
java.io.PrintStream |
getErrStream() |
java.io.PrintStream |
getOutStream() |
ShellBase |
getShell() |
java.lang.String |
getSyntax()
Get a description of the syntax for how a command should be invoked.
|
java.lang.String |
getSyntaxArgs() |
java.lang.String |
getUsageHelp(java.lang.String[] args)
Get some info on how to invoke this command.
|
java.lang.String |
getUsageShort()
Get a very brief (40 character) description of the command
|
void |
init(java.lang.String commandName,
ShellBase shell)
Initialize this command handler.
|
void |
processCommand(java.lang.String[] args)
Handle a command.
|
protected java.lang.String itsCommandName
protected ShellBase itsShell
public java.lang.String getCommandName()
public ShellBase getShell()
public java.io.PrintStream getOutStream()
public java.io.PrintStream getErrStream()
public void init(java.lang.String commandName,
ShellBase shell)
throws ShellCommandInitException
ShellCommandHandlerinit in interface ShellCommandHandlercommandName - The name of the command.shell - The shell. This is useful for command
that need to be able to interpret other commands, like the "help"
command, and for commands that need to get additional user input,
for example a login command that presents a password prompt.ShellCommandInitExceptionpublic void processCommand(java.lang.String[] args)
throws ShellCommandUsageException,
ShellCommandExecException
ShellCommandHandlerprocessCommand in interface ShellCommandHandlerargs - The args to the command.ShellCommandUsageException - If the args are malformed.ShellCommandExecException - If an error occurred
executing the command.public java.lang.String getSyntax()
ShellCommandHandlergetSyntax in interface ShellCommandHandlerpublic java.lang.String getSyntaxArgs()
public java.lang.String getUsageShort()
ShellCommandHandlergetUsageShort in interface ShellCommandHandlerpublic java.lang.String getUsageHelp(java.lang.String[] args)
ShellCommandHandlergetUsageHelp in interface ShellCommandHandlerCopyright ? 2004-2011 Hyperic. All Rights Reserved.