Class FunctionDrivenDynamicHTTPMetadataResolver

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.IdentifiableComponent, net.shibboleth.utilities.java.support.component.IdentifiedComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, net.shibboleth.utilities.java.support.resolver.Resolver<org.opensaml.saml.saml2.metadata.EntityDescriptor,​net.shibboleth.utilities.java.support.resolver.CriteriaSet>, org.opensaml.saml.metadata.resolver.ClearableMetadataResolver, org.opensaml.saml.metadata.resolver.DynamicMetadataResolver, org.opensaml.saml.metadata.resolver.MetadataResolver

    public class FunctionDrivenDynamicHTTPMetadataResolver
    extends AbstractDynamicHTTPMetadataResolver
    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.

    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Logger.
      • requestURLBuilder

        @Nonnull
        private Function<net.shibboleth.utilities.java.support.resolver.CriteriaSet,​String> requestURLBuilder
        Function for building the request URL.
    • Constructor Detail

      • FunctionDrivenDynamicHTTPMetadataResolver

        public FunctionDrivenDynamicHTTPMetadataResolver​(@Nonnull
                                                         org.apache.http.client.HttpClient client)
        Constructor.
        Parameters:
        client - the instance of HttpClient used to fetch remote metadata
      • FunctionDrivenDynamicHTTPMetadataResolver

        public FunctionDrivenDynamicHTTPMetadataResolver​(@Nullable
                                                         Timer backgroundTaskTimer,
                                                         @Nonnull
                                                         org.apache.http.client.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 Detail

      • getRequestURLBuilder

        @Nonnull
        public Function<net.shibboleth.utilities.java.support.resolver.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<net.shibboleth.utilities.java.support.resolver.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​(@Nonnull
                                         net.shibboleth.utilities.java.support.resolver.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