public class QueueNull extends Object implements Queue
/dev/null
.
Queue
for general information about
directory queues.
UnsupportedOperationException
exception.Constructor and Description |
---|
QueueNull()
Constructor for the null directory queue.
|
Modifier and Type | Method and Description |
---|---|
String |
add(byte[] data)
Add byte array data to the queue.
|
String |
add(String data)
Add String data to the queue.
|
String |
addPath(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.
|
String |
get(String name)
Get the given locked element as String data.
|
byte[] |
getAsByteArray(String name)
Get the given locked element as byte array data.
|
String |
getId()
Return a unique identifier for the queue.
|
String |
getPath(String path)
Get the path of the given locked element.
|
String |
getQueuePath()
Return the path of the queue.
|
Iterator<String> |
iterator()
Iterator for the null directory queue.
|
boolean |
lock(String name)
Lock an element in permissive mode.
|
boolean |
lock(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(String name)
Remove a locked element from the queue.
|
boolean |
unlock(String name)
Unlock an element in non-permissive mode.
|
boolean |
unlock(String name,
boolean permissive)
Unlock an element.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public String getQueuePath()
Queue
getQueuePath
in interface Queue
public String getId()
Queue
public String add(String data)
Queue
public String add(byte[] data)
Queue
public String addPath(String path) throws IOException
Queue
addPath
in interface Queue
path
- path of the file to be addedIOException
- if any file operation failspublic String get(String name)
Queue
public byte[] getAsByteArray(String name)
Queue
getAsByteArray
in interface Queue
name
- name of the element to be retrievedpublic String getPath(String path)
Queue
public boolean lock(String name)
Queue
public boolean lock(String name, boolean permissive)
Queue
public boolean unlock(String name)
Queue
public boolean unlock(String name, boolean permissive)
Queue
public void remove(String name)
Queue
public int count()
Queue
public void purge()
Queue
public void purge(int maxLock)
Queue
public void purge(int maxLock, int maxTemp)
Queue
purge
in interface Queue
maxLock
- 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 usedCopyright © 2017. All rights reserved.