Package org.opensaml.saml.metadata.resolver.impl

# Class LocalDynamicMetadataResolver

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver
org.opensaml.saml.metadata.resolver.impl.AbstractDynamicMetadataResolver
org.opensaml.saml.metadata.resolver.impl.LocalDynamicMetadataResolver

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `IdentifiableComponent`, `IdentifiedComponent`, `InitializableComponent`, `Resolver<EntityDescriptor,CriteriaSet>`, `ClearableMetadataResolver`, `DynamicMetadataResolver`, `MetadataResolver`

public class LocalDynamicMetadataResolver extends AbstractDynamicMetadataResolver
Resolver which dynamically resolves metadata from a local source managed by an instance of `XMLObjectLoadSaveManager`.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.opensaml.saml.metadata.resolver.impl.AbstractDynamicMetadataResolver

`AbstractDynamicMetadataResolver.BackingStoreCleanupSweeper, AbstractDynamicMetadataResolver.DefaultCacheKeyGenerator, AbstractDynamicMetadataResolver.DynamicEntityBackingStore, AbstractDynamicMetadataResolver.EntityManagementData, AbstractDynamicMetadataResolver.PersistentCacheInitializationMetrics`

## Nested classes/interfaces inherited from class org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver

`AbstractMetadataResolver.EntityBackingStore`

## Field Summary

Fields
Modifier and Type
Field
Description
`private org.slf4j.Logger`
`log`
Logger.
`private Function<CriteriaSet,String>`
`sourceKeyGenerator`
Function for generating the String key used with the source manager.
`private XMLObjectLoadSaveManager<XMLObject>`
`sourceManager`
The manager for the local store of metadata.

### Fields inherited from class org.opensaml.saml.metadata.resolver.impl.AbstractDynamicMetadataResolver

`METRIC_GAUGE_NUM_LIVE_ENTITYIDS, METRIC_GAUGE_PERSISTENT_CACHE_INIT, METRIC_RATIOGAUGE_FETCH_TO_RESOLVE, METRIC_TIMER_FETCH_FROM_ORIGIN_SOURCE, METRIC_TIMER_RESOLVE`

## Constructor Summary

Constructors
Constructor
Description
`LocalDynamicMetadataResolver(Timer backgroundTaskTimer, XMLObjectLoadSaveManager<XMLObject> manager, Function<CriteriaSet,String> keyGenerator)`
Constructor.
`LocalDynamicMetadataResolver(XMLObjectLoadSaveManager<XMLObject> manager)`
Constructor.
`LocalDynamicMetadataResolver(XMLObjectLoadSaveManager<XMLObject> manager, Function<CriteriaSet,String> keyGenerator)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected XMLObject`
`fetchFromOriginSource(CriteriaSet criteria)`
Fetch the metadata from the origin source.
`protected void`
`removeByEntityID(String entityID, AbstractMetadataResolver.EntityBackingStore backingStore)`
Remove from the backing store all metadata for the entity with the given entity ID.

### Methods inherited from class org.opensaml.saml.metadata.resolver.impl.AbstractDynamicMetadataResolver

`clear, clear, computeExpirationTime, computeRefreshTriggerTime, createNewBackingStore, doDestroy, doResolve, ensureBackingStore, ensurePersistentCacheManager, getBackgroundInitializationFromCacheDelay, getBackingStore, getCleanupTaskInterval, getExpirationWarningThreshold, getIndexes, getInitializationFromCachePredicate, getMaxCacheDuration, getMaxIdleEntityData, getMinCacheDuration, getNegativeLookupCacheDuration, getPersistentCacheKeyGenerator, getPersistentCacheManager, getRefreshDelayFactor, indexEntityDescriptor, indexesEnabled, initializeFromPersistentCache, initMetadataResolver, isInitializeFromPersistentCacheInBackground, isPersistentCachingEnabled, isRemoveIdleEntityData, lookupCriteria, lookupEntityID, prepareForFiltering, preProcessEntityDescriptor, processNewMetadata, processNewMetadata, processNonEntityIDFetchedEntittiesDescriptor, processNonEntityIDFetchedEntityDescriptor, processPersistentCacheEntry, resolveEntityID, resolveEntityIDs, resolveFromOriginSource, resolveFromOriginSourceWithEntityID, resolveFromOriginSourceWithoutEntityID, setBackgroundInitializationFromCacheDelay, setCleanupTaskInterval, setExpirationWarningThreshold, setIndexes, setInitializationFromCachePredicate, setInitializeFromPersistentCacheInBackground, setMaxCacheDuration, setMaxIdleEntityData, setMinCacheDuration, setNegativeLookupCacheDuration, setPersistentCacheKeyGenerator, setPersistentCacheManager, setRefreshDelayFactor, setRemoveIdleEntityData, shouldAttemptRefresh`

