public class WinRmExecuteHelper
extends java.lang.Object
org.apache.brooklyn.entity.software.base.lifecycle.ScriptHelper
analog for WinRMModifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
java.lang.String |
summary |
Constructor and Description |
---|
WinRmExecuteHelper(NativeWindowsScriptRunner runner,
java.lang.String summary) |
Modifier and Type | Method and Description |
---|---|
int |
execute() |
int |
executeInternal() |
WinRmExecuteHelper |
failOnNonZeroResultCode() |
WinRmExecuteHelper |
gatherOutput() |
WinRmExecuteHelper |
gatherOutput(boolean gather) |
java.util.Map |
getFlags() |
java.lang.String |
getResultStderr() |
java.lang.String |
getResultStdout() |
Task<java.lang.Integer> |
newTask()
creates a task which will execute this script; note this can only be run once per instance of this class
|
Task<java.lang.Integer> |
queue()
queues the task for execution if we are in a
TaskQueueingContext (e.g. |
WinRmExecuteHelper |
setCommand(java.lang.String command) |
WinRmExecuteHelper |
setEnv(java.util.Map<java.lang.String,java.lang.String> env) |
WinRmExecuteHelper |
setNtDomain(java.lang.String domain) |
WinRmExecuteHelper |
setPsCommand(java.lang.String psCommand) |
WinRmExecuteHelper |
updateTaskAndFailOnNonZeroResultCode() |
WinRmExecuteHelper |
useMutex(WithMutexes mutexSupport,
java.lang.String mutexId,
java.lang.String description)
indicates that the script should acquire the given mutexId on the given mutexSupport
and maintain it for the duration of script execution;
typically used to prevent parallel scripts from conflicting in access to a resource
(e.g.
|
public static final org.slf4j.Logger LOG
public final java.lang.String summary
public WinRmExecuteHelper(NativeWindowsScriptRunner runner, java.lang.String summary)
public WinRmExecuteHelper setNtDomain(java.lang.String domain)
public WinRmExecuteHelper setCommand(java.lang.String command)
public WinRmExecuteHelper setPsCommand(java.lang.String psCommand)
public WinRmExecuteHelper setEnv(java.util.Map<java.lang.String,java.lang.String> env)
public WinRmExecuteHelper useMutex(WithMutexes mutexSupport, java.lang.String mutexId, java.lang.String description)
public Task<java.lang.Integer> queue()
TaskQueueingContext
(e.g. EffectorTaskFactory);
or if we aren't in a queueing context, it will submit the task (assuming there is an ExecutionContext
_and_ block until completion, throwing on errorpublic Task<java.lang.Integer> newTask()
public int execute()
public int executeInternal()
public WinRmExecuteHelper failOnNonZeroResultCode()
public WinRmExecuteHelper updateTaskAndFailOnNonZeroResultCode()
public WinRmExecuteHelper gatherOutput()
public WinRmExecuteHelper gatherOutput(boolean gather)
public java.util.Map getFlags()
public java.lang.String getResultStdout()
public java.lang.String getResultStderr()