@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(HubConfig hubConfig)
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(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 |
copyJobDataToResponse(RunFlowResponse response,
RunFlowResponse jobDocument) |
HubConfig |
getHubConfig() |
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 |
setFlowManager(FlowManager flowManager) |
void |
setHubConfig(HubConfig hubConfig) |
void |
setStepRunnerFactory(StepRunnerFactory stepRunnerFactory) |
void |
stopJob(java.lang.String jobId)
Runs the flow.
|
public FlowRunnerImpl()
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(HubConfig 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)
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()
public void setHubConfig(HubConfig hubConfig)
public void setStepRunnerFactory(StepRunnerFactory stepRunnerFactory)
public void setFlowManager(FlowManager flowManager)
public HubConfig getHubConfig()