Class HTTPResourceFactoryBean

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<HTTPResource>
net.shibboleth.idp.profile.spring.resource.impl.HTTPResourceFactoryBean
All Implemented Interfaces:
Aware, BeanClassLoaderAware, BeanFactoryAware, DisposableBean, FactoryBean<HTTPResource>, InitializingBean

public class HTTPResourceFactoryBean extends AbstractFactoryBean<HTTPResource>
Factory bean for simple use cases that auto-configure PKIX or key pinning for an HTTPResource.
Since:
3.4.0
  • Field Details

    • log

      @Nonnull private org.slf4j.Logger log
      Class logger.
    • backingResource

      @Nullable private String backingResource
      Backing file path.
    • httpClient

      @Nullable private org.apache.http.client.HttpClient httpClient
      HTTP Client used to pull the resource.
    • resourceURL

      @Nullable private URL resourceURL
      URL to the Resource.
    • httpClientContextHandler

      @Nullable private HttpClientContextHandler httpClientContextHandler
      Optional handler to pre- and post-process context.
    • keyResources

      @Nonnull private List<Resource> keyResources
      The resources to be turned into keys.
    • certificateResources

      @Nonnull private List<Resource> certificateResources
      The resources to be turned into certificates.
    • usePKIX

      private boolean usePKIX
      Use a PKIX trust engine.
    • verifyDepth

      @Nullable private Integer verifyDepth
      PKIX verify depth.
  • Constructor Details

    • HTTPResourceFactoryBean

      public HTTPResourceFactoryBean()
      Constructor.
  • Method Details

    • setURL

      public void setURL(@Nullable URL url)
      Set the URL.
      Parameters:
      url - the URL
    • setBackingResource

      public void setBackingResource(@Nullable @NotEmpty String resource)
      Set the backing resource.
      Parameters:
      resource - the backing resource
    • setHttpClient

      public void setHttpClient(@Nullable org.apache.http.client.HttpClient client)
      Set the HttpClient instance.
      Parameters:
      client - client instance
    • setHttpClientContextHandler

      public void setHttpClientContextHandler(@Nullable HttpClientContextHandler handler)
      Set a handler to manipulate the HttpClientContext.
      Parameters:
      handler - the handler to install
    • setPublicKeys

      public void setPublicKeys(@Nullable List<Resource> keys)
      Set the resources which we will convert into certificates.
      Parameters:
      keys - the resources
    • setCertificates

      public void setCertificates(@Nullable List<Resource> certs)
      Set the resources which we will convert into certificates.
      Parameters:
      certs - the resources
    • setUsePKIX

      public void setUsePKIX(boolean flag)
      Set whether to use a PKIX trust engine.
      Parameters:
      flag - flag to set
    • setVerifyDepth

      public void setVerifyDepth(@Nullable Integer depth)
      Set the verify depth.
      Parameters:
      depth - value to set
    • getCredentials

      @Nullable @NonnullElements protected List<Credential> getCredentials()
      Get the configured keys and certificates lumped together as credentials.
      Returns:
      the certificates null
    • getCertificates

      @Nullable @NonnullElements protected List<X509Certificate> getCertificates()
      Get the configured certificates in their native form.
      Returns:
      the certificates
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface FactoryBean<HTTPResource>
      Specified by:
      getObjectType in class AbstractFactoryBean<HTTPResource>
    • createInstance

      protected HTTPResource createInstance() throws Exception
      Specified by:
      createInstance in class AbstractFactoryBean<HTTPResource>
      Throws:
      Exception