Class FetchThroughMetadataCache<IdentifierType,MetadataType>
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
-
- net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
-
- net.shibboleth.oidc.metadata.cache.impl.AbstractMetadataCache<IdentifierType,MetadataType>
-
- net.shibboleth.oidc.metadata.cache.impl.FetchThroughMetadataCache<IdentifierType,MetadataType>
-
- Type Parameters:
IdentifierType- the metadata identifier type.MetadataType- the metadata type.
- All Implemented Interfaces:
MetadataCache<MetadataType>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
@ThreadSafe public class FetchThroughMetadataCache<IdentifierType,MetadataType> extends AbstractMetadataCache<IdentifierType,MetadataType>
Ametadata cacheimplementation that does not support reading and writing to a backing store. Entries are fetched, validated, and filtered before being returned to the caller. Each request always requires fetching and processing. This is not, therefore, a true cache, and is only useful for special cases which just want to exercise the fetch, validate, filter, cycle.
-
-
Field Summary
Fields Modifier and Type Field Description private Function<CriteriaSet,MetadataType>fetchStrategyThe function to use to fetch/load metadata entries.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFetchThroughMetadataCache()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()List<MetadataType>get(CriteriaSet criteria)voidsetFetchStrategy(Function<CriteriaSet,MetadataType> strategy)Set the metadata fetching strategy.-
Methods inherited from class net.shibboleth.oidc.metadata.cache.impl.AbstractMetadataCache
doDestroy, errorHandlingWrapper, freshLoad, getBackingStore, getCriteriaToIdentifierStrategy, getExecutorService, getIdentifierExtractionStrategy, getLogPrefix, getMetadataFilterStrategy, getMetadataValidPredicate, getRefreshDelayFactor, hasExpired, invalidate, invalidateAll, lookupIdentifier, lookupIndexedIdentifier, newFilterContext, setCriteriaToIdentifierStrategy, setIdentifierExtractionStrategy, setMetadataBeforeRemovalHook, setMetadataFilterStrategy, setMetadataValidPredicate, setRefreshDelayFactor, shouldAttemptRefresh, writeToBackingStore
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiableInitializableComponent
setId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
getId
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent
getId
-
-
-
-
Field Detail
-
log
private final org.slf4j.Logger log
Class logger.
-
fetchStrategy
@NonnullAfterInit private Function<CriteriaSet,MetadataType> fetchStrategy
The function to use to fetch/load metadata entries.
-
-
Method Detail
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractMetadataCache<IdentifierType,MetadataType>- Throws:
ComponentInitializationException
-
setFetchStrategy
public void setFetchStrategy(@Nonnull Function<CriteriaSet,MetadataType> strategy)Set the metadata fetching strategy.- Parameters:
strategy- the strategy used to fetch metadata using a 'read-through' semantic.
-
get
@Nonnull @NonnullElements @NotLive public List<MetadataType> get(@Nonnull @NotEmpty CriteriaSet criteria) throws MetadataCacheException
- Throws:
MetadataCacheException
-
-