@Component public class FlowManagerImpl extends com.marklogic.client.ext.helper.LoggingObject implements FlowManager
FLOW_FILE_EXTENSION
Constructor and Description |
---|
FlowManagerImpl() |
FlowManagerImpl(com.marklogic.hub.HubClient hubClient) |
FlowManagerImpl(HubConfig hubConfig) |
FlowManagerImpl(HubConfig hubConfig,
MappingManager mappingManager) |
FlowManagerImpl(HubConfig hubConfig,
MappingManager mappingManager,
StepDefinitionManager stepDefinitionManager) |
Modifier and Type | Method and Description |
---|---|
org.apache.commons.lang3.tuple.Pair<java.io.File,java.lang.String> |
addStepToFlow(java.lang.String flowName,
java.lang.String stepName,
java.lang.String stepType) |
Flow |
createFlow(java.lang.String flowName)
Creates a flow
|
Flow |
createFlowFromJSON(com.fasterxml.jackson.databind.JsonNode json)
Creates a flow from a given JsonNode
|
Flow |
createFlowFromJSON(java.lang.String json)
Creates a flow from a given JSON string
|
protected void |
deleteDocumentsInDirectory(java.lang.String directory) |
void |
deleteFlow(java.lang.String flowName)
Deletes a flow
|
protected void |
deleteMappingArtifacts(Flow flow,
Step removedStep) |
protected void |
deleteRelatedStepArtifacts(Flow flow,
Step removedStep)
For certain step types, when the step is deleted, we need to do some cleanup of artifacts on disk and in the
staging and final databases.
|
void |
deleteStep(Flow flow,
java.lang.String key) |
protected void |
deleteStepDefinitionArtifacts(Step removedStep,
StepDefinition.StepDefinitionType stepTypeOfRemovedStep) |
protected ArtifactService |
getArtifactService() |
java.io.File |
getFileForLocalFlow(java.lang.String flowName) |
Flow |
getFlow(java.lang.String flowName)
Retrieves a named flow on the MarkLogic server
|
java.lang.String |
getFlowAsJSON(java.lang.String flowName)
Returns a flow based on the provided name as JSON string
|
java.util.List<java.lang.String> |
getFlowNames()
Retrieves a list of names of flows installed on the MarkLogic server
|
java.util.List<Flow> |
getFlows()
Retrieves a list of flows installed on the MarkLogic server
|
protected FlowService |
getFlowService() |
Flow |
getFullFlow(java.lang.String flowName)
Retrieves the expanded flow document with properties from artifact and settings
|
Flow |
getLocalFlow(java.lang.String flowName)
Retrieves a named flow from the Data Hub project
|
com.fasterxml.jackson.databind.node.ObjectNode |
getLocalFlowAsJSON(java.lang.String flowName) |
java.util.List<java.lang.String> |
getLocalFlowNames()
Retrieves a list of names of flows in the local project
|
java.util.List<Flow> |
getLocalFlows()
Retrieves a list of flows in a Data Hub project
|
java.util.List<com.fasterxml.jackson.databind.node.ObjectNode> |
getLocalFlowsAsJSON()
Retrieves a list of flows in a Data Hub project
|
Step |
getStep(Flow flow,
java.lang.String stepNum)
Deprecated.
|
java.util.Map<java.lang.String,Step> |
getSteps(Flow flow)
Deprecated.
|
protected boolean |
isCustomMapping(Step removedStep) |
boolean |
isFlowExisted(java.lang.String flowName)
Check if a flow has existed
|
protected boolean |
mappingIsReferencedByAFlow(Step removedStep) |
static Step |
removeStepFromFlow(Flow flow,
java.lang.String key)
Extracted for reuse in HubCentral
|
void |
saveFlow(Flow flow)
Saves a flow to project structure and MarkLogic instance
|
void |
saveLocalFlow(Flow flow)
Saves a flow to project structure
|
void |
setHubConfig(HubConfig hubConfig)
Set the HubConfig
|
void |
setSteps(Flow flow,
java.util.Map<java.lang.String,Step> stepMap)
Deprecated.
|
protected boolean |
stepIsReferencedByAFlow(java.lang.String stepName,
StepDefinition.StepDefinitionType stepType) |
public FlowManagerImpl()
public FlowManagerImpl(HubConfig hubConfig)
public FlowManagerImpl(com.marklogic.hub.HubClient hubClient)
public FlowManagerImpl(HubConfig hubConfig, MappingManager mappingManager)
public FlowManagerImpl(HubConfig hubConfig, MappingManager mappingManager, StepDefinitionManager stepDefinitionManager)
public void setHubConfig(HubConfig hubConfig)
FlowManager
setHubConfig
in interface FlowManager
hubConfig
- - the hubConfig to usepublic Flow getFlow(java.lang.String flowName)
FlowManager
getFlow
in interface FlowManager
flowName
- - name of the flowpublic Flow getLocalFlow(java.lang.String flowName)
FlowManager
getLocalFlow
in interface FlowManager
flowName
- - name of the flowpublic com.fasterxml.jackson.databind.node.ObjectNode getLocalFlowAsJSON(java.lang.String flowName)
public Flow getFullFlow(java.lang.String flowName)
FlowManager
getFullFlow
in interface FlowManager
flowName
- - name of the flowpublic java.lang.String getFlowAsJSON(java.lang.String flowName)
FlowManager
getFlowAsJSON
in interface FlowManager
flowName
- - name of the flowpublic java.util.List<Flow> getFlows()
FlowManager
getFlows
in interface FlowManager
public java.util.List<java.lang.String> getLocalFlowNames()
FlowManager
getLocalFlowNames
in interface FlowManager
public java.util.List<java.lang.String> getFlowNames()
FlowManager
getFlowNames
in interface FlowManager
public Flow createFlow(java.lang.String flowName)
FlowManager
createFlow
in interface FlowManager
flowName
- - name of the flowpublic Flow createFlowFromJSON(java.lang.String json)
FlowManager
createFlowFromJSON
in interface FlowManager
json
- - string representation of the flowpublic Flow createFlowFromJSON(com.fasterxml.jackson.databind.JsonNode json)
FlowManager
createFlowFromJSON
in interface FlowManager
json
- - JsonNode representation of the flowpublic void deleteFlow(java.lang.String flowName)
FlowManager
deleteFlow
in interface FlowManager
flowName
- - name of the flowpublic void deleteStep(Flow flow, java.lang.String key)
deleteStep
in interface FlowManager
key
- the step map key corresponding to the step to deletepublic static Step removeStepFromFlow(Flow flow, java.lang.String key)
flow
- key
- public void saveLocalFlow(Flow flow)
FlowManager
saveLocalFlow
in interface FlowManager
flow
- - the flow object to be savedpublic java.io.File getFileForLocalFlow(java.lang.String flowName)
public void saveFlow(Flow flow)
FlowManager
saveFlow
in interface FlowManager
flow
- - the flow object to be savedpublic org.apache.commons.lang3.tuple.Pair<java.io.File,java.lang.String> addStepToFlow(java.lang.String flowName, java.lang.String stepName, java.lang.String stepType)
public boolean isFlowExisted(java.lang.String flowName)
FlowManager
isFlowExisted
in interface FlowManager
flowName
- a flow nameprotected ArtifactService getArtifactService()
protected FlowService getFlowService()
@Deprecated public java.util.Map<java.lang.String,Step> getSteps(Flow flow)
FlowManager
getSteps
in interface FlowManager
flow
- a flow object@Deprecated public Step getStep(Flow flow, java.lang.String stepNum)
FlowManager
getStep
in interface FlowManager
flow
- a flow objectstepNum
- step key@Deprecated public void setSteps(Flow flow, java.util.Map<java.lang.String,Step> stepMap)
FlowManager
setSteps
in interface FlowManager
flow
- a flow objectstepMap
- a map of stepsprotected void deleteRelatedStepArtifacts(Flow flow, Step removedStep)
flow
- removedStep
- protected boolean stepIsReferencedByAFlow(java.lang.String stepName, StepDefinition.StepDefinitionType stepType)
stepName
- stepType
- protected boolean mappingIsReferencedByAFlow(Step removedStep)
removedStep
- protected boolean isCustomMapping(Step removedStep)
protected void deleteStepDefinitionArtifacts(Step removedStep, StepDefinition.StepDefinitionType stepTypeOfRemovedStep)
protected void deleteDocumentsInDirectory(java.lang.String directory)
public java.util.List<Flow> getLocalFlows()
FlowManager
getLocalFlows
in interface FlowManager
public java.util.List<com.fasterxml.jackson.databind.node.ObjectNode> getLocalFlowsAsJSON()
FlowManager
getLocalFlowsAsJSON
in interface FlowManager