public abstract class AbstractProcessTaskFactory<T extends AbstractProcessTaskFactory<T,RET>,RET> extends ProcessTaskStub implements ProcessTaskFactory<RET>
ProcessTaskStub.ScriptReturnType| Constructor and Description |
|---|
AbstractProcessTaskFactory(java.lang.String... commands) |
| Modifier and Type | Method and Description |
|---|---|
T |
add(java.lang.Iterable<java.lang.String> commandsToAdd) |
T |
add(java.lang.String... commandsToAdd) |
T |
addCompletionListener(com.google.common.base.Function<ProcessTaskWrapper<?>,java.lang.Void> listener)
adds a listener which will be notified of (otherwise) successful completion,
typically used to invalidate the result (ie throw exception, to promote a string in the output to an exception);
invoked even if return code is zero, so a better error can be thrown
|
T |
allowingNonZeroExitCode() |
<V> T |
configure(ConfigKey<V> key,
V value)
allows setting config-key based properties for specific underlying tools
|
T |
configure(java.util.Map<?,?> flags)
allows setting config-key/flag based properties for specific underlying tools;
but note that if any are prefixed with
SshTool.BROOKLYN_CONFIG_KEY_PREFIX
these should normally be filtered out |
TaskBuilder<java.lang.Object> |
constructCustomizedTaskBuilder()
creates the TaskBuilder which can be further customized; typically invoked by the initial
TaskFactory.newTask() |
T |
environmentVariable(java.lang.String key,
java.lang.String val) |
T |
environmentVariables(java.util.Map<java.lang.String,java.lang.String> vars) |
T |
machine(SshMachineLocation machine) |
T |
requiringExitCodeZero() |
T |
requiringExitCodeZero(java.lang.String extraErrorMessage) |
ProcessTaskFactory<java.lang.String> |
requiringZeroAndReturningStdout() |
<RET2> ProcessTaskFactory<RET2> |
returning(com.google.common.base.Function<ProcessTaskWrapper<?>,RET2> resultTransformation) |
<RET2> ProcessTaskFactory<RET2> |
returning(ProcessTaskStub.ScriptReturnType type) |
ProcessTaskFactory<java.lang.Boolean> |
returningIsExitCodeZero() |
T |
runAsCommand() |
T |
runAsRoot() |
T |
runAsScript() |
T |
summary(java.lang.String summary) |
getCommands, getCompletionListeners, getMachine, getShellEnvironment, getSummary, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitnewTaskpublic AbstractProcessTaskFactory(java.lang.String... commands)
public T add(java.lang.String... commandsToAdd)
add in interface ProcessTaskFactory<RET>public T add(java.lang.Iterable<java.lang.String> commandsToAdd)
add in interface ProcessTaskFactory<RET>public T machine(SshMachineLocation machine)
machine in interface ProcessTaskFactory<RET>public T requiringExitCodeZero()
requiringExitCodeZero in interface ProcessTaskFactory<RET>public T requiringExitCodeZero(java.lang.String extraErrorMessage)
requiringExitCodeZero in interface ProcessTaskFactory<RET>public T allowingNonZeroExitCode()
allowingNonZeroExitCode in interface ProcessTaskFactory<RET>public ProcessTaskFactory<java.lang.Boolean> returningIsExitCodeZero()
returningIsExitCodeZero in interface ProcessTaskFactory<RET>public ProcessTaskFactory<java.lang.String> requiringZeroAndReturningStdout()
requiringZeroAndReturningStdout in interface ProcessTaskFactory<RET>public <RET2> ProcessTaskFactory<RET2> returning(ProcessTaskStub.ScriptReturnType type)
returning in interface ProcessTaskFactory<RET>public <RET2> ProcessTaskFactory<RET2> returning(com.google.common.base.Function<ProcessTaskWrapper<?>,RET2> resultTransformation)
returning in interface ProcessTaskFactory<RET>public T runAsCommand()
runAsCommand in interface ProcessTaskFactory<RET>public T runAsScript()
runAsScript in interface ProcessTaskFactory<RET>public T runAsRoot()
runAsRoot in interface ProcessTaskFactory<RET>public T environmentVariable(java.lang.String key, java.lang.String val)
environmentVariable in interface ProcessTaskFactory<RET>public T environmentVariables(java.util.Map<java.lang.String,java.lang.String> vars)
environmentVariables in interface ProcessTaskFactory<RET>public TaskBuilder<java.lang.Object> constructCustomizedTaskBuilder()
TaskFactory.newTask()public T summary(java.lang.String summary)
summary in interface ProcessTaskFactory<RET>public <V> T configure(ConfigKey<V> key, V value)
ProcessTaskFactoryconfigure in interface ProcessTaskFactory<RET>public T configure(java.util.Map<?,?> flags)
ProcessTaskFactorySshTool.BROOKLYN_CONFIG_KEY_PREFIX
these should normally be filtered outconfigure in interface ProcessTaskFactory<RET>public T addCompletionListener(com.google.common.base.Function<ProcessTaskWrapper<?>,java.lang.Void> listener)
ProcessTaskFactoryaddCompletionListener in interface ProcessTaskFactory<RET>