public interface RecoveryPointAdapter extends java.util.Iterator<RecoveryPoint>, java.lang.Iterable<RecoveryPoint>, java.lang.AutoCloseable
MemoryBookmarkStore
when it's constructed to persist recovery bookmark
state for each bookmark replay subscription. The adapter can persist this
state to an external store and retrieve it on application restart so that
bookmark replay subscriptions can be continued approximately where they
left off (with the possible delivery of some duplicate messages).
Typically the constructor of any implementation class will take resources
needed to connect to / authenticate with the external store and a unique
AMPS client name or session name (that stays consistent across application
runs) that identifies the AMPS client whose bookmark replay subscriptions
want to have their recovery state persisted by this adapter.Modifier and Type | Method and Description |
---|---|
void |
purge()
This method is called by the associated bookmark store's purge()
method (with the bookmark store lock held) with the expectation that
the adapter will delete all recover point data stored for all
subscriptions known to this adapter.
|
void |
purge(Field subId)
This method is called by the associated bookmark store's purge(subId)
method (with the bookmark store lock held) with the expectation that
the adapter will delete any recover point data stored for the
specified subscription id.
|
void |
update(RecoveryPoint recoveryPoint)
This method should be implemented to write the passed in recovery point
to the external store for the specified subscription.
|
void update(RecoveryPoint recoveryPoint) throws java.lang.Exception
ConflatingRecoveryPointAdapter
, then this method
is only called by the conflating adapter's update thread periodically
(never concurrently by multiple threads) without the subscription lock
held.recoveryPoint
- The latest recovery point.java.lang.Exception
- Should be thrown for any error writing recovery
state to the external store.void purge(Field subId) throws java.lang.Exception
subId
- The id of the subscription being purged.java.lang.Exception
- Should be thrown for any error deleting recovery
state from the external store.BookmarkStore.purge(com.crankuptheamps.client.fields.Field)
void purge() throws java.lang.Exception
java.lang.Exception
- Should be thrown for any error deleting recovery
state from the external store.BookmarkStore.purge()