Class MDQMetadataProvider
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
se.swedenconnect.opensaml.saml2.metadata.provider.AbstractMetadataProvider
se.swedenconnect.opensaml.saml2.metadata.provider.MDQMetadataProvider
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MetadataProvider
A
MetadataProvider that supports the MDQ
specification.
Note that getMetadata(), AbstractMetadataProvider.getServiceProviders() and AbstractMetadataProvider.getIdentityProviders() will only return
those entities that have been fetched from the server using AbstractMetadataProvider.getEntityDescriptor(String).
- Author:
- Martin Lindström (martin@idsec.se)
-
Nested Class Summary
Nested classes/interfaces inherited from class se.swedenconnect.opensaml.saml2.metadata.provider.AbstractMetadataProvider
AbstractMetadataProvider.EntityDescriptorIterator -
Constructor Summary
ConstructorsConstructorDescriptionMDQMetadataProvider(String metadataBaseUrl, org.apache.hc.client5.http.classic.HttpClient httpClient, String cacheBaseDir) Constructor setting up aMetadataProviderthat uses the MDQ protocol to download metadata for requested entities. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateMetadataResolver(boolean requireValidMetadata, boolean failFastInitialization, MetadataFilter filter) Creates the specificMetadataResolverinstance for the provider implementation.protected voidDestroys the metadata resolver.getID()Returns the identifier for the provider.Gets allEntityDescriptorobjects available in the cache and adds them to aEntitiesDescriptorobject.Returns the underlying OpenSAML metadata resolver.protected voidInitializes the metadata resolver.protected voidsetMetadata(XMLObject metadata) Assigns the metadata that was downloaded.Methods inherited from class se.swedenconnect.opensaml.saml2.metadata.provider.AbstractMetadataProvider
createFilter, doDestroy, doInitialize, getEntityDescriptor, getEntityDescriptor, getIdentityProviders, getLastUpdate, getMetadataDOM, getServiceProviders, getSignatureVerificationCertificates, iterator, iterator, refresh, setExclusionPredicates, setFailFastInitialization, setInclusionPredicates, setKeepOnlySpAndIdps, setPerformSchemaValidation, setRequireValidMetadata, setSignatureVerificationCertificate, setSignatureVerificationCertificatesMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Constructor Details
-
MDQMetadataProvider
public MDQMetadataProvider(@Nonnull String metadataBaseUrl, @Nullable org.apache.hc.client5.http.classic.HttpClient httpClient, @Nullable String cacheBaseDir) throws ResolverException Constructor setting up aMetadataProviderthat uses the MDQ protocol to download metadata for requested entities.- Parameters:
metadataBaseUrl- the base metadata URL (must not end with a /)httpClient- the HTTP client instance to use, if null,HTTPMetadataProvider.createDefaultHttpClient()is used to create a default clientcacheBaseDir- the base directory where caches will be stored, if null, the caches are kept in memory- Throws:
ResolverException- for failures setting up the underlyingMetadataResolver
-
-
Method Details
-
getID
Returns the identifier for the provider.- Returns:
- the identifier
-
getMetadata
Gets allEntityDescriptorobjects available in the cache and adds them to aEntitiesDescriptorobject.Note: The
MDQMetadataProviderversion of this method does not return all metadata entries available at the source. It only returns those that have been downloaded by the provider and are present in the cache.- Specified by:
getMetadatain interfaceMetadataProvider- Overrides:
getMetadatain classAbstractMetadataProvider- Returns:
- an XML element
-
setMetadata
Assigns the metadata that was downloaded.- Overrides:
setMetadatain classAbstractMetadataProvider- Parameters:
metadata- metadata object
-
getMetadataResolver
Returns the underlying OpenSAML metadata resolver.- Returns:
- OpenSAML metadata resolver
-
createMetadataResolver
protected void createMetadataResolver(boolean requireValidMetadata, boolean failFastInitialization, MetadataFilter filter) throws ResolverException Creates the specificMetadataResolverinstance for the provider implementation.The
filterparameter is aMetadataFilterthat must be installed for the resolver. Any other filters that should be installed by the specific instance should be placed last in a filter chain.- Specified by:
createMetadataResolverin classAbstractMetadataProvider- Parameters:
requireValidMetadata- should be passed intoMetadataResolver.setRequireValidMetadata(boolean)failFastInitialization- should be passed intoAbstractMetadataResolver.setFailFastInitialization(boolean)(if applicable)filter- filter that must be installed for the resolver- Throws:
ResolverException- for errors creating the resolver
-
initializeMetadataResolver
Initializes the metadata resolver.- Specified by:
initializeMetadataResolverin classAbstractMetadataProvider- Throws:
ComponentInitializationException- for initialization errors
-
destroyMetadataResolver
protected void destroyMetadataResolver()Destroys the metadata resolver.- Specified by:
destroyMetadataResolverin classAbstractMetadataProvider
-