public abstract class ALcdOGCWCSCommandDispatcherFactory extends Object implements ILcdOGCCommandDispatcherFactory
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.
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).
"${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 and Description |
---|
ALcdOGCWCSCommandDispatcherFactory() |
public ALcdOGCCommandDispatcher createCommandDispatcher(ILcdInitializationConfig aConfig) throws TLcdOGCServiceException
createCommandDispatcher
in interface ILcdOGCCommandDispatcherFactory
aConfig
- The servlet configuration parameters loaded from web.xml.ALcdOGCCommandDispatcher
TLcdOGCServiceException
- when unable to create a command dispatcher.createWCSCommandDispatcherInstance(com.luciad.ogc.common.ILcdInitializationConfig)
protected ILcdOGCModelDecoderFactory createModelDecoderFactory(ILcdInitializationConfig aConfig)
Creates an ILcdOGCModelDecoderFactory
. The ILcdOGCModelDecoderFactory
is used by the server to load data: it is responsible of creating an
ILcdModelDecoder
for a given source. This ILcdModelDecoder
is then
used to decode the data identified by that source.
By default, this method returns a TLcdOGCModelDecoderFactory
instance.
This implementation uses TLcdServiceLoader
to find
ILcdModelDecoder
instances.
aConfig
- The servlet configuration parameters.ILcdOGCModelDecoderFactory
to read data at the serverprotected ILcdOGCModelProvider createModelProvider(ILcdOGCModelDecoderFactory aModelDecoderFactory)
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 (see createModelDecoderFactory(com.luciad.ogc.common.ILcdInitializationConfig)
). The model decoder factory should only be
used by the ILcdOGCModelProvider
to decode the necessary models. This centralized
access allows implementations to define additional functionality, like a cache mechanism.
The default implementation returns a TLcdOGCModelProvider
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 type TLcdWCSRequestContext
.aModelDecoderFactory
- The model decoder factory that must be used by the model provider
to read dataprotected ILcdWCSCapabilitiesProvider createWCSCapabilitiesProvider(ILcdInitializationConfig aConfig, ILcdOGCModelProvider aModelProvider) throws TLcdOGCServiceException
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.
aConfig
- The servlet configuration parametersaModelProvider
- The model providernull
.TLcdOGCServiceException
- when the capabilities provider can not be created.protected TLcdWCSCommandDispatcher createWCSCommandDispatcherInstance(ILcdInitializationConfig aConfig)
createWCSCommandDispatcher()
to create a command
dispatcher.TLcdWCSCommandDispatcher
.protected ILcdCoverageOfferingList createCoverageOfferingList(ILcdInitializationConfig aConfig)
createWCSCapabilitiesProvider(ILcdInitializationConfig, ILcdOGCModelProvider)
instead.protected ILcdWCSServiceMetadata createServiceMetaData(ILcdInitializationConfig aConfig)
createWCSCapabilitiesProvider(ILcdInitializationConfig, ILcdOGCModelProvider)
instead.protected ILcdWCSModelEncoderFactory createModelEncoderFactory(ILcdInitializationConfig aConfig)
public ILcdRequestHandler createRequestHandler(String aRequest, TLcdWCSCommandDispatcherContext aCommandDispatcherContext) throws TLcdWCSServiceException
aRequest
- the name of a WCS request, e.g. "GetCapabilities"aCommandDispatcherContext
- global objects that may be used by the request handlersTLcdWCSServiceException
- if no handler can be createdcreateCommandDispatcher(com.luciad.ogc.common.ILcdInitializationConfig)