public class KnifeTaskFactory<RET> extends SystemProcessTaskFactory<KnifeTaskFactory<RET>,RET>
ProcessTaskFactory
with special options for knife.
Typical usage is to #addKnifeParameters(String)
s for the knife command to be run.
You can also AbstractProcessTaskFactory.add(String...)
commands as needed; these will run *before* knife,
unless you addKnifeCommandHere().
This impl will use sensible defaults, including ConfigKey
s on the context entity,
for general knife config but not specific commands etc. It supports:
ChefConfig.KNIFE_EXECUTABLE
ChefConfig.KNIFE_CONFIG_FILE
(Other fields will typically be used by methods calling to this factory.)
SystemProcessTaskFactory.ConcreteSystemProcessTaskFactory<RET>
ProcessTaskStub.ScriptReturnType
Modifier and Type | Field and Description |
---|---|
java.lang.String |
taskName |
Constructor and Description |
---|
KnifeTaskFactory(java.lang.String taskName) |
Modifier and Type | Method and Description |
---|---|
KnifeTaskFactory<RET> |
addKnifeCommandToScript()
Inserts the knife command at the current place in the list.
|
java.util.List<java.lang.String> |
getCommands() |
java.util.List<com.google.common.base.Function<ProcessTaskWrapper<?>,java.lang.Void>> |
getCompletionListeners() |
KnifeTaskFactory<RET> |
knifeAddParameters(java.lang.String word1,
java.lang.String... words) |
KnifeTaskFactory<RET> |
knifeConfigFile(java.lang.String knifeConfigFile) |
KnifeTaskFactory<RET> |
knifeExecutable(java.lang.String knifeExecutable) |
KnifeTaskFactory<RET> |
knifeSetupCommands(java.lang.String knifeSetupCommands) |
ProcessTaskWrapper<RET> |
newTask() |
KnifeTaskFactory<RET> |
notThrowingOnCommonKnifeErrors() |
KnifeTaskFactory<java.lang.String> |
requiringZeroAndReturningStdout() |
<RET2> KnifeTaskFactory<RET2> |
returning(com.google.common.base.Function<ProcessTaskWrapper<?>,RET2> resultTransformation) |
<T2> KnifeTaskFactory<T2> |
returning(ProcessTaskStub.ScriptReturnType type) |
KnifeTaskFactory<java.lang.Boolean> |
returningIsExitCodeZero() |
directory, loginShell, machine
add, add, addCompletionListener, allowingNonZeroExitCode, configure, configure, constructCustomizedTaskBuilder, environmentVariable, environmentVariables, requiringExitCodeZero, requiringExitCodeZero, runAsCommand, runAsRoot, runAsScript, summary
getMachine, getShellEnvironment, getSummary, toString
public java.util.List<com.google.common.base.Function<ProcessTaskWrapper<?>,java.lang.Void>> getCompletionListeners()
getCompletionListeners
in class ProcessTaskStub
public KnifeTaskFactory<RET> notThrowingOnCommonKnifeErrors()
public ProcessTaskWrapper<RET> newTask()
newTask
in interface TaskFactory<ProcessTaskWrapper<RET>>
newTask
in class SystemProcessTaskFactory<KnifeTaskFactory<RET>,RET>
public KnifeTaskFactory<RET> addKnifeCommandToScript()
AbstractProcessTaskFactory.add(String...)
ed.public java.util.List<java.lang.String> getCommands()
getCommands
in class ProcessTaskStub
public KnifeTaskFactory<RET> knifeExecutable(java.lang.String knifeExecutable)
public KnifeTaskFactory<RET> knifeAddParameters(java.lang.String word1, java.lang.String... words)
public KnifeTaskFactory<RET> knifeConfigFile(java.lang.String knifeConfigFile)
public KnifeTaskFactory<RET> knifeSetupCommands(java.lang.String knifeSetupCommands)
public <T2> KnifeTaskFactory<T2> returning(ProcessTaskStub.ScriptReturnType type)
returning
in interface ProcessTaskFactory<RET>
returning
in class AbstractProcessTaskFactory<KnifeTaskFactory<RET>,RET>
public <RET2> KnifeTaskFactory<RET2> returning(com.google.common.base.Function<ProcessTaskWrapper<?>,RET2> resultTransformation)
returning
in interface ProcessTaskFactory<RET>
returning
in class AbstractProcessTaskFactory<KnifeTaskFactory<RET>,RET>
public KnifeTaskFactory<java.lang.Boolean> returningIsExitCodeZero()
returningIsExitCodeZero
in interface ProcessTaskFactory<RET>
returningIsExitCodeZero
in class AbstractProcessTaskFactory<KnifeTaskFactory<RET>,RET>
public KnifeTaskFactory<java.lang.String> requiringZeroAndReturningStdout()
requiringZeroAndReturningStdout
in interface ProcessTaskFactory<RET>
requiringZeroAndReturningStdout
in class AbstractProcessTaskFactory<KnifeTaskFactory<RET>,RET>