Commands
The commands listed below are for use in the Public API, specifically
for use to determine the parameters that can be passed to the execute
method of the com.sun.n1.sps.client.CommandManager. Under each
command, the 'result' describes the Java object that is returned as a
result of the execution of the command, while the 'Argument' table has
the following columns that represent the:
- The argument that would be used as the name part of the HashMap
that is supplied to the execute function.
- The description of the argument
- Defines whether or not this argument is required. The shorthand
notations are:
- [R] - Required argument
- [O] - Optional argument
- [O/R] - This argument may or may not be required, depending on
whether some other [O/R] argument is supplied
- The type of the argument. If the type of the argument is one of
the Public API Java objects, the link to the javadoc of that Object is
supplied.
Some
commands print out their results to an OutputStream which should be
provided by CommandManager.
By default, if OutputStream is not set, the command output will be
discarded. You can set desired output stream using
setLocalOutputStream() method of CommandManager.
The following code shows how to get an output of "pe.p.lo" command as
as a string.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
mngr.setLocalOutputStream(boas);
Map arguments = new HashMap();
arguments.put("ID", <A_Plan_ID>);
mngr.execute("pe.p.lo", arguments);
baos.close();
String output = new String(boas.toByteArray());