Class FunctionDrivenDynamicHTTPMetadataResolver

All Implemented Interfaces:
Component, DestructableComponent, IdentifiableComponent, IdentifiedComponent, InitializableComponent, Resolver<EntityDescriptor,​CriteriaSet>, ClearableMetadataResolver, DynamicMetadataResolver, 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 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.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 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​(@Nonnull 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