Class UseHttpForHttpsProcessor

All Implemented Interfaces:
ConfigurationObject, HttpProcessor<ClientHttpFactoryProcessorParam>, Processor<ClientHttpFactoryProcessorParam,Void>

public final class UseHttpForHttpsProcessor extends AbstractClientHttpRequestFactoryProcessor
This processor maps https requests to http requests for certain hosts. The port number can also be mapped since that is usually required.

Example:


 - !useHttpForHttps
   hosts: [localhost, www.camptocamp.com]
   portMapping:
     443: 80
     8443: 8080
 

Can be applied conditionally using matchers, like in RestrictUrisProcessor (!restrictUris ). [[examples=http_processors]]

  • Constructor Details

    • UseHttpForHttpsProcessor

      protected UseHttpForHttpsProcessor()
      Constructor.
  • Method Details

    • extraValidation

      protected void extraValidation(List<Throwable> validationErrors, Configuration configuration)
      Description copied from class: AbstractProcessor
      Perform any extra validation a subclass may need to perform.
      Overrides:
      extraValidation in class AbstractClientHttpRequestFactoryProcessor
      Parameters:
      validationErrors - a list to add errors to so that all validation errors are reported as one.
      configuration - the containing configuration
    • createFactoryWrapper

      public MfClientHttpRequestFactory createFactoryWrapper(ClientHttpFactoryProcessorParam clientHttpFactoryProcessorParam, MfClientHttpRequestFactory requestFactory)
      Description copied from interface: HttpProcessor
      Create the MfClientHttpRequestFactory to use.
      Parameters:
      clientHttpFactoryProcessorParam - extra parameters required to create the updated request factory
      requestFactory - the basic request factory. It should be unmodified and just wrapped with a proxy class.
    • setPortMapping

      public void setPortMapping(Map<Integer,Integer> portMapping)
      Set the https port to http port mapping.
      Parameters:
      portMapping - the mappings to add.
    • setHosts

      public void setHosts(List<String> hosts)
      Set the patterns to use for selecting the hosts to apply the https -> http mapping to.
      • If the host starts and ends with / then it is compiled as a regular expression
      • Otherwise the hosts must exactly match
      Parameters:
      hosts - hosts to match. Can be regular expressions