public class WorkflowQueue extends Object implements Iterable<String>, Cloneable, 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.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ROUTE_IMMEDIATELY
Default value for route immediately
|
Constructor and Description |
---|
WorkflowQueue(boolean routeImmediately,
String... wfs)
Constructor.
|
WorkflowQueue(String... wfs)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
append(String... wfs)
Adds an ordered list of workflows to the end of this queue.
|
WorkflowQueue |
clone() |
boolean |
contains(String destination)
True is this queue already contains the destination provided.
|
boolean |
equals(Object o)
Checks for equal based on routing flags and workflow names.
|
String |
get(int position) |
String |
getFirst()
Gets but does not remove the first entry from the workflow list.
|
int |
hashCode() |
void |
insert(String wf,
int position)
Adds the workflow
wf to the queue at the specified position . |
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.
|
Iterator<String> |
iterator()
Gets an iterator that iterates over all the workflows in the queue.
|
void |
prepend(String wf)
Adds a new workflow to the start of this queue.
|
void |
prepend(WorkflowQueue wfq)
adds all the workflows in
wfq to the start of our queue |
boolean |
remove(String wf)
Removes the first occurrence a specific workflow from this queue.
|
String |
removeFirst()
Gets and removes the first entry from the queue.
|
String |
replace(int position,
String s) |
void |
setRemote(boolean remote) |
void |
setRouteImmediately(boolean routeImmediately)
Sets the 'route immediately' flag.
|
int |
size()
Gets the size of the queue.
|
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final boolean DEFAULT_ROUTE_IMMEDIATELY
public WorkflowQueue(String... wfs)
wfs
- the workflow namespublic WorkflowQueue(boolean routeImmediately, String... wfs)
routeImmediately
- wfs
- the workflow namespublic void append(String... wfs)
wfs
- the workflowspublic void insert(String wf, int position)
wf
to the queue at the specified position
.wf
- position
- where to insert the wf
. if invalid, the wf
is added at the end.public String removeFirst()
public void prepend(String wf)
wf
- the workflow to addpublic boolean remove(String wf)
wf
- the workflow to removepublic String getFirst()
public Iterator<String> iterator()
public int size()
public boolean isRouteImmediately()
public void setRouteImmediately(boolean routeImmediately)
routeImmediately
- the route immediately flagpublic boolean equals(Object o)
public boolean isSameWorkflowOrder(WorkflowQueue queue)
queue
- the workflow queuepublic WorkflowQueue clone()
public void prepend(WorkflowQueue wfq)
wfq
to the start of our queuewfq
- public boolean isRemote()
public void setRemote(boolean remote)
public String get(int position)
public boolean contains(String destination)
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.