Class CollectionMessageStore
java.lang.Object
io.fluxzero.sdk.persisting.search.client.CollectionMessageStore
- All Implemented Interfaces:
Monitored<List<SerializedMessage>>, HasMessageStore, MessageStore, AutoCloseable
A
MessageStore implementation backed by a collection in an InMemorySearchStore. This class provides
functionality for tracking updated documents in a specific collection.
Used to support HandleDocument from in-memory search stores.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(List<SerializedMessage> messages) Appends a list of messages to the store.Retrieves a batch of messages starting from the givenminIndex.registerMonitor(Consumer<List<SerializedMessage>> monitor) Registers a monitor that will be notified when an activity of typeToccurs.voidsetRetentionTime(Duration retentionPeriod) Sets the retention period for messages.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface MessageStore
append, close, getBatch, getMessageStore, unwrap
-
Constructor Details
-
CollectionMessageStore
public CollectionMessageStore()
-
-
Method Details
-
getBatch
Description copied from interface:MessageStoreRetrieves a batch of messages starting from the givenminIndex.- Specified by:
getBatchin interfaceMessageStore- Parameters:
minIndex- minimum message index to start frommaxSize- maximum number of messages to retrieveinclusive- whether to include the message atminIndex- Returns:
- a list of
SerializedMessageinstances
-
registerMonitor
Description copied from interface:MonitoredRegisters a monitor that will be notified when an activity of typeToccurs.- Specified by:
registerMonitorin interfaceMonitored<List<SerializedMessage>>- Parameters:
monitor- the callback to invoke with each observed value- Returns:
- a
Registrationthat can be used to cancel the monitoring
-
append
Description copied from interface:MessageStoreAppends a list of messages to the store.- Specified by:
appendin interfaceMessageStore- Parameters:
messages- messages to append- Returns:
- a
CompletableFuturethat completes when the messages have been successfully appended
-
setRetentionTime
Description copied from interface:MessageStoreSets the retention period for messages. Messages older than this duration may be removed depending on the implementation.- Specified by:
setRetentionTimein interfaceMessageStore- Parameters:
retentionPeriod- duration to retain messages
-