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:
net.shibboleth.shared.component.Component, net.shibboleth.shared.component.DestructableComponent, net.shibboleth.shared.component.InitializableComponent, MetadataProvider

public class MDQMetadataProvider extends AbstractMetadataProvider
Author:
Martin Lindström (martin@idsec.se)
  • Constructor Details

    • MDQMetadataProvider

      public MDQMetadataProvider(@Nonnull String metadataBaseUrl, @Nullable org.apache.hc.client5.http.classic.HttpClient httpClient, @Nullable String cacheBaseDir) throws net.shibboleth.shared.resolver.ResolverException
      Constructor setting up a MetadataProvider that 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 client
      cacheBaseDir - the base directory where caches will be stored, if null, the caches are kept in memory
      Throws:
      net.shibboleth.shared.resolver.ResolverException - for failures setting up the underlying MetadataResolver
  • Method Details

    • getID

      public String getID()
      Returns the identifier for the provider.
      Returns:
      the identifier
    • getMetadata

      public org.opensaml.core.xml.XMLObject getMetadata()
      Gets all EntityDescriptor objects available in the cache and adds them to a EntitiesDescriptor object.

      Note: The MDQMetadataProvider version 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:
      getMetadata in interface MetadataProvider
      Overrides:
      getMetadata in class AbstractMetadataProvider
      Returns:
      an XML element
    • setMetadata

      protected void setMetadata(org.opensaml.core.xml.XMLObject metadata)
      Assigns the metadata that was downloaded.
      Overrides:
      setMetadata in class AbstractMetadataProvider
      Parameters:
      metadata - metadata object
    • getMetadataResolver

      public org.opensaml.saml.metadata.resolver.MetadataResolver getMetadataResolver()
      Returns the underlying OpenSAML metadata resolver.
      Returns:
      OpenSAML metadata resolver
    • createMetadataResolver

      protected void createMetadataResolver(boolean requireValidMetadata, boolean failFastInitialization, org.opensaml.saml.metadata.resolver.filter.MetadataFilter filter) throws net.shibboleth.shared.resolver.ResolverException
      Creates the specific MetadataResolver instance for the provider implementation.

      The filter parameter is a MetadataFilter that 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:
      createMetadataResolver in class AbstractMetadataProvider
      Parameters:
      requireValidMetadata - should be passed into MetadataResolver.setRequireValidMetadata(boolean)
      failFastInitialization - should be passed into AbstractMetadataResolver.setFailFastInitialization(boolean) (if applicable)
      filter - filter that must be installed for the resolver
      Throws:
      net.shibboleth.shared.resolver.ResolverException - for errors creating the resolver
    • initializeMetadataResolver

      protected void initializeMetadataResolver() throws net.shibboleth.shared.component.ComponentInitializationException
      Initializes the metadata resolver.
      Specified by:
      initializeMetadataResolver in class AbstractMetadataProvider
      Throws:
      net.shibboleth.shared.component.ComponentInitializationException - for initialization errors
    • destroyMetadataResolver

      protected void destroyMetadataResolver()
      Destroys the metadata resolver.
      Specified by:
      destroyMetadataResolver in class AbstractMetadataProvider