Package org.mapfish.print.processor.http
Class MapUriProcessor
- java.lang.Object
-
- org.mapfish.print.processor.AbstractProcessor<ClientHttpFactoryProcessorParam,java.lang.Void>
-
- org.mapfish.print.processor.http.AbstractClientHttpRequestFactoryProcessor
-
- org.mapfish.print.processor.http.MapUriProcessor
-
- All Implemented Interfaces:
ConfigurationObject
,HttpProcessor<ClientHttpFactoryProcessorParam>
,Processor<ClientHttpFactoryProcessorParam,java.lang.Void>
public final class MapUriProcessor extends AbstractClientHttpRequestFactoryProcessor
This processor maps uris submitted to theMfClientHttpRequestFactory
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 ). [[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 Constructor Description MapUriProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MfClientHttpRequestFactory
createFactoryWrapper(ClientHttpFactoryProcessorParam clientHttpFactoryProcessorParam, MfClientHttpRequestFactory requestFactory)
Create theMfClientHttpRequestFactory
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.-
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
-
-
-
-
Method Detail
-
setMapping
public void setMapping(java.util.Map<java.lang.String,java.lang.String> mapping)
Set the uri mappings.The key is a regular expression that must match uri's string form. The value will be used for the replacement.
- Parameters:
mapping
- the uri mappings.
-
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.
-
extraValidation
protected void extraValidation(java.util.List<java.lang.Throwable> validationErrors, Configuration configuration)
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
-
-