protected static class MemoryBookmarkStore.Subscription extends java.lang.Object implements Subscription
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_recoveryTimestamp
The last-modified timestamp, if any, from a RecoveryPointAdapter
before recovery is initiated.
|
Constructor and Description |
---|
Subscription()
Default constructor that creates a Subscription object and initializes its
state.
|
Subscription(Field subscriptionId)
Constructor that creates a Subscription object with the provided subscription
ID and initializes its state.
|
Modifier and Type | Method and Description |
---|---|
void |
discard(long index)
Discard a bookmark at the specified index.
|
Field |
getMostRecent()
Get the most recent bookmark.
|
Field |
getMostRecentList(boolean useList) |
long |
getOldestBookmarkSeq()
Get the oldest bookmark sequence number.
|
BookmarkRangeField |
getRange()
Gets the range of bookmarks stored in this bookmark store.
|
java.lang.String |
getRecoveryTimestamp()
Get the last-modified timestamp used for recovery.
|
void |
init(Field subId,
MemoryBookmarkStore parent)
Initialize the Subscription with a new subscription ID and assign a reference
to the parent bookmark store.
|
boolean |
isDiscarded(BookmarkField bookmark)
Check to see if this message is older than the most recent one seen,
and if it is, check if it discarded.
|
long |
log(BookmarkField bookmark)
Log a bookmark, either a single bookmark or a list of bookmarks.
|
void |
reset()
Reset the state of this subscription object such that it can be
returned to the pool for reuse.
|
void |
setLastPersisted(BookmarkField bookmark)
Set the last persisted bookmark.
|
void |
setLastPersisted(long bookmark)
Deprecated.
use
setLastPersisted(BookmarkField) instead. |
protected void |
setRecoveryTimestamp(java.lang.String rts)
The last-modified timestamp, if any, from a RecoveryPointAdapter
before recovery is initiated.
|
void |
setResizeHandler(BookmarkStoreResizeHandler handler,
BookmarkStore store)
Set a resize handler for the bookmark store.
|
protected volatile java.lang.String _recoveryTimestamp
public Subscription(Field subscriptionId)
subscriptionId
- The subscription ID to associate with this
Subscription.public Subscription()
public void reset()
public void init(Field subId, MemoryBookmarkStore parent)
subId
- The new subscription ID to associate with this Subscription.parent
- The parent MemoryBookmarkStore to which this Subscription
belongs.public java.lang.String getRecoveryTimestamp()
protected final void setRecoveryTimestamp(java.lang.String rts)
rts
- The recovery timestamp to set.public long log(BookmarkField bookmark) throws java.io.IOException, CommandException
log
in interface Subscription
bookmark
- The bookmark to log.java.io.IOException
- Thrown when an IO operation fails.CommandException
- Thrown when a command operation fails.public void discard(long index) throws java.io.IOException
discard
in interface Subscription
index
- The index of the bookmark to discard.java.io.IOException
- Thrown when an IO operation fails.public boolean isDiscarded(BookmarkField bookmark)
isDiscarded
in interface Subscription
bookmark
- The bookmark containing the publisher ID and sequence number.public BookmarkRangeField getRange()
getRange
in interface Subscription
public Field getMostRecent()
getMostRecent
in interface Subscription
public Field getMostRecentList(boolean useList)
getMostRecentList
in interface Subscription
@Deprecated public void setLastPersisted(long bookmark) throws java.io.IOException
setLastPersisted(BookmarkField)
instead.setLastPersisted
in interface Subscription
bookmark
- The bookmark to be persisted.java.io.IOException
- if the bookmark was unable to be persisted to the
bookmark store.public void setLastPersisted(BookmarkField bookmark) throws java.io.IOException
setLastPersisted
in interface Subscription
bookmark
- The bookmark to set as the last persisted.java.io.IOException
- If an I/O error occurs.public long getOldestBookmarkSeq()
getOldestBookmarkSeq
in interface Subscription
public void setResizeHandler(BookmarkStoreResizeHandler handler, BookmarkStore store)
setResizeHandler
in interface Subscription
handler
- The resize handler to set.store
- The bookmark store to associate with the handler.