public class ProcessIOContent extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
ProcessIOContent.InputToken
Input token contains data to be send on prompt.
|
protected static class |
ProcessIOContent.OutputToken
Output token contains data to be send on prompt.
|
protected static class |
ProcessIOContent.Token
Abstract input or output token.
|
protected static class |
ProcessIOContent.TreeNode
Prefix tree final node content.
|
Modifier and Type | Field and Description |
---|---|
private static Logger |
LOGGER
Logger instance for this class.
|
private String |
prompt
Process input prompt.
|
private LinkedList<ProcessIOContent.Token> |
tokens
List of tokens to be processed.
|
Constructor and Description |
---|
ProcessIOContent()
Creates an instance of server administration command execution content.
|
ProcessIOContent(String prompt)
Creates an instance of server administration command execution content.
|
Modifier and Type | Method and Description |
---|---|
void |
addInput(String[] input,
String output)
Add next expected process input dependent on matched process output.
|
void |
addInput(String input,
String output)
Add next expected process input dependent on matched process output.
|
void |
addInput(String prompt,
String[] input,
String output)
Add next expected process input dependent on matched process output.
|
void |
addInput(String prompt,
String input,
String output)
Add next expected process input dependent on matched process output.
|
void |
addOutput(String[] inputSuccess)
Add next expected process output to be matched.
|
void |
addOutput(String[] inputSuccess,
String[] inputError)
Add next expected process output to be matched.
|
ProcessIOContent.Token |
firstToken()
Get first token to be processed from list.
|
String |
getCurrentPrompt()
Get current input prompt.
|
String |
getPrompt()
Get global process input prompt.
|
ProcessIOContent.Token |
nextToken()
Get next token to be processed from list.
|
private static final Logger LOGGER
private final String prompt
private final LinkedList<ProcessIOContent.Token> tokens
public ProcessIOContent(String prompt)
prompt
- Process input prompt.public ProcessIOContent()
prompt
- Process input prompt.public String getPrompt()
public String getCurrentPrompt()
public void addOutput(String[] inputSuccess, String[] inputError)
inputSuccess
array must be matched
for successful evaluation. Any matching string from
inputError
will cause evaluation as error.
inputSuccess
- Array of input strings considered as successful
response to be matched before prompt.inputError
- Array of input strings considered as error
response to be matched before prompt.public void addOutput(String[] inputSuccess)
inputSuccess
array must be matched
for successful evaluation.
inputSuccess
- Array of input strings considered as successful
response to be matched before prompt.public void addInput(String prompt, String[] input, String output)
inputSuccess
array must be matched
for successful evaluation. Any matching string from
inputError
will cause evaluation as error.
prompt
- Process input prompt different from
global input prompt.input
- Array of input strings to be matched before prompt.output
- Output to be sent after all input strings are matched
and prompt is received.public void addInput(String prompt, String input, String output)
inputSuccess
string must be matched for successful
evaluation. Any matching string from inputError
will cause
evaluation as error.
prompt
- Process input prompt different from
global input prompt.input
- Input string to be matched before prompt.output
- Output to be sent after all input strings are matched
and prompt is received.public void addInput(String[] input, String output)
inputSuccess
array must be matched
for successful evaluation. Any matching string from
inputError
will cause evaluation as error.
input
- Array of input strings to be matched before prompt.output
- Output to be sent after all input strings are matched
and prompt is received.public void addInput(String input, String output)
inputSuccess
string must be matched for successful
evaluation. Any matching string from inputError
will cause
evaluation as error.
input
- Input string to be matched before prompt.output
- Output to be sent after all input strings are matched
and prompt is received.public ProcessIOContent.Token firstToken()
null
when list is empty.public ProcessIOContent.Token nextToken()
null
when there are no more tokens
in the list.Copyright © 2013. All Rights Reserved.