| Modifier and Type | Field and Description |
|---|---|
protected List<Integer> |
readList |
protected long |
readTicket |
protected String |
tqDir |
| Constructor and Description |
|---|
FileTaskQueue() |
| Modifier and Type | Method and Description |
|---|---|
Set<TaskQueueEntry> |
dequeue(String queueName,
long ticket)
Returns the set of task entries from the named queue.
|
void |
enqueue(String queueName,
Set<TaskQueueEntry> entrySet)
Queues a set of task entries to a named queue.
|
void |
enqueue(String queueName,
TaskQueueEntry entry)
Queues a single entry to a named queue.
|
protected File |
ensureQueue(String queueName) |
String[] |
queueNames()
Returns list of queue names.
|
void |
release(String queueName,
long ticket,
boolean remove)
Releases the lock upon the named queue, deleting it if
removeEntries
is set to true. |
protected String tqDir
protected long readTicket
public String[] queueNames()
TaskQueuequeueNames in interface TaskQueuepublic void enqueue(String queueName, TaskQueueEntry entry) throws IOException
TaskQueueenqueue in interface TaskQueuequeueName - the name of the queue on which to writeentry - the task entryIOException - if IO errorpublic void enqueue(String queueName, Set<TaskQueueEntry> entrySet) throws IOException
TaskQueueenqueue in interface TaskQueuequeueName - the name of the queue on which to writeentrySet - the set of task entriesIOException - if IO errorpublic Set<TaskQueueEntry> dequeue(String queueName, long ticket) throws IOException
TaskQueuerelease is called. The ticket may be any number, but a
timestamp should guarantee sufficient uniqueness.dequeue in interface TaskQueuequeueName - the name of the queue to readticket - a token which must be presented to release the queueIOException - if IO errorpublic void release(String queueName, long ticket, boolean remove)
TaskQueueremoveEntries
is set to true.Copyright © 2016 DuraSpace. All rights reserved.