public final class MapUriProcessor extends AbstractClientHttpRequestFactoryProcessor
This processor maps uris submitted to the MfClientHttpRequestFactory to
a modified uri as specified by the mapping parameter.
Example: change the hostname of all requests that are http requests and have the hostname: myhost.com to localhost instead of myhost.com
- !mapUri
mapping: {(http)://myhost.com(.*) : "$1://localhost$2"}
Can be applied conditionally using matchers, like in RestrictUrisProcessor
(!restrictUris
).
AbstractProcessor.ContextProcessor.ExecutionContextmatchers| Constructor and Description |
|---|
MapUriProcessor() |
| Modifier and Type | Method and Description |
|---|---|
MfClientHttpRequestFactory |
createFactoryWrapper(ClientHttpFactoryProcessorParam clientHttpFactoryProcessorParam,
MfClientHttpRequestFactory requestFactory)
Create the
MfClientHttpRequestFactory to use. |
protected void |
extraValidation(java.util.List<java.lang.Throwable> validationErrors,
Configuration configuration)
Perform any extra validation a subclass may need to perform.
|
void |
setMapping(java.util.Map<java.lang.String,java.lang.String> mapping)
Set the uri mappings.
|
createInputParameter, execute, setMatcherscheckCancelState, getInputMapperBiMap, 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 void setMapping(java.util.Map<java.lang.String,java.lang.String> mapping)
The key is a regular expression that must match uri's string form. The value will be used for the replacement.
mapping - the uri mappings.public 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.protected 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 configuration