Class ExecutionServiceImpl
- java.lang.Object
-
- com.dtolabs.rundeck.core.execution.ExecutionServiceImpl
-
- All Implemented Interfaces:
FrameworkSupportService
,ExecutionService
,NodeExecutionService
,AppService
public class ExecutionServiceImpl extends java.lang.Object implements ExecutionService
NewExecutionServiceImpl is ...
-
-
Field Summary
-
Fields inherited from interface com.dtolabs.rundeck.core.execution.ExecutionService
SERVICE_NAME
-
-
Constructor Summary
Constructors Constructor Description ExecutionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DispatcherResult
dispatchToNodes(StepExecutionContext context, Dispatchable item)
Dispatch the command (execution item) to all the nodes within the context.DispatcherResult
dispatchToNodes(StepExecutionContext context, NodeStepExecutionItem item)
Dispatch the command (execution item) to all the nodes within the context.NodeExecutorResult
executeCommand(ExecutionContext context, ExecArgList command, INodeEntry node)
Execute a command within the context on the node.NodeExecutorResult
executeCommand(ExecutionContext context, java.lang.String[] command, INodeEntry node)
Execute a command within the context on the node.NodeStepResult
executeNodeStep(StepExecutionContext context, NodeStepExecutionItem item, INodeEntry node)
Interpret the execution item within the context for the given node.StepExecutionResult
executeStep(StepExecutionContext context, StepExecutionItem item)
Execute a workflow step item for the given context and return the result.java.lang.String
fileCopyFile(ExecutionContext context, java.io.File file, INodeEntry node, java.lang.String destinationPath)
Copy file to the node to a specific pathjava.lang.String[]
fileCopyFiles(ExecutionContext context, java.io.File basedir, java.util.List<java.io.File> files, java.lang.String remotePath, INodeEntry node)
Copy multiple files to the node to a specific pathjava.lang.String
fileCopyFileStream(ExecutionContext context, java.io.InputStream input, INodeEntry node, java.lang.String destinationPath)
Copy inputstream as a file to the node to a specific pathjava.lang.String
fileCopyScriptContent(ExecutionContext context, java.lang.String script, INodeEntry node, java.lang.String destinationPath)
Copy string as a file to the node to a specific pathjava.lang.String
getName()
protected WorkflowExecutionListener
getWorkflowListener(ExecutionContext executionContext)
-
-
-
Method Detail
-
getWorkflowListener
protected WorkflowExecutionListener getWorkflowListener(ExecutionContext executionContext)
-
executeStep
public StepExecutionResult executeStep(StepExecutionContext context, StepExecutionItem item) throws StepException
Description copied from interface:ExecutionService
Execute a workflow step item for the given context and return the result.- Specified by:
executeStep
in interfaceExecutionService
- Parameters:
context
- contextitem
- item- Returns:
- not-null result
- Throws:
StepException
- on error
-
executeNodeStep
public NodeStepResult executeNodeStep(StepExecutionContext context, NodeStepExecutionItem item, INodeEntry node) throws NodeStepException
Description copied from interface:ExecutionService
Interpret the execution item within the context for the given node.- Specified by:
executeNodeStep
in interfaceExecutionService
- Parameters:
context
- contextitem
- step itemnode
- node- Returns:
- result
- Throws:
NodeStepException
- on error
-
dispatchToNodes
public DispatcherResult dispatchToNodes(StepExecutionContext context, NodeStepExecutionItem item) throws DispatcherException, ExecutionServiceException
Description copied from interface:ExecutionService
Dispatch the command (execution item) to all the nodes within the context.- Specified by:
dispatchToNodes
in interfaceExecutionService
- Parameters:
context
- contextitem
- step item- Returns:
- result
- Throws:
DispatcherException
- on dispatch errorExecutionServiceException
- on service error
-
dispatchToNodes
public DispatcherResult dispatchToNodes(StepExecutionContext context, Dispatchable item) throws DispatcherException, ExecutionServiceException
Description copied from interface:ExecutionService
Dispatch the command (execution item) to all the nodes within the context.- Specified by:
dispatchToNodes
in interfaceExecutionService
- Parameters:
context
- contextitem
- step item- Returns:
- result
- Throws:
DispatcherException
- on dispatch errorExecutionServiceException
- on service error
-
fileCopyFileStream
public java.lang.String fileCopyFileStream(ExecutionContext context, java.io.InputStream input, INodeEntry node, java.lang.String destinationPath) throws FileCopierException
Description copied from interface:ExecutionService
Copy inputstream as a file to the node to a specific path- Specified by:
fileCopyFileStream
in interfaceExecutionService
- Specified by:
fileCopyFileStream
in interfaceNodeExecutionService
- Parameters:
context
- contextinput
- input streamnode
- nodedestinationPath
- destination path- Returns:
- filepath on the node for the destination file.
- Throws:
FileCopierException
- on error
-
fileCopyFile
public java.lang.String fileCopyFile(ExecutionContext context, java.io.File file, INodeEntry node, java.lang.String destinationPath) throws FileCopierException
Description copied from interface:ExecutionService
Copy file to the node to a specific path- Specified by:
fileCopyFile
in interfaceExecutionService
- Specified by:
fileCopyFile
in interfaceNodeExecutionService
- Parameters:
context
- contextfile
- input filenode
- nodedestinationPath
- destination path- Returns:
- filepath
- Throws:
FileCopierException
- on error
-
fileCopyFiles
public java.lang.String[] fileCopyFiles(ExecutionContext context, java.io.File basedir, java.util.List<java.io.File> files, java.lang.String remotePath, INodeEntry node) throws FileCopierException
Description copied from interface:ExecutionService
Copy multiple files to the node to a specific path- Specified by:
fileCopyFiles
in interfaceExecutionService
- Parameters:
context
- contextbasedir
- base directory for copied filesfiles
- array of input filesremotePath
- remote path destination for filesnode
- node- Returns:
- list of copied paths from the remote node
- Throws:
FileCopierException
- on error
-
fileCopyScriptContent
public java.lang.String fileCopyScriptContent(ExecutionContext context, java.lang.String script, INodeEntry node, java.lang.String destinationPath) throws FileCopierException
Description copied from interface:ExecutionService
Copy string as a file to the node to a specific path- Specified by:
fileCopyScriptContent
in interfaceExecutionService
- Parameters:
context
- contextscript
- script stringnode
- nodedestinationPath
- destination path- Returns:
- filepath for the copied file on the node
- Throws:
FileCopierException
- on error
-
executeCommand
public NodeExecutorResult executeCommand(ExecutionContext context, java.lang.String[] command, INodeEntry node)
Description copied from interface:ExecutionService
Execute a command within the context on the node.- Specified by:
executeCommand
in interfaceExecutionService
- Parameters:
context
- contextcommand
- command stringsnode
- node- Returns:
- result
-
executeCommand
public NodeExecutorResult executeCommand(ExecutionContext context, ExecArgList command, INodeEntry node)
Description copied from interface:ExecutionService
Execute a command within the context on the node.- Specified by:
executeCommand
in interfaceExecutionService
- Specified by:
executeCommand
in interfaceNodeExecutionService
- Parameters:
context
- contextcommand
- commandnode
- node- Returns:
- result
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceFrameworkSupportService
- Returns:
- the name used to identify the service
-
-