Class ALcdOGCWCSCommandDispatcherFactory
- All Implemented Interfaces:
ILcdOGCCommandDispatcherFactory
Supported OGC WCS operations
The command dispatcher provides support for the OGC WCS operations:- GetCapabilities: provides information about the server (metadata, supported operations and versions ...) as well as the data sets (coverages) that are available.
- GetCoverage: returns a raster for a requested coverage.
- DescribeCoverage: returns more details on underlying data for a requested coverage.
Factory methods to implement
A number of protected 'create' methods of this class can be overridden to customize the behaviour of the WCS
server, the most important being createWCSCapabilitiesProvider
. The methods
createModelDecoderFactory
and createModelProvider
already have sensible default
implementations.
Note that since version 2017.0 the method createWCSCapabilitiesProvider
replaces the deprecated methods
createCoverageOfferingList
and createServiceMetaData
.
So, when createWCSCapabilitiesProvider
is implemented, the two deprecated methods are ignored.
A concrete implementation of this class is referenced from the web servlet configuration file, so it can be
instantiated when the web server starts up. This will then cause the createCommandDispatcher
method to
be called, which will in turn call all protected factory methods of this class to construct the instances which are
required by the request handlers. The final server initialization step is to create a request handler for each WCS
request using the createRequestHandler
method. These handlers can then be registered on the
TLcdWCSCommandDispatcher
instance that is created by the createWCSCommandDispatcherInstance
factory method.
Performance for client applications using tiled requests
This factory uses a tile cache to improve the performance of subsequent tiled WCS GetCoverage requests. This tile cache is not used for regular GetCoverage requests. It is a two-tier cache that uses an in-memory buffer with a (non-persistent) disk overflow. The cache is configured as part of the servlet context, which means that it can be reused across multiple servlet instances when in the same process. It can be configured by using the following servlet context parameters (context-param in web.xml).
- memory-cache-size: The memory tile cache size in MB. Default is 10% of the max heap size. Can be 0.
- disk-cache-size: The disk tile cache size in MB. Default is "memory-cache-size x 100". Can be 0.
- disk-cache-path: The disk tile cache path. Also supports paths starting with
"${java.io.tmpdir}"
or"${user.home}"
. Default is "${java.io.tmpdir}/ogc"
The tile cache can be disabled by setting both the memory-cache-size
and disk-cache-size
parameters to 0. By default, the tile cache is enabled.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAllows to provide a list of additional attribute names which must be taken into account when checking the validity of a tile from the tile cache.Called during servlet initialization to create a command dispatcher.protected ILcdCoverageOfferingList
Deprecated.protected ILcdOGCModelDecoderFactory
Creates anILcdOGCModelDecoderFactory
.protected ILcdWCSModelEncoderFactory
Creates an ILcdWCSModelEncoderFactory.protected ILcdOGCModelProvider
createModelProvider
(ILcdOGCModelDecoderFactory aModelDecoderFactory) Creates anILcdOGCModelProvider
, which provides central access to all models.protected void
createReferenceParsersSFCT
(ILcdInitializationConfig aConfig, List<ILcdXYWorldReferenceParser> aWorldReferenceParserListSFCT, List<String> aCRSCodeListToPublishSFCT) Creates reference parsers.createRequestHandler
(String aRequest, TLcdWCSCommandDispatcherContext aCommandDispatcherContext) Factory method to create a WCS request handler.protected ILcdWCSServiceMetadata
Deprecated.protected ILcdWCSCapabilitiesProvider
createWCSCapabilitiesProvider
(ILcdInitializationConfig aConfig, ILcdOGCModelProvider aModelProvider) Creates a WCS capabilities provider.protected TLcdWCSCommandDispatcher
Called bycreateWCSCommandDispatcher()
to create a command dispatcher.
-
Constructor Details
-
ALcdOGCWCSCommandDispatcherFactory
public ALcdOGCWCSCommandDispatcherFactory()
-
-
Method Details
-
createCommandDispatcher
public ALcdOGCCommandDispatcher createCommandDispatcher(ILcdInitializationConfig aConfig) throws TLcdOGCServiceException Called during servlet initialization to create a command dispatcher. This method also configures the dispatcher, by registering the necessary request handllers and setting up global objects such as a model encoder factory.- Specified by:
createCommandDispatcher
in interfaceILcdOGCCommandDispatcherFactory
- Parameters:
aConfig
- The servlet configuration parameters loaded from web.xml.- Returns:
- A
ALcdOGCCommandDispatcher
- Throws:
TLcdOGCServiceException
- when unable to create a command dispatcher.- See Also:
-
createModelDecoderFactory
Creates an
ILcdOGCModelDecoderFactory
. TheILcdOGCModelDecoderFactory
is used by the server to load data: it is responsible of creating anILcdModelDecoder
for a given source. ThisILcdModelDecoder
is then used to decode the data identified by that source.By default, this method returns a
TLcdOGCModelDecoderFactory
instance. This implementation usesTLcdServiceLoader
to findILcdModelDecoder
instances.- Parameters:
aConfig
- The servlet configuration parameters.- Returns:
- an
ILcdOGCModelDecoderFactory
to read data at the server - Since:
- 2017.0
-
createModelProvider
Creates an
ILcdOGCModelProvider
, which provides central access to all models. The server uses this interface to retrieve a model, instead of directly using the model decoder factory (seecreateModelDecoderFactory(com.luciad.ogc.common.ILcdInitializationConfig)
). The model decoder factory should only be used by theILcdOGCModelProvider
to decode the necessary models. This centralized access allows implementations to define additional functionality, like a cache mechanism.The default implementation returns a
The request context object type supplied to theTLcdOGCModelProvider
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.ILcdOGCModelProvider#getModel(String, ALcdRequestContext)
is of the typeTLcdWCSRequestContext
.- Parameters:
aModelDecoderFactory
- The model decoder factory that must be used by the model provider to read data- Returns:
- a model provider.
- Since:
- 2017.0
-
createWCSCapabilitiesProvider
protected ILcdWCSCapabilitiesProvider createWCSCapabilitiesProvider(ILcdInitializationConfig aConfig, ILcdOGCModelProvider aModelProvider) throws TLcdOGCServiceException Creates a WCS capabilities provider. This is the main method of the WCS command dispatcher factory to implement.By default, for backward compatibility, this method creates an
ILcdWCSCapabilitiesProvider
instance based on the results of the following methods:createCoverageOfferingList(com.luciad.ogc.common.ILcdInitializationConfig)
createServiceMetaData(com.luciad.ogc.common.ILcdInitializationConfig)
This method offers advantages over these separate methods. It in particular eases the implementation of access control, and it allows to return coverage offerings lazily. See
ILcdWCSCapabilitiesProvider
for more information.- Parameters:
aConfig
- The servlet configuration parametersaModelProvider
- The model provider- Returns:
- a WCS capabilities provider, never
null
. - Throws:
TLcdOGCServiceException
- when the capabilities provider can not be created.- Since:
- 2017.0
-
createWCSCommandDispatcherInstance
protected TLcdWCSCommandDispatcher createWCSCommandDispatcherInstance(ILcdInitializationConfig aConfig) Called bycreateWCSCommandDispatcher()
to create a command dispatcher.- Returns:
- a
TLcdWCSCommandDispatcher
.
-
createCoverageOfferingList
Deprecated.Creates an ILcdCoverageOfferingList. -
createServiceMetaData
Deprecated.Creates a ILcdWCSServiceMetadata describing this WCS service. -
createModelEncoderFactory
Creates an ILcdWCSModelEncoderFactory. -
createRequestHandler
public ILcdRequestHandler createRequestHandler(String aRequest, TLcdWCSCommandDispatcherContext aCommandDispatcherContext) throws TLcdWCSServiceException Factory method to create a WCS request handler. This method is called for all requests defined by the WCS specification, and the returned handlers are registered with the WCS command dispatcher.- Parameters:
aRequest
- the name of a WCS request, e.g. "GetCapabilities"aCommandDispatcherContext
- global objects that may be used by the request handlers- Returns:
- an ILcdRequestHandler that can respond to the specified request
- Throws:
TLcdWCSServiceException
- if no handler can be created- See Also:
-
createAdditionalAttributeListForTileCacheKey
Allows to provide a list of additional attribute names which must be taken into account when checking the validity of a tile from the tile cache. The tile cache caches tiles which have been configured for requests based on the coverages, bbox, crs, etc.The default method implementation returns an empty list. If you are using request attributes that have an impact on the visualization, you need to return them in this method.
- Returns:
- the list of attribute names to be taken into account for the tile caching.
- Since:
- 2023.1
-
createReferenceParsersSFCT
protected void createReferenceParsersSFCT(ILcdInitializationConfig aConfig, List<ILcdXYWorldReferenceParser> aWorldReferenceParserListSFCT, List<String> aCRSCodeListToPublishSFCT) Creates reference parsers. The reference parsers to be registered within theWCS command dispatcher
should be added to the list as side effect of the method. Next to this the supported reference codes should be added as well.This method registers by default the following parser implementations:
TLcdEPSGReferenceParser
: parser for EPSG codes.TLcdCRSReferenceParser
: parser for CRS codes, such as CRS:84.
This method also registers a default list of reference codes that are widely used.
- Parameters:
aConfig
- the servlet configuration parameters.aWorldReferenceParserListSFCT
- the list of reference parsers to be populated.aCRSCodeListToPublishSFCT
- the CRS codes that should be published in the WMS capabilities; to be populated.- Since:
- 2024.0
-
createWCSCapabilitiesProvider(ILcdInitializationConfig, ILcdOGCModelProvider)
instead.