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

# Class FunctionDrivenDynamicHTTPMetadataResolver

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.AbstractDynamicHTTPMetadataResolver
org.opensaml.saml.metadata.resolver.impl.FunctionDrivenDynamicHTTPMetadataResolver

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

public class FunctionDrivenDynamicHTTPMetadataResolver extends AbstractDynamicHTTPMetadataResolver implements RemoteMetadataResolver
Simple implementation of an HTTP-based dynamic metadata resolver which builds the request URL to process based on a `Function` instance.

The function defaults to an instance of `HTTPEntityIDRequestURLBuilder`, thereby implementing the "well-known location" resolution mechanism defined in the SAML 2 metadata specification if the entity ID is an HTTP or HTTPS URL.

## Nested Class Summary

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

`AbstractDynamicHTTPMetadataResolver.BasicMetadataResponseHandler`

## 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 final org.slf4j.Logger`
`log`
Logger.
`private Function<CriteriaSet,String>`
`requestURLBuilder`
Function for building the request URL.

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

`DEFAULT_CONTENT_TYPES, MDC_ATTRIB_CURRENT_REQUEST_URI`

### 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
`FunctionDrivenDynamicHTTPMetadataResolver(Timer backgroundTaskTimer, org.apache.hc.client5.http.classic.HttpClient client)`
Constructor.
`FunctionDrivenDynamicHTTPMetadataResolver(org.apache.hc.client5.http.classic.HttpClient client)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected String`
`buildRequestURL(CriteriaSet criteria)`
Build the request URL based on the input criteria set.
`String`
`getMetadataURI()`
Gets the URI from which this resolver is obtaining metadata.
`Function<CriteriaSet,String>`
`getRequestURLBuilder()`
Get the function which builds the request URL.
`void`
`setRequestURLBuilder(Function<CriteriaSet,String> builder)`
Set the function which builds the request URL.

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

`buildHttpClientContext, buildHttpRequest, doDestroy, fetchFromOriginSource, getHttpClientSecurityParameters, getSupportedContentTypes, getSupportedMediaTypes, initMetadataResolver, setHttpClientSecurityParameters, setSupportedContentTypes`

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

`clear, clear, computeExpirationTime, computeRefreshTriggerTime, createNewBackingStore, doResolve, ensureBackingStore, ensurePersistentCacheManager, getBackgroundInitializationFromCacheDelay, getBackingStore, getCleanupTaskInterval, getExpirationWarningThreshold, getIndexes, getInitializationFromCachePredicate, getMaxCacheDuration, getMaxIdleEntityData, getMinCacheDuration, getNegativeLookupCacheDuration, getPersistentCacheKeyGenerator, getPersistentCacheManager, getRefreshDelayFactor, indexEntityDescriptor, indexesEnabled, initializeFromPersistentCache, isInitializeFromPersistentCacheInBackground, isPersistentCachingEnabled, isRemoveIdleEntityData, lookupCriteria, lookupEntityID, prepareForFiltering, preProcessEntityDescriptor, processNewMetadata, processNewMetadata, processNonEntityIDFetchedEntittiesDescriptor, processNonEntityIDFetchedEntityDescriptor, processPersistentCacheEntry, removeByEntityID, 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 final org.slf4j.Logger log
Logger.

### requestURLBuilder

@Nonnull private Function<CriteriaSet,String> requestURLBuilder
Function for building the request URL.

## Constructor Details

### FunctionDrivenDynamicHTTPMetadataResolver

public FunctionDrivenDynamicHTTPMetadataResolver(@Nonnull org.apache.hc.client5.http.classic.HttpClient client)
Constructor.

Parameters:
  `client` - the instance of `HttpClient` used to fetch remote metadata

### FunctionDrivenDynamicHTTPMetadataResolver

public FunctionDrivenDynamicHTTPMetadataResolver(@Nullable Timer backgroundTaskTimer, @Nonnull org.apache.hc.client5.http.classic.HttpClient client)
Constructor.

Parameters:
  `backgroundTaskTimer` - the `Timer` instance used to run resolver background managment tasks
  `client` - the instance of `HttpClient` used to fetch remote metadata

## Method Details

### getRequestURLBuilder

@Nonnull public Function<CriteriaSet,String> getRequestURLBuilder()
Get the function which builds the request URL.

Defaults to an instance of `HTTPEntityIDRequestURLBuilder`.

Returns:
  the request URL builder function instance

### setRequestURLBuilder

public void setRequestURLBuilder(@Nonnull Function<CriteriaSet,String> builder)
Set the function which builds the request URL.

Defaults to an instance of `HTTPEntityIDRequestURLBuilder`.

Parameters:
  `builder` - the request URL builder function instance

### buildRequestURL

@Nullable protected String buildRequestURL(@Nullable CriteriaSet criteria)
Build the request URL based on the input criteria set.

Specified by:
  `buildRequestURL` in class `AbstractDynamicHTTPMetadataResolver`
Parameters:
  `criteria` - the input criteria set
Returns:
  the request URL, or null if it can not be built based on the supplied criteria

### getMetadataURI

@Nullable public String getMetadataURI()
Gets the URI from which this resolver is obtaining metadata.

Specified by:
  `getMetadataURI` in interface `RemoteMetadataResolver`
Returns:
  URL source of metadata