public class ZooUidProvider<E> extends Object implements UidProvider<E>
Modifier and Type | Field and Description |
---|---|
static String |
UID_PATH_SUFFIX |
Constructor and Description |
---|
ZooUidProvider(com.netflix.curator.framework.CuratorFramework client) |
ZooUidProvider(com.netflix.curator.framework.CuratorFramework client,
com.netflix.curator.RetryPolicy retryPolicy) |
Modifier and Type | Method and Description |
---|---|
long |
lastUid(MailboxSession session,
Mailbox<E> mailbox)
Return the last uid which were used for storing a Message in the
Mailbox |
long |
nextUid(MailboxSession session,
Mailbox mailbox)
Return the next uid which can be used while append a Message to the
Mailbox . |
static String |
pathForMailbox(Mailbox mailbox) |
public static final String UID_PATH_SUFFIX
public ZooUidProvider(com.netflix.curator.framework.CuratorFramework client)
public ZooUidProvider(com.netflix.curator.framework.CuratorFramework client, com.netflix.curator.RetryPolicy retryPolicy)
public long nextUid(MailboxSession session, Mailbox mailbox) throws MailboxException
UidProvider
Mailbox
.
Its important that the returned uid is higher then the last used and that the next call of this method does return a higher
onenextUid
in interface UidProvider<E>
MailboxException
public long lastUid(MailboxSession session, Mailbox<E> mailbox) throws MailboxException
UidProvider
Mailbox
lastUid
in interface UidProvider<E>
MailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.