public class ScriptFileNodeStepExecutor extends java.lang.Object implements NodeStepExecutor
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SCRIPT_FILE_REMOVE_TMP |
static java.lang.String |
SERVICE_IMPLEMENTATION_NAME |
Constructor and Description |
---|
ScriptFileNodeStepExecutor(Framework framework) |
Modifier and Type | Method and Description |
---|---|
NodeStepResult |
executeNodeStep(StepExecutionContext context,
NodeStepExecutionItem item,
INodeEntry node)
Execute the step
|
static NodeStepResult |
executeRemoteScript(ExecutionContext context,
Framework framework,
INodeEntry node,
java.lang.String[] args,
java.lang.String filepath)
Execute a scriptfile already copied to a remote node with the given args
|
static NodeStepResult |
executeRemoteScript(ExecutionContext context,
Framework framework,
INodeEntry node,
java.lang.String[] args,
java.lang.String filepath,
java.lang.String scriptInterpreter,
boolean interpreterargsquoted)
Execute a scriptfile already copied to a remote node with the given args
|
static NodeStepResult |
executeRemoteScript(ExecutionContext context,
Framework framework,
INodeEntry node,
java.lang.String[] args,
java.lang.String filepath,
java.lang.String scriptInterpreter,
boolean interpreterargsquoted,
boolean removeFile)
Execute a scriptfile already copied to a remote node with the given args
|
static NodeStepResult |
executeScriptFile(StepExecutionContext context,
INodeEntry node,
java.lang.String scriptString,
java.lang.String serverScriptFilePath,
java.io.InputStream scriptAsStream,
java.lang.String fileExtension,
java.lang.String[] args,
java.lang.String scriptInterpreter,
boolean quoted,
ExecutionService executionService)
Execute a script on a remote node
|
static ExecArgList |
removeArgsForOsFamily(java.lang.String filepath,
java.lang.String osFamily)
Return ExecArgList for removing a file for the given OS family
|
static java.io.File |
writeScriptToTempFile(StepExecutionContext context,
INodeEntry node,
java.lang.String scriptString,
java.lang.String serverScriptFilePath,
java.io.InputStream scriptAsStream)
Copy the script input to a temp file and expand embedded tokens,
if it is a string or inputstream.
|
public static final java.lang.String SERVICE_IMPLEMENTATION_NAME
public static final java.lang.String SCRIPT_FILE_REMOVE_TMP
public ScriptFileNodeStepExecutor(Framework framework)
public NodeStepResult executeNodeStep(StepExecutionContext context, NodeStepExecutionItem item, INodeEntry node) throws NodeStepException
NodeStepExecutor
executeNodeStep
in interface NodeStepExecutor
context
- contextitem
- step itemnode
- nodeNodeStepException
- on step errorpublic static NodeStepResult executeScriptFile(StepExecutionContext context, INodeEntry node, java.lang.String scriptString, java.lang.String serverScriptFilePath, java.io.InputStream scriptAsStream, java.lang.String fileExtension, java.lang.String[] args, java.lang.String scriptInterpreter, boolean quoted, ExecutionService executionService) throws NodeStepException
context
- contextnode
- nodescriptString
- stringserverScriptFilePath
- filescriptAsStream
- streamfileExtension
- file extensionargs
- script argsscriptInterpreter
- invoker stringquoted
- true if args are quotedexecutionService
- serviceNodeStepException
- on errorpublic static java.io.File writeScriptToTempFile(StepExecutionContext context, INodeEntry node, java.lang.String scriptString, java.lang.String serverScriptFilePath, java.io.InputStream scriptAsStream) throws FileCopierException
context
- contextnode
- nodescriptString
- stringserverScriptFilePath
- filescriptAsStream
- streamFileCopierException
- on errorpublic static NodeStepResult executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath) throws NodeStepException
context
- contextframework
- frameworknode
- the nodeargs
- arguments to scriptfilepath
- the remote path for the scriptNodeStepException
- on errorpublic static NodeStepResult executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath, java.lang.String scriptInterpreter, boolean interpreterargsquoted) throws NodeStepException
context
- contextframework
- frameworknode
- the nodeargs
- arguments to scriptfilepath
- the remote path for the scriptscriptInterpreter
- interpreter used to invoke the scriptinterpreterargsquoted
- if true, pass the file and script args as a single argument to the interpreterNodeStepException
- on errorpublic static NodeStepResult executeRemoteScript(ExecutionContext context, Framework framework, INodeEntry node, java.lang.String[] args, java.lang.String filepath, java.lang.String scriptInterpreter, boolean interpreterargsquoted, boolean removeFile) throws NodeStepException
context
- contextframework
- frameworknode
- the nodeargs
- arguments to scriptfilepath
- the remote path for the scriptscriptInterpreter
- interpreter used to invoke the scriptinterpreterargsquoted
- if true, pass the file and script args as a single argument to the interpreterremoveFile
- if true, remove the file after executionNodeStepException
- on errorpublic static ExecArgList removeArgsForOsFamily(java.lang.String filepath, java.lang.String osFamily)
filepath
- pathosFamily
- family