public class DelegatingSnapshotMessageStore extends java.lang.Object implements SnapshotMessageStore
| Constructor and Description |
|---|
DelegatingSnapshotMessageStore(MessageStore delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ChannelPosition |
getLatestChannelPosition()
Returns the latest
ChannelPosition of the MessageStore. |
java.time.Instant |
getSnapshotTimestamp() |
int |
size()
Returns the number of messages contained in the MessageStore.
|
java.util.stream.Stream<Message<java.lang.String>> |
stream()
Returns a Stream of
messages contained in the MessageStore. |
public DelegatingSnapshotMessageStore(MessageStore delegate)
public java.time.Instant getSnapshotTimestamp()
getSnapshotTimestamp in interface SnapshotMessageStorepublic ChannelPosition getLatestChannelPosition()
MessageStoreChannelPosition of the MessageStore.
The position is calculated by merging the
optional positions of the messages.
Messages without positions will not change the latest ChannelPosition. If no message contains
position information, the returned ChannelPosition is ChannelPosition.fromHorizon()
getLatestChannelPosition in interface MessageStorepublic java.util.stream.Stream<Message<java.lang.String>> stream()
MessageStoremessages contained in the MessageStore.
The stream will maintain the insertion order of the messages.
stream in interface MessageStorepublic int size()
MessageStorePrimarily used for testing purposes. If the MessageStore can not implement this without major performance impacts (like, for example, having to download and parse huge files from S3), the method is not required to be implemented.
size in interface MessageStorepublic void close()
close in interface MessageStoreclose in interface java.lang.AutoCloseable