Class ALcdMultiDimensionalModelProvider
- All Implemented Interfaces:
ILcdOGCModelProvider
,ILcdDisposable
,ILcdModelProvider
,AutoCloseable
- Direct Known Subclasses:
TLcdWMSModelProvider
ILcdModelProvider
that provides support for multi-dimensional requests.
Next to the getModel(String)
defined in ILcdModelProvider
,
it adds a method getModel(ALcdWMSLayer, ALcdWMSDimension[], TLcdWMSDimensionExtent[], TLcdWMSRequestContext)
that returns
a model for a specified layer and dimension parameters.
A client request that contains one or more dimensional parameters, does not necessarily comply
to the actual dimension definitions. For example, if a client specifies a value for which no exact
match is available, a nearest value may be used. For this purposes, the method
getDimensionExtent(ALcdWMSLayer, ALcdWMSDimension, TLcdWMSDimensionExtent, TLcdWMSRequestContext)
is used.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Disposes of this object and allows it to release any system resources that it is holding.getDimensionExtent
(ALcdWMSLayer aLayer, ALcdWMSDimension aDimension, TLcdWMSDimensionExtent aSuppliedExtent, TLcdWMSRequestContext aWMSRequestContext) Returns the actual dimension extent, specifying the value(s)/interval(s) on which the supplied dimension extent can be mapped.getModel
(ALcdWMSLayer aLayer, ALcdWMSDimension[] aDimensions, TLcdWMSDimensionExtent[] aDimensionExtent, TLcdWMSRequestContext aWMSRequestContext) Returns theILcdModel
corresponding to a layer and its dimensional parameters.getModel
(String aSourceName, ALcdRequestContext aRequestContext) Returns theILcdModel
corresponding to a source name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.util.ILcdDisposable
close
Methods inherited from interface com.luciad.wms.server.ILcdModelProvider
getModelUpdateSequence
-
Constructor Details
-
ALcdMultiDimensionalModelProvider
public ALcdMultiDimensionalModelProvider()
-
-
Method Details
-
getModel
public ILcdModel getModel(String aSourceName, ALcdRequestContext aRequestContext) throws IOException Returns theILcdModel
corresponding to a source name. This method is used for allALcdWMSLayer
objects that don't have any dimensions defined. By default, anILcdModelProvider
implementation is used that maintains a cache for all decoded models. To prevent memory problems, it makes use of Soft reference objects, which are cleared at the discretion of the garbage collector in response to memory demand. Soft references are most often used to implement memory-sensitive caches.- Specified by:
getModel
in interfaceILcdModelProvider
- Specified by:
getModel
in interfaceILcdOGCModelProvider
- Parameters:
aSourceName
- the source name of the model.aRequestContext
- the request context, which is an instance of typeTLcdWMSRequestContext
. This can be null if the method is called by a process which is not handling a request.- Returns:
- the
ILcdModel
corresponding to a source name. - Throws:
IOException
- if the model can not be returned (because decoding fails).
-
getModel
public ILcdModel getModel(ALcdWMSLayer aLayer, ALcdWMSDimension[] aDimensions, TLcdWMSDimensionExtent[] aDimensionExtent, TLcdWMSRequestContext aWMSRequestContext) throws IOException Returns theILcdModel
corresponding to a layer and its dimensional parameters. This method is used for allALcdWMSLayer
objects that have one or more dimensions defined in the capabilities.The default implementation of this method sets the filtering value to the retrieved model via
getModel(String, ALcdRequestContext)
. Because of the performance considerations,getModel(String, ALcdRequestContext)
utilizes a model cache in which ILcdMultiDimensional models can be used in a thread safe manner. Thus this method relies on this idea that any multidimensional model retrieved from getModel is safe to alter filtering values.If you ever override
getModel(String, ALcdRequestContext)
to add custom formats, you should ensure that the multidimensional models obtained from your method are either safe in means of filter setting or you override this method too to prevent possible threading issues.- Parameters:
aLayer
- The layer for which a model must be retrieved.aDimensions
- The dimensions that are defined for the layer. These dimensions can be defined directly by the layer, or be inherited from a parent layer.aDimensionExtent
- The value(s) or interval(s) to be used for the dimensional parameters.aWMSRequestContext
- the WMS request context, which gives access to the originalHttpServletRequest
that was sent to the WMS and several other parameters.- Returns:
- the
ILcdModel
corresponding to the layer and its dimensional parameters. - Throws:
IOException
- if the model can not be returned (because decoding fails).
-
dispose
public void dispose()Description copied from interface:ILcdDisposable
Disposes of this object and allows it to release any system resources that it is holding.
The result of calling any other method (other than
finalize
) on this object subsequent to a call to this method is undefined.- Specified by:
dispose
in interfaceILcdDisposable
- Specified by:
dispose
in interfaceILcdOGCModelProvider
-
getDimensionExtent
public TLcdWMSDimensionExtent getDimensionExtent(ALcdWMSLayer aLayer, ALcdWMSDimension aDimension, TLcdWMSDimensionExtent aSuppliedExtent, TLcdWMSRequestContext aWMSRequestContext) Returns the actual dimension extent, specifying the value(s)/interval(s) on which the supplied dimension extent can be mapped. This conversion should comply to the following rules and to the properties of the supplied dimension:- If a supplied value or interval has an exact match, it must be copied to the returned dimension extent.
- If a supplied value or interval has no exact match:
- If a nearest match may be used (if
isNearestValue()
in the suppliedALcdWMSDimension
object returnstrue
), a nearest match must be determined and added to the returned dimension extent. - If no nearest match may be used, no value or interval for the supplied value/interval should be added to the returned dimension extent.
If it was the only specified value or interval, an empty dimension extent or
null
must be returned .
- If a nearest match may be used (if
- If the client did not specify a parameter for the dimension, the default value is used in the supplied extent object and an appropriate HTTP response header is automatically added to the response. If no default value was available, a service exception report was sent to the client.
- If the client did specify a parameter that did not complied to the format defined in the WMS specification, service exception reports was sent to the client.
- If the client did specify a parameter containing multiple values or intervals while this was not allowed according to ALcdWMSDimension.isMultipleValues(), a service exception reports was sent to the client.
- If the resolved extent contains less values or intervals than the supplied extent, a service exception report is sent to the client.
- If the resolved extent contains different values or intervals than the ones defined in the original extent, an appropriate HTTP response header is automatically added to the response.
- Parameters:
aLayer
- The layer for which a dimension was specified in the client request.aDimension
- The dimension for which a value was specified in the client request. Note that this dimension can be defined in a parent layer of the specified layer, since dimension definitions are inherited if none are defined by the child layer.aSuppliedExtent
- The value(s)/interval(s) specified for the dimension in the client request.aWMSRequestContext
- the WMS request context, which gives access to the originalHttpServletRequest
that was sent to the WMS and several other parameters.- Returns:
- The actual dimension extent.
-