See: Description
| Interface | Description |
|---|---|
| ResponseProvider<T> |
Used to get a response, given an instance of an input
String. |
| ResponseProvider.OutputMatcher<T> |
Represents a <prompt, response> pair.
|
| Class | Description |
|---|---|
| AbstractResponseProvider<T> |
Abstract implementation of
ResponseProvider. |
| AbstractResponseProvider.Builder<T> |
A builder for an
AbstractResponseProvider. |
| CommandOutputTrigger |
Listens on long-running commands and runs
Runnables when certain
output appears. |
| OrderedResponseProvider<T> |
An implementation of
AbstractResponseProvider that matches <prompt,
response> pairs sequentially. |
| OrderedResponseProvider.Builder<T> |
A builder for an
OrderedResponseProvider. |
| ShellConversation |
Asynchronously responds to interactive command execution, as represented by a
CommandFuture, using a ResponseProvider. |
| UnorderedResponseProvider<T> |
An implementation of
AbstractResponseProvider that matches <prompt,
response> pairs in any order. |
| UnorderedResponseProvider.Builder<T> |
A builder for an
UnorderedResponseProvider. |
One use case is commands that require user input. This use case
is supported by using <prompt, response> pairs which are modeled
by the AbstractResponseProvider
object parameterized with String.
This object is used by a ShellConversation
to carry out a scripted conversation.
A second use case is long-running commands where it is of interest to
perform certain actions when certain output appears. A
CommandOutputTrigger
is used to do this and will execute given Runnables on
string matches. Similar ShellConversation, this uses an
ResponseProvider but parameterized with Runnable.
In all cases, strings can be matched via regular expression, exact
matching, or using a custom Predicate.