Package org.mapfish.print.processor.map
Class SetTiledWmsProcessor
java.lang.Object
org.mapfish.print.processor.AbstractProcessor<SetTiledWmsProcessor.Input,Void>
org.mapfish.print.processor.map.SetTiledWmsProcessor
- All Implemented Interfaces:
ConfigurationObject
,Processor<SetTiledWmsProcessor.Input,
Void>
Processor that transforms WMS layers that are too big into tiled WMS layers.
This processor will reduce the given max tile size to best match the dimensions of the map. This is to reduce the amount of extra data that is fetched from the WMS server.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
The input parameter object forSetFeaturesProcessor
.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
FieldsModifier and TypeFieldDescriptionprotected final UriMatchers
The matchers that chooses if the processor is applied or not.Fields inherited from interface org.mapfish.print.processor.Processor
MDC_APPLICATION_ID_KEY, MDC_JOB_ID_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a new/clean instance of a parameter object.final Void
execute
(SetTiledWmsProcessor.Input values, Processor.ExecutionContext context) Perform the process on the input attributes.protected final void
extraValidation
(List<Throwable> validationErrors, Configuration configuration) Perform any extra validation a subclass may need to perform.final void
setMatchers
(List<? extends URIMatcher> matchers) The matchers used to select the WMS urls that are going to be modified by the processor.void
setMaxHeight
(int maxHeight) Set the maximum height in pixels.void
setMaxWidth
(int maxWidth) Set the maximum width in pixels.void
setTileBufferHeight
(int tileBufferHeight) Set the top and bottom buffer for fetching tiles in pixels.void
setTileBufferWidth
(int tileBufferWidth) Set the left and right buffer for fetching tiles in pixels.Methods inherited from class org.mapfish.print.processor.AbstractProcessor
getInputMapperBiMap, getInputPrefix, getOutputMapperBiMap, getOutputPrefix, getOutputType, setInputMapper, setInputPrefix, setOutputMapper, setOutputPrefix, setPrefix, toString, toString, validate
-
Field Details
-
matchers
The matchers that chooses if the processor is applied or not.
-
-
Constructor Details
-
SetTiledWmsProcessor
protected SetTiledWmsProcessor()Constructor.
-
-
Method Details
-
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 theValues
object.The way the properties will be looked up is to
- take the bean property name
- 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)
- Look up the property value in the
Values
object using the mapped property name - 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.
It is important to realize that super classes will also be analyzed, so care must be had with inheritance.
-
execute
public final Void execute(SetTiledWmsProcessor.Input values, Processor.ExecutionContext context) throws Exception Description copied from interface:Processor
Perform the process on the input attributes.- Parameters:
values
- A Java object whose public fields are populated from theValues
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 theValues
object is the name of the field or if there is a mapping in theProcessor.getOutputMapperBiMap()
map, the mapped name. The key is determined in a similar way as for the input object. - Throws:
Exception
-
extraValidation
Description copied from class:AbstractProcessor
Perform any extra validation a subclass may need to perform.- Specified by:
extraValidation
in classAbstractProcessor<SetTiledWmsProcessor.Input,
Void> - Parameters:
validationErrors
- a list to add errors to so that all validation errors are reported as one.configuration
- the containing configuration
-
setMaxWidth
public void setMaxWidth(int maxWidth) Set the maximum width in pixels.- Parameters:
maxWidth
- the value
-
setMaxHeight
public void setMaxHeight(int maxHeight) Set the maximum height in pixels.- Parameters:
maxHeight
- the value
-
setMatchers
The matchers used to select the WMS urls that are going to be modified by the processor. For example:- !restrictUris matchers: - !dnsMatch host: labs.metacarta.com port: 80
- Parameters:
matchers
- the list of matcher to use to check if a url is permitted
-
setTileBufferWidth
public void setTileBufferWidth(int tileBufferWidth) Set the left and right buffer for fetching tiles in pixels.- Parameters:
tileBufferWidth
- the tileBufferWidth to set
-
setTileBufferHeight
public void setTileBufferHeight(int tileBufferHeight) Set the top and bottom buffer for fetching tiles in pixels.- Parameters:
tileBufferHeight
- the tileBufferHeight to set
-