public interface ProcessQueue extends EventQueue
Title: Dataspace Framework
Description: Process Queue collection interface.
EventQueue
javadoc.
Queue
and BlockingQueue
methods(take/poll/peek/element/remove/drainTo) that operates with top elements
in ProcessQueue operates with top events in ENQUEUED
state.
To take/read head events with another state use EventQueue methods with selector(take/read/waitToRead/waitToTake).
drainTo operations add elements target queue in ENQUEUED state.
Copyright: Copyright (c) 2014
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
acknowledge(java.lang.String processId)
Changes status of process with specified processId to
ACKNOWLEDGED . |
void |
acknowledge(java.lang.String processId,
AcknowledgeAction ackAction)
Acknowledges process with specified processId to state according with given ackAction.
|
void |
createCertifiedRecipient(java.lang.String name,
java.lang.String token,
java.lang.String eventId,
java.lang.String subscriptionRule)
Creates new certified recipient.
|
void |
createRecipient(java.lang.String name,
java.lang.String eventId,
java.lang.String subscriptionRule)
Creates a new recipient.
|
void |
disableRecipient(java.lang.String name)
Disables specified recipient so that it isn't getting events from the offer mechanism.
|
void |
discard(java.lang.String processId)
Changes status of process with specified processId to
DISCARDED . |
void |
discard(java.lang.String processId,
ProcessQueue targetQueue)
Changes status of process with specified processId to
DISCARDED and puts event into given targetQueue. |
void |
discardProcess(java.lang.String processId)
Discards specified process so that it can't be retried or offered anymore.
|
void |
dropRecipient(java.lang.String name)
Drops specified recipient from the queue.
|
void |
enableRecipient(java.lang.String name)
Enables specified recipient so that it is participating in the offer mechanism.
|
void |
expire(java.lang.String processId)
Changes status of process with specified processId to
EXPIRED . |
void |
expire(java.lang.String processId,
ProcessQueue targetQueue)
Changes status of process with specified processId to
EXPIRED and puts event into given targetQueue. |
void |
fail(java.lang.String processId)
Changes status of process with specified processId to
UNDELIVERED . |
int |
getMaxAttempts()
Returns max attempts of process retries.
|
long |
getOfferInterval()
Returns offer interval in milliseconds.
|
int |
getParallelDegree()
Returns parallel degree.
|
QueueState |
getQueueState()
Returns queue state.
|
java.util.List |
getRecipients()
Returns list of existing recipients.
|
long |
getRecipientTimeout()
Returns recipient timeout in milliseconds.
|
ProcessState |
getState(java.lang.String processId)
Returns the state of a process with given
processId . |
boolean |
getSuspendOnFailure()
Returns susped on failure.
|
java.util.List |
listRecipients()
Returns list of existing recipient names.
|
void |
pend(java.lang.String processId)
Changes status of process with specified processId to
PENDING . |
void |
resume()
Resumes process queue.
|
void |
retryProcess(java.lang.String processId)
Resets process state to ENQUEUED so that the process is getting offered again.
|
void |
revert(java.lang.String processId)
Puts event back into
ENQUEUED state. |
void |
setMaxAttempts(int maxAttempts)
Set max attempts of process reties.
|
void |
setOfferInterval(long offerInterval)
Sets offer interval.
|
void |
setParallelDegree(int parallelDegree)
Sets parallel degree of process queue.
|
void |
setPollerConfiguration(long offerInterval,
long recipientTimeout,
int maxAttempts,
boolean suspendOnFailure)
Sets process queue poller configuration atomicaly.
|
void |
setProcessExpiration(java.lang.String processId,
long timeOfExpiration)
Sets an expiration for the specified process.
|
void |
setRecipientTimeout(long recipientTimeout)
Sets recipient timeout in milliseconds.
|
void |
setSuspendOnFailure(boolean suspendOnFailure)
Sets suspend the queue if process and all its retries was failed.
|
void |
skip(java.lang.String processId)
Changes status of process with specified processId to
SKIPPED . |
void |
suspend()
Suspends process queue.
|
EventDatagram |
takeForBatch(java.lang.String batchId)
Retrieves the next event from the head of the queue that is in
an
ENQUEUED state, changes state of an element in the queue
to IN_TRANSACTION and sets the batchId for the
element. |
EventDatagram |
takeForBatch(java.lang.String batchId,
long timeout,
java.util.concurrent.TimeUnit unit)
The same as
#takeForBatch() but allows the caller to
wait for a specified element to become available. |
EventDatagram |
takeForBatch(java.lang.String batchId,
java.lang.String selector)
The same as
#takeForBatch() but also allows the use of a
selector to filter and specify the event
that will be returned. |
EventDatagram |
takeForBatch(java.lang.String batchId,
java.lang.String selector,
long timeout,
java.util.concurrent.TimeUnit unit)
The same as
#takeForBatch(long,TimeUnit) but also allows the use of a
selector to filter and specify the event
that will be returned. |
EventDatagram |
takeForLock()
Retrieves the next event from the head of the queue
that is in an
ENQUEUED state and changes state
of the element to LOCKED . |
EventDatagram |
takeForLock(long timeout,
java.util.concurrent.TimeUnit unit)
The same as
takeForLock() but allows for waiting on
arrival of an available event in the data collection. |
EventDatagram |
takeForLock(java.lang.String selector)
This method is similar to
takeForLock() , however it
finds the first event in an ENQUEUED state that matches
the selector clause and returns a copy of that event datagram
to the user updating the status of the event to LOCKED . |
EventDatagram |
takeForLock(java.lang.String selector,
long timeout,
java.util.concurrent.TimeUnit unit)
This method is the same as
takeForLock(long,TimeUnit) but also
allows the use of a selector to filter and specify the event
that will be returned. |
EventDatagram |
takeForOffer()
Retrieves the next event from the head of the queue that is
in the
ENQUEUED state and changes state to LOCKED_FOR_OFFER . |
EventDatagram |
takeForOffer(long timeout,
java.util.concurrent.TimeUnit unit)
The same as
takeForOffer() but allows the caller to
wait for a specified element to become available. |
EventDatagram |
takeForOffer(java.lang.String selector)
The same as
takeForOffer() but also allows the use of a
selector to filter and specify the event
that will be returned. |
EventDatagram |
takeForOffer(java.lang.String selector,
long timeout,
java.util.concurrent.TimeUnit unit)
The same as
takeForOffer(long,TimeUnit) but also allows the use of a
selector to filter and specify the event
that will be returned. |
EventDatagram |
takeLastForBatch(java.lang.String batchId) |
EventDatagram |
takeLastForBatch(java.lang.String batchId,
long timeout,
java.util.concurrent.TimeUnit unit) |
EventDatagram |
takeLastForBatch(java.lang.String batchId,
java.lang.String selector) |
EventDatagram |
takeLastForBatch(java.lang.String batchId,
java.lang.String selector,
long timeout,
java.util.concurrent.TimeUnit unit) |
EventDatagram |
takeLastForLock() |
EventDatagram |
takeLastForLock(long timeout,
java.util.concurrent.TimeUnit unit) |
EventDatagram |
takeLastForLock(java.lang.String selector) |
EventDatagram |
takeLastForLock(java.lang.String selector,
long timeout,
java.util.concurrent.TimeUnit unit) |
EventDatagram |
takeLastForOffer() |
EventDatagram |
takeLastForOffer(long timeout,
java.util.concurrent.TimeUnit unit) |
EventDatagram |
takeLastForOffer(java.lang.String selector) |
EventDatagram |
takeLastForOffer(java.lang.String selector,
long timeout,
java.util.concurrent.TimeUnit unit) |
void |
unacknowledge(java.lang.String processId)
Changes status of process with specified processId to
UNACKNOWLEDGED . |
count, drainTo, drainTo, read, readAll, readLast, start, stop, take, takeLast, waitToRead, waitToRead, waitToReadLast, waitToReadLast, waitToTake, waitToTake, waitToTakeLast, waitToTakeLast
addAll, containsAll, drainTo, drainTo, pollLast, removeAll, retainAll, takeLast
addRow, addRows, drainRowsTo, drainRowsTo, drainToMap, drainToQueue, drainToRowSet, drainToTable, elementLast, fromMap, fromQueue, fromRowSet, fromTable, peekLast, pollLast, removeLast, toMap, toMapCollection, toQueue, toQueueCollection, toRowSet, toTableCollection
getCollectionName, getCollectionType, getMemoryModel, listTriggers
add, contains, offer, offer, poll, put, remainingCapacity, remove, take
void setPollerConfiguration(long offerInterval, long recipientTimeout, int maxAttempts, boolean suspendOnFailure)
offerInterval
- in millisecondsrecipientTimeout
- in millisecondsmaxAttempts
- suspendOnFailure
- void setMaxAttempts(int maxAttempts)
maxAttempts
- int getMaxAttempts()
void setOfferInterval(long offerInterval)
offerInterval
- in millisecondslong getOfferInterval()
void setRecipientTimeout(long recipientTimeout)
recipientTimeout
- in millisecondslong getRecipientTimeout()
void setSuspendOnFailure(boolean suspendOnFailure)
suspendOnFailure
- boolean getSuspendOnFailure()
void setParallelDegree(int parallelDegree)
parallelDegree
- int getParallelDegree()
void createRecipient(java.lang.String name, java.lang.String eventId, java.lang.String subscriptionRule)
correlationId
). Recipients
specify the eventId
that data elements are offered on. The
prototypes must match those of the process queue constraints.name
- eventId
- subscriptionRule
- void enableRecipient(java.lang.String name)
name
- void disableRecipient(java.lang.String name)
name
- void dropRecipient(java.lang.String name)
name
- void createCertifiedRecipient(java.lang.String name, java.lang.String token, java.lang.String eventId, java.lang.String subscriptionRule)
token
configured as part of their operation cannot properly acknowledge processed events.name
- eventId
- subscriptionRule
- java.util.List listRecipients()
java.util.List getRecipients()
void discardProcess(java.lang.String processId)
processId
- void retryProcess(java.lang.String processId)
processId
- void setProcessExpiration(java.lang.String processId, long timeOfExpiration)
processId
- timeOfExpiration
- void suspend()
void resume()
QueueState getQueueState()
EventDatagram takeForLock()
ENQUEUED
state and changes state
of the element to LOCKED
.
Note that a take
operation typically performs a
destructive de-queue operation, removing an element
from a queue emulating the so-called Linda programming
model for concurrent resource access. In this case we are
returning copies of the elements in order to avoid the
network overhead of putting such elements back on the queue
and the processing overhead of preserving element order.
All such methods specific to the Process Queue
augment the Linda model by altering the state of the
queue element and potentially advertising such state
changes thru event triggers rather than simply
removing the elements. This allows users to manage
the state of queue elements in a collaborative fashion
while preserving the FIFO order of queue elements.
All operations of this type may be performed transactionally
by implicitly starting transactions via the Accessor
API and then issuing a commit
.
This method is part of the Linda API
EventDatagram takeLastForLock()
EventDatagram takeForLock(java.lang.String selector)
takeForLock()
, however it
finds the first event in an ENQUEUED
state that matches
the selector clause and returns a copy of that event datagram
to the user updating the status of the event to LOCKED
.
If processId
is not specified in the selector the first
enqueued event matching the selector is returned.
If no selector specified the method defaults to
the same behavior as takeForLock()
method.
This method is part of the Linda API
selector
- DSQL selector on event propertiesEventDatagram takeLastForLock(java.lang.String selector)
EventDatagram takeForLock(long timeout, java.util.concurrent.TimeUnit unit)
takeForLock()
but allows for waiting on
arrival of an available event in the data collection. This method
will block until an event with an ENQUEUED
state
will become available.
Note that there may be events in the queue
with other states. So for example if an element has been locked by
another process or application and is then reverted back to an enqueued
state this method will wait for a specified timeout
period
and if the locked element becomes available the method will return a
copy of the datagram. Otherwise the method will return a null
.
This method is part of the Linda API
timeout
- - the amount of time to waitunit
- - the time unit to wait inEventDatagram takeLastForLock(long timeout, java.util.concurrent.TimeUnit unit)
EventDatagram takeForLock(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
takeForLock(long,TimeUnit)
but also
allows the use of a selector
to filter and specify the event
that will be returned.
This method is part of the Linda API
selector
- DSQL selector on event propertiestimeout
- unit
- EventDatagram takeLastForLock(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
EventDatagram takeForOffer()
ENQUEUED
state and changes state to LOCKED_FOR_OFFER
.
This method is similar to takeForLock()
in function and use.
This method is part of the Linda API
EventDatagram takeLastForOffer()
EventDatagram takeForOffer(java.lang.String selector)
takeForOffer()
but also allows the use of a
selector
to filter and specify the event
that will be returned.
This method is part of the Linda API
selector
- DSQL selector propertiesEventDatagram takeLastForOffer(java.lang.String selector)
EventDatagram takeForOffer(long timeout, java.util.concurrent.TimeUnit unit)
takeForOffer()
but allows the caller to
wait for a specified element to become available. See takeForLock(long,TimeUnit)
for details of timeout processing.
This method is part of the Linda API
timeout
- unit
- EventDatagram takeLastForOffer(long timeout, java.util.concurrent.TimeUnit unit)
EventDatagram takeForOffer(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
takeForOffer(long,TimeUnit)
but also allows the use of a
selector
to filter and specify the event
that will be returned.
This method is part of the Linda API
selector
- DSQL selector on event propertiestimeout
- unit
- EventDatagram takeLastForOffer(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
EventDatagram takeForBatch(java.lang.String batchId)
ENQUEUED
state, changes state of an element in the queue
to IN_TRANSACTION
and sets the batchId
for the
element. Groups of elements may be transactionally marked by this
operation (same as with other methods).
This method is part of the Linda API
batchId
- DataspaceException
- if process with specified processId doesn't existEventDatagram takeLastForBatch(java.lang.String batchId)
EventDatagram takeForBatch(java.lang.String batchId, java.lang.String selector)
#takeForBatch()
but also allows the use of a
selector
to filter and specify the event
that will be returned.
This method is part of the Linda API
selector
- DSQL selector on event propertiesEventDatagram takeLastForBatch(java.lang.String batchId, java.lang.String selector)
EventDatagram takeForBatch(java.lang.String batchId, long timeout, java.util.concurrent.TimeUnit unit)
#takeForBatch()
but allows the caller to
wait for a specified element to become available. See takeForLock(long,TimeUnit)
for details of timeout processing.
This method is part of the Linda API
timeout
- unit
- EventDatagram takeLastForBatch(java.lang.String batchId, long timeout, java.util.concurrent.TimeUnit unit)
EventDatagram takeForBatch(java.lang.String batchId, java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
#takeForBatch(long,TimeUnit)
but also allows the use of a
selector
to filter and specify the event
that will be returned.
This method is part of the Linda API
selector
- timeout
- unit
- EventDatagram takeLastForBatch(java.lang.String batchId, java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
ProcessState getState(java.lang.String processId)
processId
.DataspaceException
- if process with specified processId doesn't existvoid revert(java.lang.String processId)
ENQUEUED
state.processId
- - correlationId of eventDataspaceException
- if process with specified processId doesn't existvoid acknowledge(java.lang.String processId)
ACKNOWLEDGED
.processId
- DataspaceException
- if process with specified processId doesn't existvoid fail(java.lang.String processId)
UNDELIVERED
.processId
- DataspaceException
- if process with specified processId doesn't existvoid unacknowledge(java.lang.String processId)
UNACKNOWLEDGED
.processId
- DataspaceException
- if process with specified processId doesn't existvoid skip(java.lang.String processId)
SKIPPED
.processId
- DataspaceException
- if process with specified processId doesn't existvoid pend(java.lang.String processId)
PENDING
.processId
- DataspaceException
- if process with specified processId doesn't existvoid expire(java.lang.String processId)
EXPIRED
.processId
- DataspaceException
- if process with specified processId doesn't existvoid expire(java.lang.String processId, ProcessQueue targetQueue)
EXPIRED
and puts event into given targetQueue.processId
- targetQueue
- DataspaceException
- if process with specified processId doesn't existvoid discard(java.lang.String processId)
DISCARDED
.processId
- DataspaceException
- if process with specified processId doesn't existvoid discard(java.lang.String processId, ProcessQueue targetQueue)
DISCARDED
and puts event into given targetQueue.processId
- targetQueue
- DataspaceException
- if process with specified processId doesn't existvoid acknowledge(java.lang.String processId, AcknowledgeAction ackAction)
processId
- ackAction
- DataspaceException
- if process with specified processId doesn't existCopyright © 2015-2024 StreamScape Technologies. All rights reserved.