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.Serializable
WorkflowQueues 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 boolean
DEFAULT_ROUTE_IMMEDIATELY
Default 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 void
append(java.lang.String... wfs)
Adds an ordered list of workflows to the end of this queue.WorkflowQueue
clone()
boolean
contains(java.lang.String destination)
True is this queue already contains the destination provided.boolean
equals(java.lang.Object o)
Checks for equal based on routing flags and workflow names.java.lang.String
get(int position)
java.lang.String
getFirst()
Gets but does not remove the first entry from the workflow list.int
hashCode()
void
insert(java.lang.String wf, int position)
Adds the workflowwf
to the queue at the specifiedposition
.boolean
isRemote()
Indicates that the list of workflows will cause the system to be routed off the current node node.boolean
isRouteImmediately()
boolean
isSameWorkflowOrder(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.void
prepend(WorkflowQueue wfq)
adds all the workflows inwfq
to the start of our queuevoid
prepend(java.lang.String wf)
Adds a new workflow to the start of this queue.boolean
remove(java.lang.String wf)
Removes the first occurrence a specific workflow from this queue.java.lang.String
removeFirst()
Gets and removes the first entry from the queue.java.lang.String
replace(int position, java.lang.String s)
void
setRemote(boolean remote)
void
setRouteImmediately(boolean routeImmediately)
Sets the 'route immediately' flag.int
size()
Gets the size of the queue.java.lang.String
toString()
-
-
-
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 workflowwf
to the queue at the specifiedposition
.- Parameters:
wf
-position
- where to insert thewf
. if invalid, thewf
is 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:
iterator
in 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:
equals
in 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:
hashCode
in classjava.lang.Object
-
clone
public WorkflowQueue clone()
- Overrides:
clone
in classjava.lang.Object
-
prepend
public void prepend(WorkflowQueue wfq)
adds all the workflows inwfq
to 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:
toString
in classjava.lang.Object
-
-