### Methods inherited from class org.opensaml.saml.metadata.resolver.impl.AbstractMetadataResolver

`doInitialize, filterMetadata, getActivationCondition, getCriterionPredicateRegistry, getLogPrefix, getMetadataFilter, getMetricsBaseName, getParserPool, getType, getUnmarshallerFactory, isFailFastInitialization, isRequireValidMetadata, isSatisfyAnyPredicates, isUseDefaultPredicateRegistry, isValid, lookupIndexedEntityID, newFilterContext, predicateFilterCandidates, preProcessEntitiesDescriptor, releaseMetadataDOM, resolve, resolveSingle, setActivationCondition, setBackingStore, setCriterionPredicateRegistry, setFailFastInitialization, setMetadataFilter, setMetricsBaseName, setParserPool, setRequireValidMetadata, setSatisfyAnyPredicates, setType, setUseDefaultPredicateRegistry, unmarshallMetadata`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent

`setId`

### Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent

`ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, 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.shared.component.IdentifiedComponent

`getId`

### Methods inherited from interface org.opensaml.saml.metadata.resolver.MetadataResolver

`getMetadataFilter, getType, isRequireValidMetadata, setMetadataFilter, setRequireValidMetadata`

### Methods inherited from interface net.shibboleth.shared.resolver.Resolver

`resolve, resolveSingle`

## Field Details

### log

@Nonnull private org.slf4j.Logger log
Logger.

### sourceManager

@Nonnull private XMLObjectLoadSaveManager<XMLObject> sourceManager
The manager for the local store of metadata.

### sourceKeyGenerator

@Nonnull private Function<CriteriaSet,String> sourceKeyGenerator
Function for generating the String key used with the source manager.

## Constructor Details

### LocalDynamicMetadataResolver

public LocalDynamicMetadataResolver(@Nonnull XMLObjectLoadSaveManager<XMLObject> manager)
Constructor.

Source key generator will be an internal instance of `DefaultLocalDynamicSourceKeyGenerator`, with all default parameters.

Parameters:
  `manager` - the manager for the local source of metadata

### LocalDynamicMetadataResolver

public LocalDynamicMetadataResolver(@Nonnull XMLObjectLoadSaveManager<XMLObject> manager, @Nullable Function<CriteriaSet,String> keyGenerator)
Constructor.

Parameters:
  `manager` - the manager for the local source of metadata
  `keyGenerator` - the source key generator function

### LocalDynamicMetadataResolver

public LocalDynamicMetadataResolver(@Nullable Timer backgroundTaskTimer, @Nonnull XMLObjectLoadSaveManager<XMLObject> manager, @Nullable Function<CriteriaSet,String> keyGenerator)
Constructor.

If the supplied source key generator is null, an internal instance of `DefaultLocalDynamicSourceKeyGenerator` will be used, with all default parameters.

Parameters:
  `backgroundTaskTimer` - timer for management of background tasks
  `manager` - the manager for the local source of metadata
  `keyGenerator` - the source key generator function

## Method Details

### removeByEntityID

protected void removeByEntityID(@Nonnull String entityID, @Nonnull AbstractMetadataResolver.EntityBackingStore backingStore)
Remove from the backing store all metadata for the entity with the given entity ID.

Overrides:
  `removeByEntityID` in class `AbstractDynamicMetadataResolver`
Parameters:
  `entityID` - the entity ID of the metadata to remove
  `backingStore` - the backing store instance to update

### fetchFromOriginSource

@Nullable protected XMLObject fetchFromOriginSource(@Nullable CriteriaSet criteria) throws IOException
Fetch the metadata from the origin source.

Specified by:
  `fetchFromOriginSource` in class `AbstractDynamicMetadataResolver`
Parameters:
  `criteria` - the input criteria set
Returns:
  the resolved metadata root XMLObject, or null if metadata could not be fetched
Throws:
  `IOException` - if there is a fatal error fetching metadata from the origin source