public final class AddHeadersProcessor extends AbstractClientHttpRequestFactoryProcessor
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
).
AbstractProcessor.ContextProcessor.ExecutionContextmatchersMDC_JOB_ID_KEY| Constructor and Description |
|---|
AddHeadersProcessor() |
| Modifier and Type | Method and Description |
|---|---|
MfClientHttpRequestFactory |
createFactoryWrapper(ClientHttpFactoryProcessorParam clientHttpFactoryProcessorParam,
MfClientHttpRequestFactory requestFactory)
Create the
MfClientHttpRequestFactory to use. |
static MfClientHttpRequestFactory |
createFactoryWrapper(MfClientHttpRequestFactory requestFactory,
UriMatchers matchers,
java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
Create a MfClientHttpRequestFactory for adding the specified headers.
|
protected void |
extraValidation(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
Perform any extra validation a subclass may need to perform.
|
void |
setHeaders(java.util.Map<java.lang.String,java.lang.Object> headers)
A map of the header key value pairs.
|
createInputParameter, execute, setMatchersgetInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, setInputMapper, setInputPrefix, setOutputMapper, setOutputPrefix, setPrefix, toString, toString, validateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, toStringvalidatepublic static MfClientHttpRequestFactory createFactoryWrapper(MfClientHttpRequestFactory requestFactory, UriMatchers matchers, java.util.Map<java.lang.String,java.util.List<java.lang.String>> headers)
requestFactory - the basic request factory. It should be unmodified and just wrapped with
a proxy class.matchers - The matchers.headers - The headers.public void setHeaders(java.util.Map<java.lang.String,java.lang.Object> headers)
headers - the header mapprotected void extraValidation(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
AbstractProcessorextraValidation in class AbstractClientHttpRequestFactoryProcessorvalidationErrors - a list to add errors to so that all validation errors are reported as
one.configuration - the containing configurationpublic MfClientHttpRequestFactory createFactoryWrapper(ClientHttpFactoryProcessorParam clientHttpFactoryProcessorParam, MfClientHttpRequestFactory requestFactory)
HttpProcessorMfClientHttpRequestFactory to use.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.