Class AbstractClientHttpRequestFactoryProcessor

java.lang.Object
org.mapfish.print.processor.AbstractProcessor<ClientHttpFactoryProcessorParam,Void>
org.mapfish.print.processor.http.AbstractClientHttpRequestFactoryProcessor
All Implemented Interfaces:
ConfigurationObject, HttpProcessor<ClientHttpFactoryProcessorParam>, Processor<ClientHttpFactoryProcessorParam,Void>
Direct Known Subclasses:
AddHeadersProcessor, MapUriProcessor, RestrictUrisProcessor, UseHttpForHttpsProcessor

public abstract class AbstractClientHttpRequestFactoryProcessor extends AbstractProcessor<ClientHttpFactoryProcessorParam,Void> implements HttpProcessor<ClientHttpFactoryProcessorParam>
The AbstractClientHttpRequestFactoryProcessor class.
  • Field Details

    • matchers

      protected final UriMatchers matchers
      The matchers that choose if the processor is applied or not.
  • Constructor Details

    • AbstractClientHttpRequestFactoryProcessor

      protected AbstractClientHttpRequestFactoryProcessor()
      Constructor.
  • Method Details

    • setMatchers

      public final void setMatchers(List<? extends URIMatcher> matchers)
      The matchers used to select the urls that are going to be modified by the processor. For example:
      
       - !restrictUris
         matchers:
           - !localMatch
             dummy: true
           - !ipMatch
           ip: www.camptocamp.org
           - !dnsMatch
             host: mapfish-geoportal.demo-camptocamp.com
             port: 80
           - !dnsMatch
             host: labs.metacarta.com
             port: 80
           - !dnsMatch
             host: terraservice.net
             port: 80
           - !dnsMatch
             host: tile.openstreetmap.org
             port: 80
           - !dnsMatch
             host: www.geocat.ch
             port: 80
       
      Parameters:
      matchers - the list of matcher to use to check if a url is permitted
    • extraValidation

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

      @Nullable public final ClientHttpFactoryProcessorParam createInputParameter()
      Description copied from interface: Processor
      Returns a new/clean instance of a parameter object. This instance's will be inspected using reflection to find its public fields and the properties will be set from the Values object.

      The way the properties will be looked up is to

      1. take the bean property name
      2. map it using the input mapper, (if the input mapper does not have a mapping for the property then the unmapped property name is used)
      3. Look up the property value in the Values object using the mapped property name
      4. set the value on the instance created by this method. If the value is null an exception will be thrown UNLESS the HasDefaultValue annotation is on the field for the property.
      The populated instance will be passed to the execute method. It is imperative that a new instance is created each time because they will be used in a multi-threaded environment and thus the same processor instance may be ran in multiple threads with different instances of the parameter object.

      It is important to realize that super classes will also be analyzed, so care must be had with inheritance.

      Specified by:
      createInputParameter in interface Processor<ClientHttpFactoryProcessorParam,Void>
    • execute

      @Nullable public final Void execute(ClientHttpFactoryProcessorParam values, Processor.ExecutionContext context)
      Description copied from interface: Processor
      Perform the process on the input attributes.
      Specified by:
      execute in interface Processor<ClientHttpFactoryProcessorParam,Void>
      Parameters:
      values - A Java object whose public fields are populated from the Values object (which is used for transferring properties between processors).
      context - The execution context for a print task.
      Returns:
      A Java object whose public fields will be put into the Values object. The key in the Values object is the name of the field or if there is a mapping in the Processor.getOutputMapperBiMap() map, the mapped name. The key is determined in a similar way as for the input object.