public interface Store
extends java.lang.AutoCloseable
Modifier and Type | Interface and Description |
---|---|
static interface |
Store.StoreReplayer
Replay the messages saved in a store.
|
Modifier and Type | Field and Description |
---|---|
static int |
SOWDeleteByBookmark |
static int |
SOWDeleteByBookmarkCancel |
static int |
SOWDeleteByData |
static int |
SOWDeleteByFilter |
static int |
SOWDeleteByKeys |
Modifier and Type | Method and Description |
---|---|
void |
discardUpTo(long index)
Discard all operations up to the index provided.
|
void |
flush()
Wait for the store to discard everything that has been stored
up to the point in time when flush is called, then
return.
|
void |
flush(long timeout)
Wait for the store to discard everything that has been stored
up to the point in time when flush is called, then
return.
|
boolean |
getErrorOnPublishGap()
Get whether the Store will throw a PublishGapException from discardUpTo if the
sequence number being discarded is less then the current last persisted.
|
long |
getLastPersisted()
Return the last persisted index in the store.
|
long |
getLowestUnpersisted()
Return the oldest index in the store.
|
void |
replay(Store.StoreReplayer replayer)
Replay all operations in the store using the provided StoreReplayer.
|
boolean |
replaySingle(Store.StoreReplayer replayer,
long index)
Replay the operation at the specified index.
|
void |
setErrorOnPublishGap(boolean errorOnGap)
Set whether the Store should throw a PublishGapException from discardUpTo if the
sequence number being discarded is less then the current last persisted.
|
void |
setMessage(Message m)
Provide the Store with a preallocated Message for use in replay.
|
void |
setResizeHandler(PublishStoreResizeHandler handler)
Set the resize handler for the publish store.
|
void |
store(Message m)
Store the provided message.
|
long |
unpersistedCount()
Return the number of operations in the store.
|
static final int SOWDeleteByData
static final int SOWDeleteByFilter
static final int SOWDeleteByKeys
static final int SOWDeleteByBookmark
static final int SOWDeleteByBookmarkCancel
void store(Message m) throws StoreException
m
- the message to storeStoreException
- Thrown if the Store is unable to store the message.void discardUpTo(long index) throws StoreException
index
- the index number to keep -- all previous index numbers will be discardedStoreException
- Thrown if the Store is unable to discard the messages.void replay(Store.StoreReplayer replayer) throws StoreException, DisconnectedException
replayer
- the StoreReplayer to use to replay the operationsStoreException
- Thrown if the Store is unable to replay the operations.DisconnectedException
- Thrown if the Store receives a DisconnectedException while replaying.boolean replaySingle(Store.StoreReplayer replayer, long index) throws StoreException, DisconnectedException
replayer
- the StoreReplayer to use to replay the operationsindex
- The index of the message to replay within the storeStoreException
- Thrown if the Store is unable to replay the operations.DisconnectedException
- Thrown if the Store receives a DisconnectedException while replaying.long unpersistedCount()
long getLowestUnpersisted()
void flush() throws TimedOutException
TimedOutException
- Not thrown from this overload.void flush(long timeout) throws TimedOutException
timeout
- the number of milliseconds to wait for the flushTimedOutException
- Thrown if the timeout period passes without the messages being discarded.void setResizeHandler(PublishStoreResizeHandler handler)
handler
- The handler to install.long getLastPersisted() throws StoreException
StoreException
- Thrown if the store is unable to produce the last persisted index.void setMessage(Message m)
m
- The message object for the Store to use during replay.boolean getErrorOnPublishGap()
void setErrorOnPublishGap(boolean errorOnGap)
errorOnGap
- If true, an exception will be thrown during logon if a gap could be
created. If false, allow the logon to proceed.