org.hyperic.sigar.shell
Interface ShellCommandHandler

All Known Implementing Classes:
ShellCommandBase

public interface ShellCommandHandler


Method Summary
 java.lang.String getSyntax()
          Get a description of the syntax for how a command should be invoked.
 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.
 

Method Detail

init

public void init(java.lang.String commandName,
                 ShellBase shell)
          throws ShellCommandInitException
Initialize this command handler.

Parameters:
commandName - 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.
Throws:
ShellCommandInitException

processCommand

public void processCommand(java.lang.String[] args)
                    throws ShellCommandUsageException,
                           ShellCommandExecException
Handle a command.

Parameters:
args - The args to the command.
Throws:
ShellCommandUsageException - If the args are malformed.
ShellCommandExecException - If an error occurred executing the command.

getUsageHelp

public java.lang.String getUsageHelp(java.lang.String[] args)
Get some info on how to invoke this command.

Returns:
Some usage information on how this command is expected to be invoked.

getUsageShort

public java.lang.String getUsageShort()
Get a very brief (40 character) description of the command

Returns:
A description of the command.

getSyntax

public java.lang.String getSyntax()
Get a description of the syntax for how a command should be invoked.

Returns:
A description of the syntax


Copyright © 2004-2006 Hyperic. All Rights Reserved.