Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.util.shell
Interface ShellCommandHandler

All Known Implementing Classes:
MultiwordShellCommand, ShellCommand_get, ShellCommand_help, ShellCommand_quit, ShellCommand_set, ShellCommand_sleep, ShellCommand_source, 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

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.
out - The PrintStream to use for standard output.
err - The PrintStream to use for error output.
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

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.