Package com.attivio.sdk.esb
Class WorkflowQueue
- java.lang.Object
-
- com.attivio.sdk.esb.WorkflowQueue
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.String>
public class WorkflowQueue extends java.lang.Object implements java.lang.Iterable<java.lang.String>, java.lang.Cloneable, java.io.SerializableWorkflowQueues model the message flow for their associated message.A queue has an ordered list of workflow names to execute as well as flags to indicate when and how that routing should occur. After each component finishes processing an input message, the contents of the WorfklowQueue are part of the information used to determine where the message will go next. If the routeImmediately flag is set the head of the queue determines the next destination for the message. If this flag is not set, then message will be routed to the next component in the current workflow. If there are no more components in the workflow, then the head of the workflow queue is used.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_ROUTE_IMMEDIATELYDefault value for route immediately
-
Constructor Summary
Constructors Constructor Description WorkflowQueue(boolean routeImmediately, java.lang.String... wfs)Constructor.WorkflowQueue(java.lang.String... wfs)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(java.lang.String... wfs)Adds an ordered list of workflows to the end of this queue.WorkflowQueueclone()booleancontains(java.lang.String destination)True is this queue already contains the destination provided.booleanequals(java.lang.Object o)Checks for equal based on routing flags and workflow names.java.lang.Stringget(int position)java.lang.StringgetFirst()Gets but does not remove the first entry from the workflow list.inthashCode()voidinsert(java.lang.String wf, int position)Adds the workflowwfto the queue at the specifiedposition.booleanisRemote()Indicates that the list of workflows will cause the system to be routed off the current node node.booleanisRouteImmediately()booleanisSameWorkflowOrder(WorkflowQueue queue)Determines if the passed in WorkflowQueue has the same workflows in the same order as this.java.util.Iterator<java.lang.String>iterator()Gets an iterator that iterates over all the workflows in the queue.voidprepend(WorkflowQueue wfq)adds all the workflows inwfqto the start of our queuevoidprepend(java.lang.String wf)Adds a new workflow to the start of this queue.booleanremove(java.lang.String wf)Removes the first occurrence a specific workflow from this queue.java.lang.StringremoveFirst()Gets and removes the first entry from the queue.java.lang.Stringreplace(int position, java.lang.String s)voidsetRemote(boolean remote)voidsetRouteImmediately(boolean routeImmediately)Sets the 'route immediately' flag.intsize()Gets the size of the queue.java.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT_ROUTE_IMMEDIATELY
public static final boolean DEFAULT_ROUTE_IMMEDIATELY
Default value for route immediately- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WorkflowQueue
public WorkflowQueue(java.lang.String... wfs)
Constructor. Creates a queue based on a given set of workflow names.- Parameters:
wfs- the workflow names
-
WorkflowQueue
public WorkflowQueue(boolean routeImmediately, java.lang.String... wfs)Constructor. Creates a queue based on a given set of workflow names.- Parameters:
routeImmediately-wfs- the workflow names
-
-
Method Detail
-
append
public void append(java.lang.String... wfs)
Adds an ordered list of workflows to the end of this queue.Performs basic checking for null and empty string workflow names.
- Parameters:
wfs- the workflows
-
insert
public void insert(java.lang.String wf, int position)Adds the workflowwfto the queue at the specifiedposition.- Parameters:
wf-position- where to insert thewf. if invalid, thewfis added at the end.
-
removeFirst
public java.lang.String removeFirst()
Gets and removes the first entry from the queue.- Returns:
- the first entry
-
prepend
public void prepend(java.lang.String wf)
Adds a new workflow to the start of this queue.- Parameters:
wf- the workflow to add
-
remove
public boolean remove(java.lang.String wf)
Removes the first occurrence a specific workflow from this queue.- Parameters:
wf- the workflow to remove- Returns:
- true if successfully removed
-
getFirst
public java.lang.String getFirst()
Gets but does not remove the first entry from the workflow list.- Returns:
- the first entry
-
iterator
public java.util.Iterator<java.lang.String> iterator()
Gets an iterator that iterates over all the workflows in the queue.- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.String>- Returns:
- the iterator
-
size
public int size()
Gets the size of the queue.- Returns:
- the size
-
isRouteImmediately
public boolean isRouteImmediately()
-
setRouteImmediately
public void setRouteImmediately(boolean routeImmediately)
Sets the 'route immediately' flag.- Parameters:
routeImmediately- the route immediately flag
-
equals
public boolean equals(java.lang.Object o)
Checks for equal based on routing flags and workflow names.- Overrides:
equalsin classjava.lang.Object
-
isSameWorkflowOrder
public boolean isSameWorkflowOrder(WorkflowQueue queue)
Determines if the passed in WorkflowQueue has the same workflows in the same order as this.- Parameters:
queue- the workflow queue- Returns:
- true if the workflow queue has the same workflows in the same order
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
clone
public WorkflowQueue clone()
- Overrides:
clonein classjava.lang.Object
-
prepend
public void prepend(WorkflowQueue wfq)
adds all the workflows inwfqto the start of our queue- Parameters:
wfq-
-
isRemote
public boolean isRemote()
Indicates that the list of workflows will cause the system to be routed off the current node node. This should not be an authoritative source of information for the negative case. It is only useful for the positive case and generally set by features that generate complex configurations that are known to route messages off node.
-
setRemote
public void setRemote(boolean remote)
-
get
public java.lang.String get(int position)
-
replace
public java.lang.String replace(int position, java.lang.String s)
-
contains
public boolean contains(java.lang.String destination)
True is this queue already contains the destination provided.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-