AMPS C# Client  5.3.5.0
AMPS C# Client for .NET
AMPS.Client.Store Interface Reference
+ Inheritance diagram for AMPS.Client.Store:

Public Member Functions

void store (Message message)
 
void discardUpTo (ulong sequence)
 
void replay (StoreReplayer replayer)
 
bool replaySingle (StoreReplayer replayer, ulong sequence)
 
long unpersistedCount ()
 
ulong getLastPersisted ()
 
void flush ()
 
void flush (int timeout)
 
void setMessage (Message message)
 
void setResizeHandler (PublishStoreResizeHandler handler)
 
void setErrorOnPublishGap (bool errorOnPublishGap_)
 
bool getErrorOnPublishGap ()
 

Detailed Description

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.

Member Function Documentation

◆ discardUpTo()

void AMPS.Client.Store.discardUpTo ( ulong  sequence)

Discard messages in the store, up to and including the message specified by the passed in sequnence number. This is called by the client when it's notified a message is persisted on the server.

Parameters
sequenceThe highest sequence number of the messages that can be safely discarded. The specified message and all prior messages are removed from the store.

Implemented in AMPS.Client.MemoryPublishStore, AMPS.Client.BlockPublishStore, and AMPS.Client.HybridPublishStore.

◆ flush() [1/2]

void AMPS.Client.Store.flush ( )

Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return.

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ flush() [2/2]

void AMPS.Client.Store.flush ( int  timeout)

Wait for the store to discard everything that has been stored up to the point in time when flush is called, then return. Throw an exception if this is not completed in the number of milliseconds specified by the timeout.

Parameters
timeoutthe number of milliseconds to wait for the flush
Exceptions
TimedOutExceptionIf the timeout period passes without the messages being discarded.

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ getErrorOnPublishGap()

bool AMPS.Client.Store.getErrorOnPublishGap ( )

Get if a PublishStoreGapException can be thrown by the Store if there is an attempt to call discardUpTo with a sequence number lower than the last persisted sequence number. This could occur during logon after a failover event if the new server was not current on messages due to being an async replication destination.

Returns
true if the exception will be thrown

Implemented in AMPS.Client.MemoryPublishStore, AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ getLastPersisted()

ulong AMPS.Client.Store.getLastPersisted ( )

Return the sequence of the last persisted message.

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ replay()

void AMPS.Client.Store.replay ( StoreReplayer  replayer)

Replay all unpersisted messages in the store using the provided StoreReplayer.

Parameters
replayerThe StoreReplayer used to replay undiscarded messages.

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ replaySingle()

bool AMPS.Client.Store.replaySingle ( StoreReplayer  replayer,
ulong  sequence 
)

Replay the unpersisted message with the specified sequence.

Parameters
replayerThe StoreReplayer used to replay the specified undiscarded message.
sequenceThe sequence number of the undiscarded message to replay.

Implemented in AMPS.Client.BlockPublishStore, and AMPS.Client.HybridPublishStore.

◆ setErrorOnPublishGap()

void AMPS.Client.Store.setErrorOnPublishGap ( bool  errorOnPublishGap_)

Set if a PublishStoreGapException should be thrown by the Store if there is an attempt to call discardUpTo with a sequence number lower than the last persisted sequence number. This could occur during logon after a failover event if the new server was not current on messages due to being an async replication destination.

Parameters
errorOnPublishGap_Indicates if the exception should be thrown

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ setMessage()

void AMPS.Client.Store.setMessage ( Message  message)

Used internally by the Client to give the store a Message implementing the correct protocol for the connection. This Message instance is also used for replay operations.

Implemented in AMPS.Client.BlockPublishStore, and AMPS.Client.HybridPublishStore.

◆ setResizeHandler()

void AMPS.Client.Store.setResizeHandler ( PublishStoreResizeHandler  handler)

Set the resize handler for the publish store. An implementation can call the resize handler in the event that it needs to grow the size of the publish store.

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ store()

void AMPS.Client.Store.store ( Message  message)

Store the provided message. The message sequence is the key the client can later use to replay the operation or remove the operation from the store. Implementations may assume that the index increases monotonically.

Parameters
messageThe message to store.

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.

◆ unpersistedCount()

long AMPS.Client.Store.unpersistedCount ( )

Return the number of unpersisted messages in the store.

Implemented in AMPS.Client.HybridPublishStore, and AMPS.Client.BlockPublishStore.


The documentation for this interface was generated from the following file: