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
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classExtraction function which returns the entityID of the inputEntityDescriptor.static classExtraction function which simply returns the inputEntityDescriptor. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<EntityDescriptor,T> Function to extract the data item to be indexed from an EntityDescriptor.private Map<MetadataIndex,MetadataIndexStore<T>> Storage for secondary indexes.private org.slf4j.LoggerLogger. -
Constructor Summary
ConstructorsConstructorDescriptionMetadataIndexManager(Set<MetadataIndex> initIndexes, Function<EntityDescriptor, T> extractionFunction) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoiddeindexEntityDescriptor(EntityDescriptor descriptor) Remove from the index the specifiedEntityDescriptorbased on the indexes currently held.Get the set of allMetadataIndexinstances currently initialized.protected MetadataIndexStore<T>getStore(MetadataIndex index) Get theMetadataIndexStorefor the specifiedMetadataIndex.voidindexEntityDescriptor(EntityDescriptor descriptor) Index the specifiedEntityDescriptorbased on the indexes currently held.lookupIndexedItems(CriteriaSet criteria) Resolve the set of indexed data items based on the indexes currently held.
-
Field Details
-
log
private org.slf4j.Logger logLogger. -
indexes
Storage for secondary indexes. -
entityDescriptorFunction
Function to extract the data item to be indexed from an EntityDescriptor.
-
-
Constructor Details
-
MetadataIndexManager
public MetadataIndexManager(@Nullable @NonnullElements @Unmodifiable @NotLive Set<MetadataIndex> initIndexes, @Nonnull Function<EntityDescriptor, T> extractionFunction) Constructor.- Parameters:
initIndexes- indexes for which to initialize storageextractionFunction- function to extract the indexed data item from an EntityDescriptor
-
-
Method Details
-
getIndexes
Get the set of allMetadataIndexinstances currently initialized.- Returns:
- the set of all current indexes
-
getStore
Get theMetadataIndexStorefor the specifiedMetadataIndex.- 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
Resolve the set of indexed data items based on the indexes currently held.- Parameters:
criteria- the criteria set to process- Returns:
- an
Optionalinstance 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
Index the specifiedEntityDescriptorbased on the indexes currently held.- Parameters:
descriptor- the entity descriptor to index
-
deindexEntityDescriptor
Remove from the index the specifiedEntityDescriptorbased on the indexes currently held.- Parameters:
descriptor- the entity descriptor to index
-