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.time.Instant |
getSnapshotTimestamp() |
long |
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).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isCompacting
public DelegatingSnapshotMessageStore(MessageStore delegate)
public java.time.Instant getSnapshotTimestamp()
getSnapshotTimestamp
in interface SnapshotMessageStore
public java.util.Set<java.lang.String> getChannelNames()
MessageStore
MessageStore
getChannelNames
in interface MessageStore
public com.google.common.collect.ImmutableSet<Index> getIndexes()
getIndexes
in interface MessageStore
public ChannelPosition getLatestChannelPosition(java.lang.String channelName)
MessageStore
ChannelPosition
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 MessageStore
channelName
- the name of the channel@Deprecated public ChannelPosition getLatestChannelPosition()
getLatestChannelPosition
in interface MessageStore
public java.util.stream.Stream<MessageStoreEntry> stream()
MessageStore
The stream will maintain the insertion order of the entries.
stream
in interface MessageStore
public java.util.stream.Stream<MessageStoreEntry> stream(Index index, java.lang.String value)
MessageStore
The stream will maintain the insertion order of the entries.
stream
in interface MessageStore
index
- the Indexvalue
- the value identifying the requested messages in the specified index@Deprecated public void add(@Nonnull MessageStoreEntry entry)
add
in interface MessageStore
entry
- element to be appended to this message storejava.lang.UnsupportedOperationException
- alwayspublic long size()
MessageStore
Primarily 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 MessageStore
public void close()
close
in interface MessageStore
close
in interface java.lang.AutoCloseable