Class MetadataIndexManager<T>

java.lang.Object
org.opensaml.saml.metadata.resolver.index.impl.MetadataIndexManager<T>
Type Parameters:
T - the type of data being indexed
Direct Known Subclasses:
LockableMetadataIndexManager

public class MetadataIndexManager<T>
extends Object
High-level component which handles index and lookup of instances of particular type of data item, for example EntityDescriptor, based on a set of MetadataIndex instances currently held.
  • Field Details

    • log

      private org.slf4j.Logger log
      Logger.
    • indexes

      private Map<MetadataIndex,​MetadataIndexStore<T>> indexes
      Storage for secondary indexes.
    • entityDescriptorFunction

      private Function<EntityDescriptor,​T> entityDescriptorFunction
      Function to extract the data item to be indexed from an EntityDescriptor.
  • Constructor Details

  • Method Details

    • getIndexes

      @Nonnull @NonnullElements @Unmodifiable @NotLive public Set<MetadataIndex> getIndexes()
      Get the set of all MetadataIndex instances currently initialized.
      Returns:
      the set of all current indexes
    • getStore

      @Nullable protected MetadataIndexStore<T> getStore​(@Nonnull MetadataIndex index)
      Get the MetadataIndexStore for the specified MetadataIndex.
      Parameters:
      index - the index for which the store is desired
      Returns:
      the index store for the index, may be null if index was not initialized for this manager instance
    • lookupIndexedItems

      @Nonnull @NonnullElements public Optional<Set<T>> lookupIndexedItems​(@Nonnull CriteriaSet criteria)
      Resolve the set of indexed data items based on the indexes currently held.
      Parameters:
      criteria - the criteria set to process
      Returns:
      an Optional instance containing the indexed data items resolved via indexes, and based on the input criteria set. If the Optional instance indicates 'absent', there were either no indexes configured, or no criteria were applicable/understood by any indexes. If 'present' is indicated, then there were applicable/understood criteria, and the wrapped set contains the indexed data, which may be empty.
    • indexEntityDescriptor

      public void indexEntityDescriptor​(@Nonnull EntityDescriptor descriptor)
      Index the specified EntityDescriptor based on the indexes currently held.
      Parameters:
      descriptor - the entity descriptor to index
    • deindexEntityDescriptor

      public void deindexEntityDescriptor​(@Nonnull EntityDescriptor descriptor)
      Remove from the index the specified EntityDescriptor based on the indexes currently held.
      Parameters:
      descriptor - the entity descriptor to index