public class DataLink extends AbstractCloneable implements Child<Workflow>, Comparable
DataLink
controls the flow of data in a Workflow
.
DataLink
s receive data from a SenderPort
and send the
data to a ReceiverPort
. More than one DataLink
may
receive data from the same SenderPort
and more than one
DataLink
may send data to the same ReceiverPort
.
If more than one DataLink
sends data to the same
ReceiverPort
each DataLink
must specify its merge
position. If only one DataLink
sends data to a
ReceiverPort
and there is no merge then the merge position must
be set to null
.
AbstractCloneable.Cloning, AbstractCloneable.CopyVisitor
Constructor and Description |
---|
DataLink()
Constructs an unconnected
DataLink . |
DataLink(Workflow parent,
SenderPort senderPort,
ReceiverPort receiverPort)
Constructs a
DataLink with the specified parent
Workflow that connects the specified SenderPort and
ReceiverPort . |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Visitor visitor)
Accepts a
Visitor to this WorkflowBean . |
protected void |
cloneInto(WorkflowBean clone,
AbstractCloneable.Cloning cloning) |
int |
compareTo(Object other) |
boolean |
equals(Object obj) |
Collection<Annotation> |
getAnnotations()
Get all the annotations that pertain to this datalink.
|
Integer |
getMergePosition()
Returns the position that this
DataLink should join a merge. |
Workflow |
getParent()
Returns the parent
Workflow of null if this
DataLink is an orphan. |
SenderPort |
getReceivesFrom()
Returns the
SenderPort that this DataLink
receives data from. |
URI |
getRelativeURI(WorkflowBean relativeTo)
Get the URI of this datalink relative to another workflow element.
|
ReceiverPort |
getSendsTo()
Returns the
ReceiverPort that this DataLink
sends data to. |
URI |
getURI()
Get the URI of this datalink.
|
int |
hashCode() |
void |
setMergePosition(Integer mergePosition)
Sets the position that this
DataLink should join a merge. |
void |
setParent(Workflow parent)
Sets the parent of this workflow bean.
|
void |
setReceivesFrom(SenderPort receivesFrom)
Returns the
SenderPort that this DataLink
receives data from. |
void |
setSendsTo(ReceiverPort sendsTo)
Sets the
ReceiverPort that this DataLink sends
data to. |
String |
toString() |
clone, cloneWorkflowBean, getTools, getUriTools
finalize, getClass, notify, notifyAll, wait, wait, wait
clone
public DataLink()
DataLink
.public DataLink(Workflow parent, SenderPort senderPort, ReceiverPort receiverPort)
DataLink
with the specified parent
Workflow
that connects the specified SenderPort
and
ReceiverPort
.parent
- the Workflow
to set as the DataLink
's parent. Can be null
.senderPort
- the SenderPort
that the DataLink
receives data from. Can be null
.receiverPort
- the ReceiverPort
that the DataLink
sends data to. Can be null
.public boolean accept(Visitor visitor)
WorkflowBean
Visitor
to this WorkflowBean
.accept
in interface WorkflowBean
visitor
- the Visitor
to accepttrue
if this WorkflowBeans
children
should be visited.public int compareTo(Object other)
compareTo
in interface Comparable
public Integer getMergePosition()
DataLink
should join a merge.
If there is no merge then the value must be null
.
When more than one DataLink
sends the data to the same
ReceiverPort
then each DataLink
must specify its
merge position. Merge positions must be sequential staring from zero.
For a merge with only one DataLink
input the merge position
is zero.
DataLink
should join a mergepublic Workflow getParent()
Workflow
of null if this
DataLink
is an orphan.public SenderPort getReceivesFrom()
SenderPort
that this DataLink
receives data from.SenderPort
that this DataLink
receives data frompublic ReceiverPort getSendsTo()
ReceiverPort
that this DataLink
sends data to.ReceiverPort
that this DataLink
sends data topublic void setMergePosition(Integer mergePosition)
DataLink
should join a merge.
If there is no merge then the value must be set to null
.
When more than one DataLink
sends the data to the same
ReceiverPort
then each DataLink
must specify its
merge position. Merge positions must be sequential staring from zero.
For a merge with only one DataLink
input the merge position
is set to zero.
mergePosition
- the position that this DataLink
should join a
merge. Can be null.public void setParent(Workflow parent)
Child
Setting the parent would normally also add the object to the relevant collection in the parent if it does not already exist there.
If the child has an existing, object-identity different parent, the child will first be removed from the parent collection if it exists there.
Note:If the child is Named
the parent collection
will be a NamedSet
. This implicit insertion would overwrite any
conflicting sibling with the same Named.getName()
- to avoid
this, add the child to the parent collection by using
NamedSet.addWithUniqueName(Named)
before setting the parent.
public void setReceivesFrom(SenderPort receivesFrom)
SenderPort
that this DataLink
receives data from.receivesFrom
- the SenderPort
that this DataLink
receives data frompublic void setSendsTo(ReceiverPort sendsTo)
ReceiverPort
that this DataLink
sends
data to.sendsTo
- the ReceiverPort
that this DataLink
sends data toprotected void cloneInto(WorkflowBean clone, AbstractCloneable.Cloning cloning)
cloneInto
in class AbstractCloneable
public Collection<Annotation> getAnnotations()
Scufl2Tools.annotationsFor(Child)
public URI getURI()
URITools.uriForBean(WorkflowBean)
public URI getRelativeURI(WorkflowBean relativeTo)
URITools#relativeUriForBean(WorkflowBean,WorflowBean)
Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.