|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.crankuptheamps.client.MemoryBookmarkStore
public class MemoryBookmarkStore
Implements a bookmark store useful for handling server failover scenarios, but without a backing store to recover from subscriber failure.
| Constructor Summary | |
|---|---|
MemoryBookmarkStore()
|
|
MemoryBookmarkStore(int targetNumberOfSubscriptions)
Initialize self with a target number of subscriptions to store |
|
| Method Summary | |
|---|---|
void |
discard(Field subId,
long bookmarkSeqNo)
Log a discard-bookmark entry to the persistent log based on a bookmark sequence number. |
void |
discard(Message message)
Log a discard-bookmark entry to the persistent log based on a Message. |
Field |
getMostRecent(Field subId)
Returns the most recent bookmark from the log that ought to be used for (re-)subscriptions. |
long |
getOldestBookmarkSeq(Field subId)
Called to retrieve the sequence number of the oldest bookmark in the store. |
boolean |
isDiscarded(Message message)
Called for each arriving message to determine if the application has already seen this bookmark and should not be reprocessed. |
long |
log(Message message)
Log a bookmark to the persistent log. |
void |
noPersistedAcks(Field subId)
Called internally to let the bookmark store know that the AMPS server version doesn't support persisted acks for bookmarks. |
void |
persisted(Field subId,
BookmarkField bookmark)
Called to mark a message as safely persisted by AMPS to all of its sync replication destination. |
void |
persisted(Field subId,
long bookmark)
Called to mark a message as safely persisted by AMPS to all of its sync replication destination. |
void |
purge()
Called to purge the contents of this store. |
void |
setResizeHandler(BookmarkStoreResizeHandler handler)
Called to set a resize handler that is invoked when the store needs to resize. |
void |
setServerVersion(int version)
Called by the Client when connected to an AMPS server to indicate what version the server is. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MemoryBookmarkStore()
public MemoryBookmarkStore(int targetNumberOfSubscriptions)
targetNumberOfSubscriptions - the number of subscriptions this store will need to track| Method Detail |
|---|
public long log(Message message)
throws AMPSException
BookmarkStore
log in interface BookmarkStoreAMPSException
public void discard(Field subId,
long bookmarkSeqNo)
throws AMPSException
BookmarkStore
discard in interface BookmarkStoreAMPSException
public void discard(Message message)
throws AMPSException
BookmarkStore
discard in interface BookmarkStoreAMPSException
public Field getMostRecent(Field subId)
throws AMPSException
BookmarkStore
getMostRecent in interface BookmarkStoreAMPSException
public boolean isDiscarded(Message message)
throws AMPSException
BookmarkStore
isDiscarded in interface BookmarkStoreAMPSException
public void persisted(Field subId,
long bookmark)
throws AMPSException
BookmarkStore
persisted in interface BookmarkStoreAMPSException
public void persisted(Field subId,
BookmarkField bookmark)
throws AMPSException
BookmarkStore
persisted in interface BookmarkStoreAMPSException
public void noPersistedAcks(Field subId)
throws AMPSException
BookmarkStore
noPersistedAcks in interface BookmarkStoreAMPSException
public void purge()
throws AMPSException
BookmarkStore
purge in interface BookmarkStoreAMPSException
public long getOldestBookmarkSeq(Field subId)
throws AMPSException
BookmarkStore
getOldestBookmarkSeq in interface BookmarkStoreAMPSExceptionpublic void setResizeHandler(BookmarkStoreResizeHandler handler)
BookmarkStore
setResizeHandler in interface BookmarkStorepublic void setServerVersion(int version)
BookmarkStore
setServerVersion in interface BookmarkStore
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||