public class DefaultBookmarkStore extends java.lang.Object implements BookmarkStore
BookmarkStore interface that
does nothing.| Constructor and Description |
|---|
DefaultBookmarkStore() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
discard(Field subId,
long bookmarkSequenceNumber)
You can call this when you want to mark the message specified by the
subscription ID and the bookmark sequence number as discarded,
indicating that the application has completed processing the message.
|
void |
discard(Message message)
You can call this when you want to mark the provided message as discarded,
indicating that the application has completed processing the message.
|
Field |
getMostRecent(Field subId)
You can call this when you want to return the correct recovery point for
resubscription of the provided subID from the BookmarkStore.
|
Field |
getMostRecent(Field subId,
boolean useList)
You can call this when you want to return the correct recovery point for
resubscription of the provided subID from the BookmarkStore.
|
long |
getOldestBookmarkSeq(Field subId)
You can call this when you want to retrieve the sequence number of the
oldest bookmark in the store.
|
boolean |
isDiscarded(Message message)
Called internally by the AMPS Client.
|
long |
log(Message message)
Called internally by the AMPS Client to log a bookmark to the persistent
log.
|
void |
persisted(Field subId,
BookmarkField bookmark)
Called internally by the AMPS Client to record the last persisted message
in the transaction log of the connected AMPS server to all of its sync
replication destinations.
|
void |
persisted(Field subId,
long bookmark)
Old style of setting a persisted bookmark no longer used.
|
void |
purge()
You can call this when you want to purge the contents of this store.
|
void |
purge(Field subId_)
You can call this when you want to purge the contents of this store for a
given subscription ID.
|
void |
setResizeHandler(BookmarkStoreResizeHandler handler)
You can call this when you want to set a resize handler that is invoked
when the store needs to resize.
|
void |
setServerVersion(int version_)
Called internally by the AMPS Client when connected to an AMPS server to
indicate what version the server is.
|
public long log(Message message)
BookmarkStorelog in interface BookmarkStoremessage - The message containing the bookmark to log.public void discard(Field subId, long bookmarkSequenceNumber)
BookmarkStorediscard in interface BookmarkStoresubId - The subscription ID of the bookmark.bookmarkSequenceNumber - The bookmark sequence number.public void discard(Message message) throws AMPSException
BookmarkStorediscard in interface BookmarkStoremessage - Message to be marked as discarded.AMPSException - Thrown when the specified message cannot be discarded.public Field getMostRecent(Field subId)
BookmarkStoregetMostRecent in interface BookmarkStoresubId - The subscription ID of the most recent bookmark.public Field getMostRecent(Field subId, boolean useList)
BookmarkStoregetMostRecent in interface BookmarkStoresubId - The subscription ID of the most recent bookmark.useList - In the case where the store has not received any persisted
acks, it will build a list of bookmarks based on the last
discarded for each publisher if true (default).public boolean isDiscarded(Message message)
BookmarkStoreisDiscarded in interface BookmarkStoremessage - Incoming message used to determine if the application has
already processed and discarded the message.public void purge()
throws AMPSException
BookmarkStorepurge in interface BookmarkStoreAMPSException - Thrown if the store is unable to remove the contents.public void purge(Field subId_) throws AMPSException
BookmarkStorepurge in interface BookmarkStoresubId_ - The identifier of the subscription to purge. This tells
the method which subscription's data to clear.AMPSException - Thrown if the store is unable to remove information
for the subscription.public void persisted(Field subId, BookmarkField bookmark) throws AMPSException
BookmarkStorepersisted in interface BookmarkStoresubId - The subscription ID for the message.bookmark - The bookmark containing the message.AMPSException - Thrown if the store is unable to record information in
the store.public void persisted(Field subId, long bookmark) throws AMPSException
BookmarkStorepersisted in interface BookmarkStoresubId - The subscription ID for the message.bookmark - The bookmark sequence number.AMPSException - Thrown if the store is unable to record information in
the store.public long getOldestBookmarkSeq(Field subId) throws AMPSException
BookmarkStoregetOldestBookmarkSeq in interface BookmarkStoresubId - The subscription ID for the oldest bookmark in the store.AMPSException - Thrown if the operation of retrieving the oldest
bookmark sequence number encounters an issue or fails.public void setResizeHandler(BookmarkStoreResizeHandler handler)
BookmarkStoresetResizeHandler in interface BookmarkStorehandler - The handler to invoke for the resize.public void setServerVersion(int version_)
BookmarkStoresetServerVersion in interface BookmarkStoreversion_ - The version of the AMPS server.public void close()
close in interface java.lang.AutoCloseable