Interface MetadataProvider

All Superinterfaces:
net.shibboleth.shared.component.Component, net.shibboleth.shared.component.DestructableComponent, net.shibboleth.shared.component.InitializableComponent
All Known Implementing Classes:
AbstractMetadataProvider, CompositeMetadataProvider, FilesystemMetadataProvider, HTTPMetadataProvider, MDQMetadataProvider, ProxyMetadataProvider, StaticMetadataProvider

public interface MetadataProvider extends net.shibboleth.shared.component.InitializableComponent, net.shibboleth.shared.component.DestructableComponent
An interface that offers methods that operate on one or several metadata sources.

A MetadataProvider instance encapsulates OpenSAML:s MetadataResolver and adds easy to use methods and configuration.

Author:
Martin Lindström (martin@idsec.se)
  • Method Summary

    Modifier and Type
    Method
    Description
    org.opensaml.saml.saml2.metadata.EntityDescriptor
    Returns the entity descriptor identified by the given entityID.
    org.opensaml.saml.saml2.metadata.EntityDescriptor
    getEntityDescriptor(String entityID, QName role)
    Returns the entity descriptor identified by the given entityID and given role.
    Returns the identifier for the provider.
    List<org.opensaml.saml.saml2.metadata.EntityDescriptor>
    Utility method that returns a list of entity descriptors for Identity Providers found in the metadata.
    Returns the time the currently available metadata was last updated.
    org.opensaml.core.xml.XMLObject
    Returns the XML element making up the metadata for the federation.
    Returns the DOM element making up the metadata for the federation.
    org.opensaml.saml.metadata.resolver.MetadataResolver
    Returns the underlying OpenSAML metadata resolver.
    List<org.opensaml.saml.saml2.metadata.EntityDescriptor>
    Utility method that returns a list of entity descriptors for Service Providers found in the metadata.
    Iterable<org.opensaml.saml.saml2.metadata.EntityDescriptor>
    Returns an iterator for all entity descriptors held by the provider.
    Iterable<org.opensaml.saml.saml2.metadata.EntityDescriptor>
    Returns an iterator for all entity descriptors having the given role.
    void
    Refresh the metadata handled by the provider.

    Methods inherited from interface net.shibboleth.shared.component.DestructableComponent

    destroy, isDestroyed

    Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

    initialize, isInitialized
  • Method Details

    • getID

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

      org.opensaml.core.xml.XMLObject getMetadata() throws net.shibboleth.shared.resolver.ResolverException
      Returns the XML element making up the metadata for the federation. This element is either an EntityDescriptor or an EntitiesDescriptor.
      Returns:
      an XML element
      Throws:
      net.shibboleth.shared.resolver.ResolverException - for metadata resolving errors
    • getMetadataDOM

      Element getMetadataDOM() throws org.opensaml.core.xml.io.MarshallingException
      Returns the DOM element making up the metadata for the federation.
      Returns:
      a DOM element
      Throws:
      org.opensaml.core.xml.io.MarshallingException - for XML marshalling errors
    • getLastUpdate

      Instant getLastUpdate()
      Returns the time the currently available metadata was last updated.
      Returns:
      time when the currently metadata was last updated, or null if no metadata has been successfully loaded
    • refresh

      void refresh() throws net.shibboleth.shared.resolver.ResolverException
      Refresh the metadata handled by the provider.

      An implementation that does not support refresh should implement this operation as a no-op. Implementations that do support refresh of metadata should typically be either synchronized or make use other locking mechanisms to protect against concurrent access.

      Throws:
      net.shibboleth.shared.resolver.ResolverException - if the refresh operation was unsuccessful
    • iterator

      Iterable<org.opensaml.saml.saml2.metadata.EntityDescriptor> iterator()
      Returns an iterator for all entity descriptors held by the provider.
      Returns:
      an iterator for all entity descriptors
    • iterator

      Iterable<org.opensaml.saml.saml2.metadata.EntityDescriptor> iterator(QName role)
      Returns an iterator for all entity descriptors having the given role.

      To list all IdP:s and SP:s do:

       
       idps = provider.iterator(IDPSSODescriptor.DEFAULT_ELEMENT_NAME);
       sps = provider.iterator(SPSSODescriptor.DEFAULT_ELEMENT_NAME);
       
       
      Parameters:
      role - role descriptor
      Returns:
      an iterator for all matching entity descriptors
      See Also:
    • getEntityDescriptor

      org.opensaml.saml.saml2.metadata.EntityDescriptor getEntityDescriptor(String entityID) throws net.shibboleth.shared.resolver.ResolverException
      Returns the entity descriptor identified by the given entityID.
      Parameters:
      entityID - the unique entityID for the entry
      Returns:
      an entity descriptor or null if no entry is found
      Throws:
      net.shibboleth.shared.resolver.ResolverException - for underlying metadata errors
    • getEntityDescriptor

      org.opensaml.saml.saml2.metadata.EntityDescriptor getEntityDescriptor(String entityID, QName role) throws net.shibboleth.shared.resolver.ResolverException
      Returns the entity descriptor identified by the given entityID and given role.
      Parameters:
      entityID - the entity ID
      role - the role descriptor
      Returns:
      an entity descriptor or null if no matching entry is found
      Throws:
      net.shibboleth.shared.resolver.ResolverException - for underlying metadata errors
    • getIdentityProviders

      List<org.opensaml.saml.saml2.metadata.EntityDescriptor> getIdentityProviders() throws net.shibboleth.shared.resolver.ResolverException
      Utility method that returns a list of entity descriptors for Identity Providers found in the metadata.
      Returns:
      a list of entity descriptors
      Throws:
      net.shibboleth.shared.resolver.ResolverException - for metadata errors
    • getServiceProviders

      List<org.opensaml.saml.saml2.metadata.EntityDescriptor> getServiceProviders() throws net.shibboleth.shared.resolver.ResolverException
      Utility method that returns a list of entity descriptors for Service Providers found in the metadata.
      Returns:
      a list of entity descriptors
      Throws:
      net.shibboleth.shared.resolver.ResolverException - for metadata errors
    • getMetadataResolver

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