Package org.mapfish.print.processor.http
Class AddHeadersProcessor
java.lang.Object
org.mapfish.print.processor.AbstractProcessor<ClientHttpFactoryProcessorParam,Void>
org.mapfish.print.processor.http.AbstractClientHttpRequestFactoryProcessor
org.mapfish.print.processor.http.AddHeadersProcessor
- All Implemented Interfaces:
ConfigurationObject
,HttpProcessor<ClientHttpFactoryProcessorParam>
,Processor<ClientHttpFactoryProcessorParam,
Void>
This processor allows adding static headers to an http request.
Example: add a Cookie header with multiple header values and add header2 with only one value
- !addHeaders
headers:
Cookie: [cookie-value, cookie-value2]
Header2: header2-value
Can be applied conditionally using matchers, like in RestrictUrisProcessor
(!restrictUris ). [[examples=http_processors]]
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mapfish.print.processor.AbstractProcessor
AbstractProcessor.Context
Nested classes/interfaces inherited from interface org.mapfish.print.processor.Processor
Processor.ExecutionContext
-
Field Summary
Fields inherited from class org.mapfish.print.processor.http.AbstractClientHttpRequestFactoryProcessor
matchers
Fields inherited from interface org.mapfish.print.processor.Processor
MDC_APPLICATION_ID_KEY, MDC_JOB_ID_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MfClientHttpRequestFactory
createFactoryWrapper
(MfClientHttpRequestFactory requestFactory, UriMatchers matchers, Map<String, List<String>> headers) Create a MfClientHttpRequestFactory for adding the specified headers.createFactoryWrapper
(ClientHttpFactoryProcessorParam clientHttpFactoryProcessorParam, MfClientHttpRequestFactory requestFactory) Create theMfClientHttpRequestFactory
to use.protected void
extraValidation
(List<Throwable> validationErrors, Configuration configuration) Perform any extra validation a subclass may need to perform.void
setHeaders
(Map<String, Object> headers) A map of the header key value pairs.Methods inherited from class org.mapfish.print.processor.http.AbstractClientHttpRequestFactoryProcessor
createInputParameter, execute, setMatchers
Methods inherited from class org.mapfish.print.processor.AbstractProcessor
getInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, setInputMapper, setInputPrefix, setOutputMapper, setOutputPrefix, setPrefix, toString, toString, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.mapfish.print.config.ConfigurationObject
validate
Methods inherited from interface org.mapfish.print.processor.Processor
getInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, toString
-
Constructor Details
-
AddHeadersProcessor
public AddHeadersProcessor()
-
-
Method Details
-
createFactoryWrapper
public static MfClientHttpRequestFactory createFactoryWrapper(MfClientHttpRequestFactory requestFactory, UriMatchers matchers, Map<String, List<String>> headers) Create a MfClientHttpRequestFactory for adding the specified headers.- Parameters:
requestFactory
- the basic request factory. It should be unmodified and just wrapped with a proxy class.matchers
- The matchers.headers
- The headers.
-
setHeaders
A map of the header key value pairs. Keys are strings and values are either list of strings or a string.- Parameters:
headers
- the header map
-
extraValidation
Description copied from class:AbstractProcessor
Perform any extra validation a subclass may need to perform.- Overrides:
extraValidation
in classAbstractClientHttpRequestFactoryProcessor
- 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 theMfClientHttpRequestFactory
to use.- Parameters:
clientHttpFactoryProcessorParam
- extra parameters required to create the updated request factoryrequestFactory
- the basic request factory. It should be unmodified and just wrapped with a proxy class.
-