org.hyperic.sigar.shell
Interface ShellCommandHandler

All Known Implementing Classes:
CpuInfo, Df, Du, FileVersionInfo, Free, Ifconfig, Iostat, Kill, Ls, MultiPs, MultiwordShellCommand, NetInfo, Netstat, Nfsstat, Pidof, ProcFileInfo, ProcInfo, ProcModuleInfo, Ps, Route, ShellCommand_alias, ShellCommand_get, ShellCommand_help, ShellCommand_quit, ShellCommand_set, ShellCommand_sleep, ShellCommand_source, ShellCommandBase, ShowArgs, ShowEnv, SigarCommandBase, SysInfo, Time, Ulimit, Uptime, Version, Who, Win32Service

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

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

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

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

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

Returns:
A description of the command.

getSyntax

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-2009 Hyperic. All Rights Reserved.