Overview

This article describes common patterns within the LuciadLightspeed WxS Server APIs.

Command dispatcher factories and capabilities providers

For each of the OGC services there is a command dispatcher that is created using a factory method. Within each of the abstract factories default values are provided as much as possible using sensible values. You can customize the behavior when the defaults are not suited for your use case by overriding the methods of the abstract factory.

A recurring required implementation for each of the OGC services is the need to populate what data needs to be served, together with some generic metadata information about the service itself. For this purpose the abstract factories require you to implement a capabilities provider. The capabilities provider allows you to return only the information that is needed to handle a request from a client application. It also allows you to to return an update to date version of the capabilities for requests and eases implementation of access control.

The capabilities providers control over which users can request which data. All their methods get contextual information about the request, including information whether a user is authenticated or not. This can be used to either filter out data a user should not be able to request or when the user does make requests to decide that access is forbidden. Have a look at the Javadoc of the interfaces of the capabilities providers for more information on which exceptions to throw in which cases such that the right responses can be sent to the client application.

Pick up implementations via service look-up

The command dispatcher factories for the OGC services pick some of the implementations through a service look-up mechanism. You can find more information on this topic within the LuciadLightspeed Developer’s Guide, section Adding instant data format support to your application.

Therefore, adding support may be as simple as writing the implementation of an interface and annotating the implementation.

You can still override the default implementations in the factories without making use of the annotations if you prefer so.

Within the following sections we will indicate for which interfaces contributions are picked up via the service look-up.