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 class
Extraction function which returns the entityID of the inputEntityDescriptor
.static class
Extraction 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.Logger
Logger. -
Constructor Summary
ConstructorsConstructorDescriptionMetadataIndexManager
(Set<MetadataIndex> initIndexes, Function<EntityDescriptor, T> extractionFunction) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
deindexEntityDescriptor
(EntityDescriptor descriptor) Remove from the index the specifiedEntityDescriptor
based on the indexes currently held.Get the set of allMetadataIndex
instances currently initialized.protected MetadataIndexStore<T>
getStore
(MetadataIndex index) Get theMetadataIndexStore
for the specifiedMetadataIndex
.void
indexEntityDescriptor
(EntityDescriptor descriptor) Index the specifiedEntityDescriptor
based 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 allMetadataIndex
instances currently initialized.- Returns:
- the set of all current indexes
-
getStore
Get theMetadataIndexStore
for 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
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
Index the specifiedEntityDescriptor
based on the indexes currently held.- Parameters:
descriptor
- the entity descriptor to index
-
deindexEntityDescriptor
Remove from the index the specifiedEntityDescriptor
based on the indexes currently held.- Parameters:
descriptor
- the entity descriptor to index
-