|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.hyperic.util.shell.ShellBase
public abstract class ShellBase
| Field Summary | |
|---|---|
static java.lang.String |
PROP_PAGE_SIZE
|
| Constructor Summary | |
|---|---|
ShellBase()
|
|
| Method Summary | |
|---|---|
java.util.Iterator |
getCommandNameIterator()
Get an iterator for the command names. |
PageControl |
getDefaultPageControl()
|
java.io.PrintStream |
getErrStream()
|
ShellCommandHandler |
getHandler(java.lang.String command)
Get the command handler for a command. |
java.lang.String |
getHiddenInput(java.lang.String prompt)
If a command needs additional input via the console, they can get it this way. |
java.lang.String |
getInput(java.lang.String prompt)
If a command needs additional input via the console, they can get it this way. |
java.lang.String |
getInput(java.lang.String prompt,
boolean addToHistory)
If a command needs additional input via the console, they can get it this way. |
java.io.PrintStream |
getOutStream()
|
int |
getPageSize()
Get the current page size used when paging data. |
void |
handleCommand(java.lang.String line)
|
void |
handleCommand(java.lang.String line,
java.lang.String[] args)
|
void |
init(java.lang.String applicationName,
java.io.PrintStream out,
java.io.PrintStream err)
|
boolean |
isRedirected()
Check to see if the currently running shell command is being redirected to a file. |
void |
performPaging(PageFetcher fetcher)
|
void |
performPaging(PageFetcher fetcher,
PageControl control)
|
void |
processCommand(ShellCommandHandler handler,
java.lang.String[] args)
|
void |
readRCFile(java.io.File rcFile,
boolean echoCommands)
Read a .rc file into the shell, invoking everything in it (without saving the actions to history) |
void |
registerCommandHandler(java.lang.String commandName,
ShellCommandHandler handler)
Register a new command handler. |
void |
run()
|
void |
sendToErrStream(java.lang.String s)
Write a string to this shell's output stream. |
void |
sendToOutStream(java.lang.String s)
Write a string to this shell's output stream. |
void |
setPageSize(int size)
Set the page size for data paging. |
void |
setPrompt(java.lang.String prompt)
Change the prompt |
void |
shutdown()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROP_PAGE_SIZE
| Constructor Detail |
|---|
public ShellBase()
| Method Detail |
|---|
public void init(java.lang.String applicationName,
java.io.PrintStream out,
java.io.PrintStream err)
public void readRCFile(java.io.File rcFile,
boolean echoCommands)
throws java.io.IOException
rcFile - File to read
java.io.IOExceptionpublic void setPrompt(java.lang.String prompt)
prompt -
public void registerCommandHandler(java.lang.String commandName,
ShellCommandHandler handler)
throws ShellCommandInitException
commandName - The command that this handler will process.handler - The handler to register.
ShellCommandInitException
public java.lang.String getInput(java.lang.String prompt)
throws java.io.EOFException,
java.io.IOException
prompt - The prompt to display.
java.io.EOFException
java.io.IOException
public java.lang.String getInput(java.lang.String prompt,
boolean addToHistory)
throws java.io.EOFException,
java.io.IOException
prompt - The prompt to display.addToHistory - If true, the input entered will be added to the
history file.
java.io.EOFException
java.io.IOException
public java.lang.String getHiddenInput(java.lang.String prompt)
throws java.io.EOFException,
java.io.IOException
prompt - The prompt to display.
java.io.EOFException
java.io.IOExceptionpublic void sendToOutStream(java.lang.String s)
s - The string to write to the output stream.public void sendToErrStream(java.lang.String s)
s - The string to write to the output stream.public void run()
public void handleCommand(java.lang.String line)
public void handleCommand(java.lang.String line,
java.lang.String[] args)
public void processCommand(ShellCommandHandler handler,
java.lang.String[] args)
throws ShellCommandUsageException,
ShellCommandExecException
ShellCommandUsageException
ShellCommandExecExceptionpublic java.io.PrintStream getOutStream()
public java.io.PrintStream getErrStream()
public ShellCommandHandler getHandler(java.lang.String command)
ShellCommandMapper
getHandler in interface ShellCommandMapperShellCommandMapper.getHandler(java.lang.String)public java.util.Iterator getCommandNameIterator()
ShellCommandMapper
getCommandNameIterator in interface ShellCommandMapperShellCommandMapper.getCommandNameIterator()public void shutdown()
public boolean isRedirected()
public void setPageSize(int size)
size - Number of rows to include in a page of data -- if
0, then unlimited rows will be used.public int getPageSize()
public PageControl getDefaultPageControl()
public void performPaging(PageFetcher fetcher)
throws PageFetchException
PageFetchException
public void performPaging(PageFetcher fetcher,
PageControl control)
throws PageFetchException
PageFetchException
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||