public class ProcessQueueProxy extends EventQueueProxy implements ProcessQueue
Title: Dataspace Framework
Description: Process queue proxy.
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
Constructor and Description |
---|
ProcessQueueProxy() |
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
ProcessQueue.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
ProcessQueue.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
ProcessQueue.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
ProcessQueue.takeForOffer() but allows the caller to
wait for a specified element to become available. |
EventDatagram |
takeForOffer(java.lang.String selector)
The same as
ProcessQueue.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
ProcessQueue.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, getEventId, read, readAll, readLast, start, stop, take, takeLast, waitToRead, waitToRead, waitToReadLast, waitToReadLast, waitToTake, waitToTake, waitToTakeLast, waitToTakeLast
drainTo, drainTo, offer, poll, pollLast, put, remainingCapacity, take, takeLast
add, addAll, addRow, addRows, clear, contains, containsAll, drainRowsTo, drainRowsTo, drainToMap, drainToQueue, drainToRowSet, drainToTable, element, elementLast, fromMap, fromQueue, fromRowSet, fromTable, isEmpty, iterator, offer, peek, peekLast, poll, pollLast, remove, remove, removeAll, removeLast, retainAll, size, toArray, toArray, toMap, toMapCollection, toQueue, toQueueCollection, toRowSet, toTableCollection
getCollectionName, getCollectionType, getMemoryModel, listTriggers
getId, setAccessor, setId
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
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
public void setPollerConfiguration(long offerInterval, long recipientTimeout, int maxAttempts, boolean suspendOnFailure)
ProcessQueue
setPollerConfiguration
in interface ProcessQueue
offerInterval
- in millisecondsrecipientTimeout
- in millisecondspublic void setMaxAttempts(int maxAttempts)
ProcessQueue
setMaxAttempts
in interface ProcessQueue
public int getMaxAttempts()
ProcessQueue
getMaxAttempts
in interface ProcessQueue
public void setOfferInterval(long offerInterval)
ProcessQueue
setOfferInterval
in interface ProcessQueue
offerInterval
- in millisecondspublic long getOfferInterval()
ProcessQueue
getOfferInterval
in interface ProcessQueue
public void setRecipientTimeout(long recipientTimeout)
ProcessQueue
setRecipientTimeout
in interface ProcessQueue
recipientTimeout
- in millisecondspublic long getRecipientTimeout()
ProcessQueue
getRecipientTimeout
in interface ProcessQueue
public void setSuspendOnFailure(boolean suspendOnFailure)
ProcessQueue
setSuspendOnFailure
in interface ProcessQueue
public boolean getSuspendOnFailure()
ProcessQueue
getSuspendOnFailure
in interface ProcessQueue
public void setParallelDegree(int parallelDegree)
ProcessQueue
setParallelDegree
in interface ProcessQueue
public int getParallelDegree()
ProcessQueue
getParallelDegree
in interface ProcessQueue
public void createCertifiedRecipient(java.lang.String name, java.lang.String token, java.lang.String eventId, java.lang.String subscriptionRule)
ProcessQueue
token
configured as part of their operation cannot properly acknowledge processed events.createCertifiedRecipient
in interface ProcessQueue
public void createRecipient(java.lang.String name, java.lang.String eventId, java.lang.String subscriptionRule)
ProcessQueue
correlationId
). Recipients
specify the eventId
that data elements are offered on. The
prototypes must match those of the process queue constraints.createRecipient
in interface ProcessQueue
public void disableRecipient(java.lang.String name)
ProcessQueue
disableRecipient
in interface ProcessQueue
public void discardProcess(java.lang.String processId)
ProcessQueue
discardProcess
in interface ProcessQueue
public void enableRecipient(java.lang.String name)
ProcessQueue
enableRecipient
in interface ProcessQueue
public void dropRecipient(java.lang.String name)
ProcessQueue
dropRecipient
in interface ProcessQueue
public java.util.List listRecipients()
ProcessQueue
listRecipients
in interface ProcessQueue
public java.util.List getRecipients()
ProcessQueue
getRecipients
in interface ProcessQueue
public void retryProcess(java.lang.String processId)
ProcessQueue
retryProcess
in interface ProcessQueue
public void setProcessExpiration(java.lang.String processId, long timeOfExpiration)
ProcessQueue
setProcessExpiration
in interface ProcessQueue
public void resume()
ProcessQueue
resume
in interface ProcessQueue
public void suspend()
ProcessQueue
suspend
in interface ProcessQueue
public QueueState getQueueState()
ProcessQueue
getQueueState
in interface ProcessQueue
public EventDatagram takeForLock()
ProcessQueue
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
takeForLock
in interface ProcessQueue
public EventDatagram takeForLock(java.lang.String selector)
ProcessQueue
ProcessQueue.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 ProcessQueue.takeForLock()
method.
This method is part of the Linda API
takeForLock
in interface ProcessQueue
selector
- DSQL selector on event propertiespublic EventDatagram takeForLock(long timeout, java.util.concurrent.TimeUnit unit)
ProcessQueue
ProcessQueue.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
takeForLock
in interface ProcessQueue
timeout
- - the amount of time to waitunit
- - the time unit to wait inpublic EventDatagram takeForLock(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
ProcessQueue
ProcessQueue.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
takeForLock
in interface ProcessQueue
selector
- DSQL selector on event propertiespublic EventDatagram takeLastForLock()
takeLastForLock
in interface ProcessQueue
public EventDatagram takeLastForLock(java.lang.String selector)
takeLastForLock
in interface ProcessQueue
public EventDatagram takeLastForLock(long timeout, java.util.concurrent.TimeUnit unit)
takeLastForLock
in interface ProcessQueue
public EventDatagram takeLastForLock(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
takeLastForLock
in interface ProcessQueue
public EventDatagram takeForOffer()
ProcessQueue
ENQUEUED
state and changes state to LOCKED_FOR_OFFER
.
This method is similar to ProcessQueue.takeForLock()
in function and use.
This method is part of the Linda API
takeForOffer
in interface ProcessQueue
public EventDatagram takeForOffer(java.lang.String selector)
ProcessQueue
ProcessQueue.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
takeForOffer
in interface ProcessQueue
selector
- DSQL selector propertiespublic EventDatagram takeForOffer(long timeout, java.util.concurrent.TimeUnit unit)
ProcessQueue
ProcessQueue.takeForOffer()
but allows the caller to
wait for a specified element to become available. See ProcessQueue.takeForLock(long,TimeUnit)
for details of timeout processing.
This method is part of the Linda API
takeForOffer
in interface ProcessQueue
public EventDatagram takeForOffer(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
ProcessQueue
ProcessQueue.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
takeForOffer
in interface ProcessQueue
selector
- DSQL selector on event propertiespublic EventDatagram takeLastForOffer()
takeLastForOffer
in interface ProcessQueue
public EventDatagram takeLastForOffer(java.lang.String selector)
takeLastForOffer
in interface ProcessQueue
public EventDatagram takeLastForOffer(long timeout, java.util.concurrent.TimeUnit unit)
takeLastForOffer
in interface ProcessQueue
public EventDatagram takeLastForOffer(java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
takeLastForOffer
in interface ProcessQueue
public EventDatagram takeForBatch(java.lang.String batchId)
ProcessQueue
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
takeForBatch
in interface ProcessQueue
public EventDatagram takeForBatch(java.lang.String batchId, java.lang.String selector)
ProcessQueue
#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
takeForBatch
in interface ProcessQueue
selector
- DSQL selector on event propertiespublic EventDatagram takeForBatch(java.lang.String batchId, long timeout, java.util.concurrent.TimeUnit unit)
ProcessQueue
#takeForBatch()
but allows the caller to
wait for a specified element to become available. See ProcessQueue.takeForLock(long,TimeUnit)
for details of timeout processing.
This method is part of the Linda API
takeForBatch
in interface ProcessQueue
public EventDatagram takeForBatch(java.lang.String batchId, java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
ProcessQueue
#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
takeForBatch
in interface ProcessQueue
public EventDatagram takeLastForBatch(java.lang.String batchId)
takeLastForBatch
in interface ProcessQueue
public EventDatagram takeLastForBatch(java.lang.String batchId, java.lang.String selector)
takeLastForBatch
in interface ProcessQueue
public EventDatagram takeLastForBatch(java.lang.String batchId, long timeout, java.util.concurrent.TimeUnit unit)
takeLastForBatch
in interface ProcessQueue
public EventDatagram takeLastForBatch(java.lang.String batchId, java.lang.String selector, long timeout, java.util.concurrent.TimeUnit unit)
takeLastForBatch
in interface ProcessQueue
public ProcessState getState(java.lang.String processId)
ProcessQueue
processId
.getState
in interface ProcessQueue
public void revert(java.lang.String processId)
ProcessQueue
ENQUEUED
state.revert
in interface ProcessQueue
processId
- - correlationId of eventpublic void acknowledge(java.lang.String processId)
ProcessQueue
ACKNOWLEDGED
.acknowledge
in interface ProcessQueue
public void fail(java.lang.String processId)
ProcessQueue
UNDELIVERED
.fail
in interface ProcessQueue
public void unacknowledge(java.lang.String processId)
ProcessQueue
UNACKNOWLEDGED
.unacknowledge
in interface ProcessQueue
public void skip(java.lang.String processId)
ProcessQueue
SKIPPED
.skip
in interface ProcessQueue
public void pend(java.lang.String processId)
ProcessQueue
PENDING
.pend
in interface ProcessQueue
public void expire(java.lang.String processId)
ProcessQueue
EXPIRED
.expire
in interface ProcessQueue
public void expire(java.lang.String processId, ProcessQueue targetQueue)
ProcessQueue
EXPIRED
and puts event into given targetQueue.expire
in interface ProcessQueue
public void discard(java.lang.String processId)
ProcessQueue
DISCARDED
.discard
in interface ProcessQueue
public void discard(java.lang.String processId, ProcessQueue targetQueue)
ProcessQueue
DISCARDED
and puts event into given targetQueue.discard
in interface ProcessQueue
public void acknowledge(java.lang.String processId, AcknowledgeAction ackAction)
ProcessQueue
acknowledge
in interface ProcessQueue
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.