@Component public class FlowRunnerImpl extends java.lang.Object implements FlowRunner
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
FlowRunnerImpl() |
FlowRunnerImpl(com.marklogic.hub.HubClient hubClient)
Constructs a FlowRunnerImpl that can be used for running flows without any reference to project files on a
filesystem - and thus, this constructor will not instantiate an instance of FlowManager, which is used for reading
project files from the filesystem.
|
FlowRunnerImpl(HubConfig hubConfig)
Deprecated.
|
FlowRunnerImpl(HubConfig hubConfig,
FlowManager flowManager)
Simulates construction of this object via Spring, where the Autowired objects are set manually.
|
FlowRunnerImpl(java.lang.String host,
java.lang.String username,
java.lang.String password)
Convenience constructor for running flows with no dependency on project files on the filesystem, and where a
user can authenticate with just a username and a password.
|
Modifier and Type | Method and Description |
---|---|
void |
awaitCompletion()
Blocks until the flow execution is complete.
|
void |
awaitCompletion(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until the flow execution is complete.
|
protected void |
configureStopOnError(Flow flow,
java.util.Map<java.lang.String,java.lang.Object> options)
To support the "failHard" parameter in CommandLineFlowInputs, this method checks for stopOnError in the options
map.
|
protected void |
copyJobDataToResponse(RunFlowResponse response,
RunFlowResponse jobDocument) |
RunFlowResponse |
getJobResponseById(java.lang.String jobId) |
java.util.List<java.lang.String> |
getQueuedJobIdsFromFlow(java.lang.String flowName) |
Flow |
getRunningFlow() |
java.lang.String |
getRunningStepKey() |
boolean |
isJobRunning() |
FlowRunner |
onStatusChanged(FlowStatusListener listener)
Sets the status change listener on the flowrunner object
|
RunFlowResponse |
runFlow(FlowInputs flowInputs)
Retrieves the given flow from the staging database in MarkLogic, and then proceeds with the normal execution of
the flow.
|
protected RunFlowResponse |
runFlow(Flow flow,
java.util.List<java.lang.String> stepNums,
java.lang.String jobId,
java.util.Map<java.lang.String,java.lang.Object> options,
java.util.Map<java.lang.String,java.lang.Object> stepConfig) |
RunFlowResponse |
runFlow(java.lang.String flowName)
Deprecated.
|
RunFlowResponse |
runFlow(java.lang.String flowName,
java.util.List<java.lang.String> stepNums)
Deprecated.
|
RunFlowResponse |
runFlow(java.lang.String flowName,
java.util.List<java.lang.String> stepNums,
java.lang.String jobId)
Deprecated.
|
RunFlowResponse |
runFlow(java.lang.String flowName,
java.util.List<java.lang.String> stepNums,
java.lang.String jobId,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
|
RunFlowResponse |
runFlow(java.lang.String flowName,
java.util.List<java.lang.String> stepNums,
java.lang.String jobId,
java.util.Map<java.lang.String,java.lang.Object> options,
java.util.Map<java.lang.String,java.lang.Object> stepConfig)
Deprecated.
|
RunFlowResponse |
runFlow(java.lang.String flowName,
java.lang.String jobId)
Deprecated.
|
RunFlowResponse |
runFlow(java.lang.String flowName,
java.lang.String jobId,
java.util.Map<java.lang.String,java.lang.Object> options)
Deprecated.
|
void |
stopJob(java.lang.String jobId)
Runs the flow.
|
public FlowRunnerImpl()
public FlowRunnerImpl(HubConfig hubConfig, FlowManager flowManager)
hubConfig
- flowManager
- public FlowRunnerImpl(java.lang.String host, java.lang.String username, java.lang.String password)
host
- the host of the Data Hub instance to connect tousername
- the username of the MarkLogic user for running a flowpassword
- the password of the MarkLogic user for running a flowpublic FlowRunnerImpl(com.marklogic.hub.HubClient hubClient)
hubClient
- @Deprecated public FlowRunnerImpl(HubConfig hubConfig)
public FlowRunner onStatusChanged(FlowStatusListener listener)
FlowRunner
onStatusChanged
in interface FlowRunner
listener
- - the listener for when the status changes@Deprecated public RunFlowResponse runFlow(java.lang.String flowName)
FlowRunner
runFlow
in interface FlowRunner
flowName
- the flow to run@Deprecated public RunFlowResponse runFlow(java.lang.String flowName, java.util.List<java.lang.String> stepNums)
FlowRunner
runFlow
in interface FlowRunner
flowName
- the flow to runstepNums
- the steps in the flow to run@Deprecated public RunFlowResponse runFlow(java.lang.String flowName, java.lang.String jobId)
FlowRunner
runFlow
in interface FlowRunner
flowName
- the flow to runjobId
- the jobid to be used for the flow@Deprecated public RunFlowResponse runFlow(java.lang.String flowName, java.util.List<java.lang.String> stepNums, java.lang.String jobId)
FlowRunner
runFlow
in interface FlowRunner
flowName
- the flow to runstepNums
- the steps in the flow to runjobId
- the jobid to be used for the flow@Deprecated public RunFlowResponse runFlow(java.lang.String flowName, java.lang.String jobId, java.util.Map<java.lang.String,java.lang.Object> options)
FlowRunner
runFlow
in interface FlowRunner
flowName
- the flow to runjobId
- the jobid to be used for the flowoptions
- the key/value options to be passed@Deprecated public RunFlowResponse runFlow(java.lang.String flowName, java.util.List<java.lang.String> stepNums, java.lang.String jobId, java.util.Map<java.lang.String,java.lang.Object> options)
FlowRunner
runFlow
in interface FlowRunner
flowName
- the flow to runstepNums
- the steps in the flow to runjobId
- the jobid to be used for the flowoptions
- the key/value options to be passed@Deprecated public RunFlowResponse runFlow(java.lang.String flowName, java.util.List<java.lang.String> stepNums, java.lang.String jobId, java.util.Map<java.lang.String,java.lang.Object> options, java.util.Map<java.lang.String,java.lang.Object> stepConfig)
FlowRunner
runFlow
in interface FlowRunner
flowName
- the flow to runstepNums
- the steps in the flow to runjobId
- the jobid to be used for the flowoptions
- the key/value options to be passedstepConfig
- the key/value config to override the running of the steppublic RunFlowResponse runFlow(FlowInputs flowInputs)
runFlow
in interface FlowRunner
flowInputs
- protected RunFlowResponse runFlow(Flow flow, java.util.List<java.lang.String> stepNums, java.lang.String jobId, java.util.Map<java.lang.String,java.lang.Object> options, java.util.Map<java.lang.String,java.lang.Object> stepConfig)
protected void configureStopOnError(Flow flow, java.util.Map<java.lang.String,java.lang.Object> options)
flow
- options
- public void stopJob(java.lang.String jobId)
FlowRunner
stopJob
in interface FlowRunner
jobId
- the id of the running flowprotected void copyJobDataToResponse(RunFlowResponse response, RunFlowResponse jobDocument)
public void awaitCompletion()
FlowRunner
awaitCompletion
in interface FlowRunner
public void awaitCompletion(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
FlowRunner
awaitCompletion
in interface FlowRunner
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentjava.lang.InterruptedException
- if interrupted while waitingpublic java.util.List<java.lang.String> getQueuedJobIdsFromFlow(java.lang.String flowName)
public RunFlowResponse getJobResponseById(java.lang.String jobId)
public boolean isJobRunning()
public java.lang.String getRunningStepKey()
public Flow getRunningFlow()