Class PersistedQueue
- java.lang.Object
-
- org.forgerock.openidm.accountchange.PersistedQueue
-
@ThreadSafe public class PersistedQueue extends Object
Fast request queue implementation on top of Berkley DB Java Edition. The queue uses the canonalised dn for key and store only the last password change for each dn.
-
-
Constructor Summary
Constructors Constructor Description PersistedQueue(File queueEnvPath, String queueName, int cacheSize)Creates instance of persistent queue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this queue and frees up all resources associated to it.StringgetQueueName()Returns this queue name.String[]poll()Retrieves and returns element from the head of this queue.voidpush(String dn, String element)Pushes element to the queue.longsize()Returns the size of this queue.
-
-
-
Method Detail
-
poll
public String[] poll() throws IOException
Retrieves and returns element from the head of this queue.- Returns:
- element from the head of the queue or null if queue is empty
- Throws:
IOException- in case of disk IO failure
-
push
public void push(String dn, String element) throws IOException
Pushes element to the queue. The entries are sorted in natural order and not in order of time when they were added.- Parameters:
dn- The entry DNelement- element- Throws:
IOException- in case of disk IO failure
-
size
public long size()
Returns the size of this queue.- Returns:
- the size of the queue
-
getQueueName
public String getQueueName()
Returns this queue name.- Returns:
- this queue name
-
close
public void close()
Closes this queue and frees up all resources associated to it.
-
-