|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.BobCo.cli.CliSample
This command line interface (CLI) example shows how to create a bundle extending the command line framework. The steps to creating a bundle are:
(1) implement the ICliBundle interface
(2) use the below method signature for all accessible bundle commands:
(3) furnish the help method
The name of the method is used as the name of the command and this is not re-definable.
When a user executes a command the corresponding method is invoked where:
This particular bundle example implements two usage/help commands:
Two functional commands are implemented as well. One to list all of the subagents for a specified set of systems, and the other to verify a list of service nodes. The commands are below:
ICliBundle
Field Summary |
---|
Fields inherited from interface com.tivoli.twg.engine.cli.ICliBundle |
---|
COMMAND_EXCEPTION, FAIL, NOT_FOUND, OK, SECURITY_FAILURE, USAGE |
Constructor Summary | |
---|---|
CliSample()
Default and only constructor |
Method Summary | |
---|---|
int |
checkServiceNodes(java.util.Locale locale,
java.lang.String[] args,
java.io.Writer out)
Check for the existance of the named IPC service nodes |
int |
help(java.util.Locale locale,
java.lang.String[] args,
java.io.Writer out)
Mandated bundle command to provide bundle help |
int |
list(java.util.Locale locale,
java.lang.String[] args,
java.io.Writer out)
Bundle command to provide bundle a short/quick command reference |
int |
listSystemSubAgents(java.util.Locale locale,
java.lang.String[] args,
java.io.Writer out)
List the subagents on the given systems |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CliSample()
All CLI bundle extensions must have an empty parameter constructor. The constructor can either be ommitted or defined with no parameters
Method Detail |
public int help(java.util.Locale locale, java.lang.String[] args, java.io.Writer out) throws java.lang.Exception
help
in interface com.tivoli.twg.engine.cli.ICliBundle
java.lang.Exception
public int list(java.util.Locale locale, java.lang.String[] args, java.io.Writer out) throws java.lang.Exception
java.lang.Exception
public int listSystemSubAgents(java.util.Locale locale, java.lang.String[] args, java.io.Writer out) throws java.lang.Exception
java.lang.Exception
public int checkServiceNodes(java.util.Locale locale, java.lang.String[] args, java.io.Writer out) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |