public class CLIInteraction extends Object
Maapi.getCLIInteraction(int)
 method as is intended to be used from inside an action callback| Modifier and Type | Method and Description | 
|---|---|
void | 
cmd(String command)
Execute CLI command in ongoing CLI session. 
 | 
void | 
cmd(String command,
   EnumSet<CLIInteractionFlag> flags)
Execute CLI command in ongoing CLI session. 
 | 
void | 
cmd(String command,
   EnumSet<CLIInteractionFlag> flags,
   String unhide)
Execute CLI command in ongoing CLI session. 
 | 
MaapiInputStream | 
cmdIO(String command,
     EnumSet<CLIInteractionFlag> flags,
     String unhide)
Execute CLI command in ongoing CLI session and output result on socket. 
 | 
String | 
get(String parameter)
Read CLI session parameter. 
 | 
void | 
printf(String fmt,
      Object... arguments)
Write to the CLI using printf formatting. 
 | 
String | 
prompt(String promptStr,
      boolean echo)
Prompt user for a string. 
 | 
String | 
prompt(String promptStr,
      boolean echo,
      int timeout)
This function does the same as prompt(String promptStr), but also takes a
 timeout parameter, which controls how long (in seconds) to wait for input
 before aborting. 
 | 
String | 
promptOneOf(String promptStr,
           String[] choice,
           boolean echo)
Prompt user for one of the strings given in the choice parameter. 
 | 
String | 
promptOneOf(String promptStr,
           String[] choice,
           boolean echo,
           int timeout)
This function does the same as promptOneOf(String promptStr, String[]
 choice, boolean echo), but also takes a timeout parameter. 
 | 
String | 
readEOF(boolean echo)
Read a multi line string from the CLI. 
 | 
String | 
readEOF(boolean echo,
       int timeout)
This function does the same as readEOF(boolean echo), but also takes a
 timeout parameter, which indicates how long the user may be idle (in
 seconds) before the reading is aborted. 
 | 
void | 
set(String parameter,
   String value)
Set CLI session parameter. 
 | 
void | 
write(String str)
Write to the CLI. 
 | 
public String prompt(String promptStr, boolean echo) throws IOException, ConfException
promptStr - echo - IOExceptionConfExceptionpublic String prompt(String promptStr, boolean echo, int timeout) throws IOException, ConfException
promptStr - echo - timeout - IOExceptionConfExceptionpublic String promptOneOf(String promptStr, String[] choice, boolean echo) throws IOException, ConfException
For example:
 CLIInteraction cli = maapi.getCLIInteraction(usid);
 String result =
     cli.promptOneOf("Do you want to proceed (yes/no): ",
                     new String[] { "yes",
                     "no" }, true);
 
 The user can enter a unique prefix of the choice but the value returned will always be one of the strings provided in the choice parameter. If the user enters a value not in choice he will automatically be re-prompted.
For example:
     Do you want to proceed (yes/no): maybe
     The value must be one of: yes,no.
     Do you want to proceed (yes/no):
 
 promptStr - choice - echo - IOExceptionConfExceptionpublic String promptOneOf(String promptStr, String[] choice, boolean echo, int timeout) throws IOException, ConfException
promptStr - choice - echo - timeout - IOExceptionConfExceptionpublic String readEOF(boolean echo) throws IOException, ConfException
echo - IOExceptionConfExceptionpublic String readEOF(boolean echo, int timeout) throws IOException, ConfException
echo - timeout - IOExceptionConfExceptionpublic void write(String str) throws IOException, ConfException
str - IOExceptionConfExceptionpublic String get(String parameter) throws IOException, ConfException
parameter - IOExceptionConfExceptionpublic void set(String parameter, String value) throws IOException, ConfException
parameter - value - IOExceptionConfExceptionpublic void cmd(String command) throws IOException, ConfException
command - IOExceptionConfExceptionpublic void cmd(String command, EnumSet<CLIInteractionFlag> flags) throws IOException, ConfException
command - flags - IOExceptionConfExceptionpublic void cmd(String command, EnumSet<CLIInteractionFlag> flags, String unhide) throws IOException, ConfException
command - flags - unhide - IOExceptionConfExceptionpublic void printf(String fmt, Object... arguments) throws IOException, ConfException
fmt - arguments - IOExceptionConfExceptionpublic MaapiInputStream cmdIO(String command, EnumSet<CLIInteractionFlag> flags, String unhide) throws IOException, ConfException
command - flags - unhide - IOExceptionConfException