|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Store
Represents a message store. The AMPS client uses message stores for recovery purposes. The store is responsible for maintaining the state of published messages and recovering that state in the event of a disconnection. Optionally, the store may persist message state and recover that state if the application restarts.
Nested Class Summary | |
---|---|
static interface |
Store.StoreReplayer
Replay the messages saved in a store. |
Field Summary | |
---|---|
static int |
SOWDeleteByData
|
static int |
SOWDeleteByFilter
|
static int |
SOWDeleteByKeys
|
Method Summary | |
---|---|
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. |
long |
getLowestUnpersisted()
Return the oldest index in the store. |
void |
replay(Store.StoreReplayer replayer)
Replay all operations in the store using the provided StoreReplayer. |
void |
replaySingle(Store.StoreReplayer replayer,
long index)
Replay the operation at the specified index. |
void |
setResizeHandler(PublishStoreResizeHandler handler)
Set the resize handler for the publish store. |
void |
store(long index,
int operation,
byte[] topic,
long topicOffset,
long topicLength,
byte[] data,
long dataOffset,
long dataLength,
byte[] correlationId,
long correlationIdOffset,
long correlationIdLength)
Store the provided operation. |
void |
store(long index,
int operation,
byte[] topic,
long topicOffset,
long topicLength,
byte[] data,
long dataOffset,
long dataLength,
byte[] correlationId,
long correlationIdOffset,
long correlationIdLength,
int expiration)
Store the provided operation. |
void |
store(long index,
int operation,
byte[] topic,
long topicOffset,
long topicLength,
byte[] data,
long dataOffset,
long dataLength,
int expiration,
CommandId cmdId)
Store the provided operation. |
long |
unpersistedCount()
Return the number of operations in the store. |
Field Detail |
---|
static final int SOWDeleteByData
static final int SOWDeleteByFilter
static final int SOWDeleteByKeys
Method Detail |
---|
void store(long index, int operation, byte[] topic, long topicOffset, long topicLength, byte[] data, long dataOffset, long dataLength, byte[] correlationId, long correlationIdOffset, long correlationIdLength) throws StoreException
index
- an index that identifies this operationoperation
- the operation to storetopic
- a byte array containing the name of the topic for this operationtopicOffset
- the offset in the topic array where the topic name beginstopicLength
- the length of the topic namedata
- a byte array containing the data for this operationdataOffset
- the offset into the data array where the data beginsdataLength
- the length of the datacorrelationId
- the correlation ID for this messagecorrelationIdOffset
- the offset into the correlation ID array where the correlation ID beginscorrelationIdLength
- the length of the correlation ID
StoreException
void store(long index, int operation, byte[] topic, long topicOffset, long topicLength, byte[] data, long dataOffset, long dataLength, byte[] correlationId, long correlationIdOffset, long correlationIdLength, int expiration) throws StoreException
index
- an index that identifies this operationoperation
- the operation to storetopic
- a byte array containing the name of the topic for this operationtopicOffset
- the offset in the topic array where the topic name beginstopicLength
- the length of the topic namedata
- a byte array containing the data for this operationdataOffset
- the offset into the data array where the data beginsdataLength
- the length of the dataexpiration
- the expiration to set on the operationcorrelationId
- the correlation ID for this messagecorrelationIdOffset
- the offset into the correlation ID array where the correlation ID beginscorrelationIdLength
- the length of the correlation ID
StoreException
void store(long index, int operation, byte[] topic, long topicOffset, long topicLength, byte[] data, long dataOffset, long dataLength, int expiration, CommandId cmdId) throws StoreException
index
- an index that identifies this operationoperation
- the operation to storetopic
- a byte array containing the name of the topic for this operationtopicOffset
- the offset in the topic array where the topic name beginstopicLength
- the length of the topic namedata
- a byte array containing the data for this operationdataOffset
- the offset into the data array where the data beginsdataLength
- the length of the dataexpiration
- the expiration to set on the operationcmdId
- the commandId to set on the operation
StoreException
void discardUpTo(long index) throws StoreException
index
- the index number to keep -- all previous index numbers will be discarded
StoreException
void replay(Store.StoreReplayer replayer) throws StoreException, DisconnectedException
replayer
- the StoreReplayer to use to replay the operations
StoreException
DisconnectedException
void replaySingle(Store.StoreReplayer replayer, long index) throws StoreException, DisconnectedException
StoreException
DisconnectedException
long unpersistedCount()
long getLowestUnpersisted()
void flush() throws TimedOutException
TimedOutException
void flush(long timeout) throws TimedOutException
timeout
- the number of milliseconds to wait for the flush
TimedOutException
void setResizeHandler(PublishStoreResizeHandler handler)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |