public final class MessageStoreEntry
extends java.lang.Object
implements java.io.Serializable
MessageStore which is a TextMessage stored with some extra data about the origin
of the message.| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
java.lang.String |
getChannelName()
Returns the channel name of the channel that was used to transmit the
message. |
com.google.common.collect.ImmutableMap<Index,java.lang.String> |
getFilterValues()
Extra filtering information about the entry.
|
TextMessage |
getTextMessage()
The message transmitted over the
channel |
int |
hashCode() |
static MessageStoreEntry |
of(java.lang.String channelName,
com.google.common.collect.ImmutableMap<Index,java.lang.String> filterValues,
TextMessage textMessage)
Creates a new entry from
channelName, filterValues and the textMessage. |
static MessageStoreEntry |
of(java.lang.String channelName,
TextMessage textMessage)
Creates a new entry from
channelName and the textMessage. |
java.lang.String |
toString() |
public static MessageStoreEntry of(@Nonnull java.lang.String channelName, @Nonnull TextMessage textMessage)
channelName and the textMessage.channelName - the name of the channel that was the origin of the TextMessagetextMessage - the TextMessage of the MessageStoreEntrypublic static MessageStoreEntry of(@Nonnull java.lang.String channelName, @Nonnull com.google.common.collect.ImmutableMap<Index,java.lang.String> filterValues, @Nonnull TextMessage textMessage)
channelName, filterValues and the textMessage.
The filterValues parameter contains extra information about the entry. The values will
typically be created by one or more Indexers, when the MessageStoreEntry
is added to an indexing MessageStore like, for example, RedisIndexedMessageStore.
Especially in distributed MessageStore implementations, with multiple consumers listening at
a single channel, this information can be used to fetch messages that was added to the
MessageStore by a single service.
channelName - the name of the channel that was the origin of the TextMessagefilterValues - extra information used to filter entriestextMessage - the TextMessage of the MessageStoreEntry@Nonnull public java.lang.String getChannelName()
message.@Nonnull public com.google.common.collect.ImmutableMap<Index,java.lang.String> getFilterValues()
The values will typically be created by one or more Indexers, when the
MessageStoreEntry is added to an indexing MessageStore like, for example,
RedisIndexedMessageStore.
The keys of the filter values should be derived from Index.getName() ()} of the index
updated by the Indexer.
@Nonnull public TextMessage getTextMessage()
channelpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object