Package de.otto.synapse.messagestore
Class Index
- java.lang.Object
-
- de.otto.synapse.messagestore.Index
-
@Beta public class Index extends java.lang.ObjectIdentifies a single Index used by aMessageStoreto index messages using someIndexerIndexes could be used to access messages in the store that share some common properties. For example, the
partition-key indexis used to retrieve all messages that have the same partition key.You can introduce your own index by 1. introduce an instance of Index and 2. implement an
Indexerthat issupportingthe new Index.
-
-
Field Summary
Fields Modifier and Type Field Description static IndexCHANNEL_NAMEIndex that is used to access messages in aMessageStorebyMessageStoreEntry.getChannelName()static IndexJOURNAL_KEYstatic IndexORIGINIndex that is used to specify the origin of theMessageStoreEntry.static IndexPARTITION_KEYIndex that is used to access messages in aMessageStorebyKey.partitionKey()static IndexSERVICE_INSTANCEIndex that is used to specify the service instance that has added theMessageStoreEntryto theMessageStore.
-
Constructor Summary
Constructors Constructor Description Index(java.lang.String name)
-
-
-
Field Detail
-
CHANNEL_NAME
public static final Index CHANNEL_NAME
Index that is used to access messages in aMessageStorebyMessageStoreEntry.getChannelName()
-
ORIGIN
public static final Index ORIGIN
Index that is used to specify the origin of theMessageStoreEntry. Depending on the use-case, this might be a simple hint like, for example,"origin" : "Snapshot", or the name of the originating service.
-
SERVICE_INSTANCE
public static final Index SERVICE_INSTANCE
Index that is used to specify the service instance that has added theMessageStoreEntryto theMessageStore. The value can be something likehostname:portor some other identfier used to distinguish different instances of single service.
-
PARTITION_KEY
public static final Index PARTITION_KEY
Index that is used to access messages in aMessageStorebyKey.partitionKey()The
nameof the index is'partitionKey'
-
JOURNAL_KEY
public static final Index JOURNAL_KEY
-
-
Method Detail
-
valueOf
public static Index valueOf(java.lang.String name)
-
getName
@Nonnull public java.lang.String getName()
Returns the field name used to store the indexed value.The
nameis used byMessageStoreimplementations to generate datastructures used for the Index.- Returns:
- field name
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-