public class QueueNull extends java.lang.Object implements Queue
/dev/null.
Queue for general information about
directory queues.
UnsupportedOperationException exception.| Modifier and Type | Class and Description |
|---|---|
private static class |
QueueNull.QueueNullIterator
Iterator for the null directory queue (private).
|
| Constructor and Description |
|---|
QueueNull()
Constructor for the null directory queue.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
add(byte[] data)
Add byte array data to the queue.
|
java.lang.String |
add(java.lang.String data)
Add String data to the queue.
|
java.lang.String |
addPath(java.lang.String path)
Add the given file (identified by its path) to the queue and return the
corresponding element name, the file must be on the same filesystem and
will be moved to the queue.
|
int |
count()
Return the number of elements in the queue.
|
java.lang.String |
get(java.lang.String name)
Get the given locked element as String data.
|
byte[] |
getAsByteArray(java.lang.String name)
Get the given locked element as byte array data.
|
java.lang.String |
getId()
Return a unique identifier for the queue.
|
java.lang.String |
getPath(java.lang.String path)
Get the path of the given locked element.
|
java.lang.String |
getQueuePath()
Return the path of the queue.
|
java.util.Iterator<java.lang.String> |
iterator()
Iterator for the null directory queue.
|
boolean |
lock(java.lang.String name)
Lock an element in permissive mode.
|
boolean |
lock(java.lang.String name,
boolean permissive)
Lock an element.
|
void |
purge()
Purge the queue by removing unused intermediate directories, removing too
old temporary elements and unlocking too old locked elements (aka staled
locks); note: this can take a long time on queues with many elements.
|
void |
purge(int maxLock)
Purge the queue by removing unused intermediate directories, removing too
old temporary elements and unlocking too old locked elements (aka staled
locks); note: this can take a long time on queues with many elements.
|
void |
purge(int maxLock,
int maxTemp)
Purge the queue by removing unused intermediate directories, removing too
old temporary elements and unlocking too old locked elements (aka staled
locks); note: this can take a long time on queues with many elements.
|
void |
remove(java.lang.String name)
Remove a locked element from the queue.
|
boolean |
unlock(java.lang.String name)
Unlock an element in non-permissive mode.
|
boolean |
unlock(java.lang.String name,
boolean permissive)
Unlock an element.
|
public java.lang.String getQueuePath()
QueuegetQueuePath in interface Queuepublic java.lang.String getId()
Queuepublic java.lang.String add(java.lang.String data)
Queuepublic java.lang.String add(byte[] data)
Queuepublic java.lang.String addPath(java.lang.String path)
throws java.io.IOException
Queuepublic java.lang.String get(java.lang.String name)
Queuepublic byte[] getAsByteArray(java.lang.String name)
QueuegetAsByteArray in interface Queuename - name of the element to be retrievedpublic java.lang.String getPath(java.lang.String path)
Queuepublic boolean lock(java.lang.String name)
Queuepublic boolean lock(java.lang.String name,
boolean permissive)
Queuepublic boolean unlock(java.lang.String name)
Queuepublic boolean unlock(java.lang.String name,
boolean permissive)
Queuepublic void remove(java.lang.String name)
Queuepublic int count()
Queuepublic void purge()
Queuepublic void purge(int maxLock)
Queuepublic void purge(int maxLock,
int maxTemp)
Queuepurge in interface QueuemaxLock - maximum time for a locked element (in seconds);
if set to 0, locked elements will not be unlocked;
if set to null, the object's default value will be usedmaxTemp - maximum time for a temporary element (in seconds);
if set to 0, temporary elements will not be removed
if set to null, the object's default value will be usedpublic java.util.Iterator<java.lang.String> iterator()
iterator in interface java.lang.Iterable<java.lang.String>