public class DelegatingSnapshotMessageStore extends java.lang.Object implements SnapshotMessageStore
| Constructor and Description |
|---|
DelegatingSnapshotMessageStore(MessageStore delegate) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(MessageStoreEntry entry)
Deprecated.
Unsupported operation.
|
void |
close() |
java.util.Set<java.lang.String> |
getChannelNames()
Returns a set containing the channel names of the messages contained in the
MessageStore |
com.google.common.collect.ImmutableSet<Index> |
getIndexes() |
ChannelPosition |
getLatestChannelPosition()
Deprecated.
|
ChannelPosition |
getLatestChannelPosition(java.lang.String channelName)
Returns the latest
ChannelPosition of the given channel, derived from the messages contained in this
MessageStore. |
java.lang.String |
getName()
Returns the name of the message store.
|
java.time.Instant |
getSnapshotTimestamp() |
int |
size()
Returns the number of messages contained in the MessageStore.
|
java.util.stream.Stream<MessageStoreEntry> |
stream()
Returns a Stream of all entries contained in the MessageStore.
|
java.util.stream.Stream<MessageStoreEntry> |
stream(Index index,
java.lang.String value)
Returns a Stream of all entries contained in the MessageStore that have are matching the given Index value
(optional operation).
|
public DelegatingSnapshotMessageStore(MessageStore delegate)
public java.lang.String getName()
MessageStoreEspecially for persistent implementations, two MessageStore instances might use this property
to identify the underlying database, collection, file etc.
getName in interface MessageStorepublic java.time.Instant getSnapshotTimestamp()
getSnapshotTimestamp in interface SnapshotMessageStorepublic java.util.Set<java.lang.String> getChannelNames()
MessageStoreMessageStoregetChannelNames in interface MessageStorepublic com.google.common.collect.ImmutableSet<Index> getIndexes()
getIndexes in interface MessageStorepublic ChannelPosition getLatestChannelPosition(java.lang.String channelName)
MessageStoreChannelPosition of the given channel, derived from the messages contained in this
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 MessageStorechannelName - the name of the channel@Deprecated public ChannelPosition getLatestChannelPosition()
getLatestChannelPosition in interface MessageStorepublic java.util.stream.Stream<MessageStoreEntry> stream()
MessageStoreThe stream will maintain the insertion order of the entries.
stream in interface MessageStorepublic java.util.stream.Stream<MessageStoreEntry> stream(Index index, java.lang.String value)
MessageStoreThe stream will maintain the insertion order of the entries.
stream in interface MessageStoreindex - the Indexvalue - the value identifying the requested messages in the specified index@Deprecated
public void add(@Nonnull
MessageStoreEntry entry)
add in interface MessageStoreentry - element to be appended to this message storejava.lang.UnsupportedOperationException - alwayspublic 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