Class CompositeIndexer

java.lang.Object
de.otto.synapse.messagestore.CompositeIndexer
All Implemented Interfaces:
Indexer

@Beta
public class CompositeIndexer
extends java.lang.Object
implements Indexer
An Indexer that is a composition of other Indexers.
  • Constructor Summary

    Constructors
    Constructor Description
    CompositeIndexer​(com.google.common.collect.ImmutableList<Indexer> indexers)
    Creates a CompositeIndex from a list of Indexers.
  • Method Summary

    Modifier and Type Method Description
    java.lang.String calc​(Index index, MessageStoreEntry entry)
    Calculates the Index value from the message-store entry.
    com.google.common.collect.ImmutableSet<Index> getIndexes()
    Returns the indexes supported by this Indexer.
    MessageStoreEntry index​(MessageStoreEntry entry)  
    boolean supports​(Index index)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CompositeIndexer

      public CompositeIndexer​(com.google.common.collect.ImmutableList<Indexer> indexers)
      Creates a CompositeIndex from a list of Indexers.

      If there are multiple Indexers responsible for the same Index, the first Indexer instance will be used and all other instances will not be used to calculate the Index.

      Parameters:
      indexers - the indexers used to build the composite
  • Method Details

    • getIndexes

      @Nonnull public com.google.common.collect.ImmutableSet<Index> getIndexes()
      Description copied from interface: Indexer
      Returns the indexes supported by this Indexer.
      Specified by:
      getIndexes in interface Indexer
      Returns:
      Set of Index instances
    • supports

      public boolean supports​(@Nonnull Index index)
      Specified by:
      supports in interface Indexer
      Parameters:
      index - the Index
      Returns:
      true, if the Index is supported, false otherwise.
    • calc

      public java.lang.String calc​(@Nonnull Index index, @Nonnull MessageStoreEntry entry)
      Description copied from interface: Indexer
      Calculates the Index value from the message-store entry.
      Specified by:
      calc in interface Indexer
      Parameters:
      index - the Index
      entry - the MessageStoreEntry
      Returns:
      indexed value
    • index

      @Nonnull public MessageStoreEntry index​(@Nonnull MessageStoreEntry entry)
      Specified by:
      index in interface Indexer