public class FlowDef extends UnitOfWorkDef<FlowDef>
Flow
.
This allows for ad-hoc building of Flow data and meta-data, like tags.
Instead of calling one of the FlowConnector
connect methods, FlowConnector.connect(FlowDef)
can be called.Modifier and Type | Field and Description |
---|---|
protected List<AssemblyPlanner> |
assemblyPlanners |
protected AssertionLevel |
assertionLevel |
protected Map<String,Tap> |
checkpoints |
protected List<String> |
classPath |
protected DebugLevel |
debugLevel |
protected HashMap<String,String> |
flowDescriptor |
protected String |
runID |
protected Map<String,Tap> |
sinks |
protected Map<String,Tap> |
sources |
protected List<Pipe> |
tails |
protected Map<String,Tap> |
traps |
name, tags
Modifier | Constructor and Description |
---|---|
|
FlowDef()
Constructor FlowDef creates a new FlowDef instance.
|
protected |
FlowDef(FlowDef flowDef,
Map<String,Tap> sources,
Map<String,Tap> sinks,
Map<String,Tap> traps,
Map<String,Tap> checkpoints) |
Modifier and Type | Method and Description |
---|---|
FlowDef |
addAssemblyPlanner(AssemblyPlanner assemblyPlanner)
Method addAssemblyPlanner adds new AssemblyPlanner instances to be evaluated.
|
FlowDef |
addCheckpoint(Checkpoint pipe,
Tap checkpoint)
Method addCheckpoint adds a new checkpoint
Tap named after the given Checkpoint for use in the resulting Flow . |
FlowDef |
addCheckpoint(String name,
Tap checkpoint)
|
FlowDef |
addCheckpoints(Map<String,Tap> checkpoints)
Method addCheckpoints adds a Map of the names and
Tap pairs. |
FlowDef |
addDescription(String description)
Method addDescription adds a user readable description to the flowDescriptor.
|
FlowDef |
addDescription(String key,
String value)
Method addDescription adds a description to the flowDescriptor.
|
FlowDef |
addDescriptions(Map<String,String> descriptions)
Method addProperties adds all properties in the given map in order to the flowDescriptor.
|
FlowDef |
addSink(Pipe tail,
Tap sink)
|
FlowDef |
addSink(String name,
Tap sink)
|
FlowDef |
addSinks(Map<String,Tap> sinks)
Method addSinks adds a Map of the named and
Tap pairs. |
FlowDef |
addSource(Pipe pipe,
Tap source)
|
FlowDef |
addSource(String name,
Tap source)
|
FlowDef |
addSources(Map<String,Tap> sources)
Method addSources adds a map of name and
Tap pairs. |
FlowDef |
addTail(Pipe tail)
Method addTail adds a new
Pipe to this FlowDef that represents a tail in a pipe assembly. |
FlowDef |
addTails(Collection<Pipe> tails)
Method addTails adds a Collection of tails.
|
FlowDef |
addTails(Pipe... tails)
Method addTails adds an array of tails.
|
FlowDef |
addTailSink(Pipe tail,
Tap sink)
|
FlowDef |
addToClassPath(String artifact)
Adds each given artifact to the classpath the assembly will execute under allowing
Operator s to dynamically load classes and resources from a ClassLoader . |
FlowDef |
addTrap(Pipe pipe,
Tap trap)
|
FlowDef |
addTrap(String name,
Tap trap)
|
FlowDef |
addTraps(Map<String,Tap> traps)
Method addTraps adds a Map of the names and
Tap pairs. |
static FlowDef |
flowDef()
Creates a new instance of a FlowDef.
|
List<AssemblyPlanner> |
getAssemblyPlanners()
Method getAssemblyPlanners returns the current registered AssemblyPlanners.
|
AssertionLevel |
getAssertionLevel() |
Map<String,Tap> |
getCheckpoints()
Method getCheckpoints returns the checkpoint taps of this FlowDef object.
|
Map<String,Tap> |
getCheckpointsCopy()
Method getCheckpointsCopy returns a copy of the checkpoint tap Map.
|
List<String> |
getClassPath() |
DebugLevel |
getDebugLevel() |
HashMap<String,String> |
getFlowDescriptor()
Method getFlowDescriptor returns the flowDescriptor of this FlowDef.
|
String |
getRunID() |
Map<String,Tap> |
getSinks()
Method getSinks returns the sinks of this FlowDef object.
|
Map<String,Tap> |
getSinksCopy()
Method getSinksCopy returns a copy of the sink Map.
|
Map<String,Tap> |
getSources()
Method getSources returns the sources of this FlowDef object.
|
Map<String,Tap> |
getSourcesCopy()
Method getSourcesCopy returns a copy of the sources Map.
|
List<Pipe> |
getTails()
Method getTails returns all the current pipe assembly tails the FlowDef holds.
|
Pipe[] |
getTailsArray()
Method getTailsArray returns all the current pipe assembly tails the FlowDef holds.
|
Map<String,Tap> |
getTraps()
Method getTraps returns the traps of this FlowDef object.
|
Map<String,Tap> |
getTrapsCopy()
Method getTrapsCopy returns a copy of the trap Map.
|
FlowDef |
setAssertionLevel(AssertionLevel assertionLevel) |
FlowDef |
setDebugLevel(DebugLevel debugLevel) |
FlowDef |
setRunID(String runID)
Method setRunID sets the checkpoint run or execution ID to be used to find prior failed runs against
this runID.
|
protected Map<String,Tap> checkpoints
protected List<AssemblyPlanner> assemblyPlanners
protected HashMap<String,String> flowDescriptor
protected AssertionLevel assertionLevel
protected DebugLevel debugLevel
public FlowDef()
public List<AssemblyPlanner> getAssemblyPlanners()
public FlowDef addAssemblyPlanner(AssemblyPlanner assemblyPlanner)
assemblyPlanner
- of type AssemblyPlannerpublic Map<String,Tap> getSources()
public Map<String,Tap> getSourcesCopy()
public HashMap<String,String> getFlowDescriptor()
public FlowDef addSource(String name, Tap source)
name
- of Stringsource
- of Tappublic FlowDef addSource(Pipe pipe, Tap source)
Tap
named after the given Pipe
for use in the resulting Flow
.
If the given pipe is not a head pipe, it will be resolved. If more than one is found, an
IllegalArgumentException
will be thrown.pipe
- of Pipesource
- of Tappublic FlowDef addSources(Map<String,Tap> sources)
Tap
pairs.sources
- of Mappublic FlowDef addDescription(String description)
FlowDescriptors.DESCRIPTION
key.public FlowDef addDescription(String key, String value)
FlowDescriptors
.
If an existing key exists, it will be appended to the original value using
FlowDescriptors.VALUE_SEPARATOR
.key
- The key as a String.value
- The value as a String.public FlowDef addDescriptions(Map<String,String> descriptions)
FlowDescriptors
.descriptions
- The properties to be added to the map.public Map<String,Tap> getSinks()
public Map<String,Tap> getSinksCopy()
public FlowDef addSink(String name, Tap sink)
name
- of Stringsink
- of Tappublic FlowDef addSink(Pipe tail, Tap sink)
tail
- of Pipesink
- of Tappublic FlowDef addTailSink(Pipe tail, Tap sink)
Pipe
and sink Tap
to this FlowDef.
This is a convenience method for adding both a tail and sink simultaneously. There isn't a similar method
for heads and sources as the head Pipe can always be derived.tail
- of Pipesink
- of Tappublic FlowDef addSinks(Map<String,Tap> sinks)
Tap
pairs.sinks
- of Mappublic Map<String,Tap> getTraps()
public Map<String,Tap> getTrapsCopy()
public FlowDef addTrap(String name, Tap trap)
name
- of Stringtrap
- of Tappublic FlowDef addTrap(Pipe pipe, Tap trap)
pipe
- of Pipetrap
- of Tappublic FlowDef addTraps(Map<String,Tap> traps)
Tap
pairs.traps
- of Mappublic Map<String,Tap> getCheckpoints()
public Map<String,Tap> getCheckpointsCopy()
public FlowDef addCheckpoint(String name, Tap checkpoint)
name
- of Stringcheckpoint
- of Tappublic FlowDef addCheckpoint(Checkpoint pipe, Tap checkpoint)
Tap
named after the given Checkpoint
for use in the resulting Flow
.pipe
- of Pipecheckpoint
- of Tappublic FlowDef addCheckpoints(Map<String,Tap> checkpoints)
Tap
pairs.checkpoints
- of Mappublic List<Pipe> getTails()
public Pipe[] getTailsArray()
public FlowDef addTail(Pipe tail)
Pipe
to this FlowDef that represents a tail in a pipe assembly.
Be sure to add a sink tap that has the same name as this tail.tail
- of Pipepublic FlowDef addTails(Collection<Pipe> tails)
tails
- of Collectionpublic FlowDef addTails(Pipe... tails)
tails
- of Pipe...public FlowDef setAssertionLevel(AssertionLevel assertionLevel)
public AssertionLevel getAssertionLevel()
public FlowDef setDebugLevel(DebugLevel debugLevel)
public DebugLevel getDebugLevel()
public FlowDef setRunID(String runID)
Flow
fails to execute, a subsequent attempt to run the same Flow with the same
runID will allow the Flow instance to start where it left off.
Not all planners support this feature.
A Flow name is required when using a runID.runID
- of type Stringpublic List<String> getClassPath()
public FlowDef addToClassPath(String artifact)
Operator
s to dynamically load classes and resources from a ClassLoader
.artifact
- a jar or other file String pathCopyright © 2007-2015 Concurrent, Inc. All Rights Reserved.