Class ALcdOGCWCSCommandDispatcherFactory

java.lang.Object
com.luciad.ogc.wcs.ALcdOGCWCSCommandDispatcherFactory
All Implemented Interfaces:
ILcdOGCCommandDispatcherFactory

public abstract class ALcdOGCWCSCommandDispatcherFactory extends Object implements ILcdOGCCommandDispatcherFactory
This factory class creates a command dispatcher following the OGC WCS specification.

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.

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 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 interface ILcdOGCCommandDispatcherFactory
      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

      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.

      Parameters:
      aConfig - The servlet configuration parameters.
      Returns:
      an ILcdOGCModelDecoderFactory to read data at the server
      Since:
      2017.0
    • createModelProvider

      protected 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.

      The request context object type supplied to the ILcdOGCModelProvider#getModel(String, ALcdRequestContext) is of the type TLcdWCSRequestContext.
      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 abstract 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.
      Parameters:
      aConfig - The servlet configuration parameters
      aModelProvider - The model provider
      Returns:
      a WCS capabilities provider, never null.
      Throws:
      TLcdOGCServiceException - when the capabilities provider can not be created.
      Since:
      2026.0
    • createWCSCommandDispatcherInstance

      protected TLcdWCSCommandDispatcher createWCSCommandDispatcherInstance(ILcdInitializationConfig aConfig)
      Called by createWCSCommandDispatcher() to create a command dispatcher.
      Returns:
      a TLcdWCSCommandDispatcher.
    • createModelEncoderFactory

      protected ILcdWCSModelEncoderFactory createModelEncoderFactory(ILcdInitializationConfig aConfig)
      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

      protected List<String> 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 the WCS 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:

      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