Interface ILcdWFSCapabilitiesProvider


public interface ILcdWFSCapabilitiesProvider

Provides the WFS capabilities, or parts of it. The capabilities describe what this server has to offer, that is, which feature types it has. This is a core extension point when implementing your own server. Alternatively, you can use the Fusion Platform, where the capabilities are configured through the Studio web application.

As the capabilities are retrieved for every request, it for example allows to easily add or remove feature types without having to restart the server. Furthermore, the request that is being handled is provided as a parameter, which allows for tailor-made capabilities based on that information. It could for example be used to implement access control: grant certain users access to more feature types than others. Access control is described in some more detail in the ILcdWCSCapabilitiesProvider.

As this interface is called for every request, the implementation must be fast and efficient. It could for example apply caching, to avoid any work if no changes to the capabilities are needed. The simplest implementation would ignore the provided request parameter and always provide the same feature types.

The method getFeatureTypes is typically used for the GetCapabilities request. The methods getServiceProvider(com.luciad.ogc.common.ILcdRequest) and getServiceIdentification(com.luciad.ogc.common.ILcdRequest) are used to provide metadata for the GetCapabilities request. The getFeatureTypes(Collection, ILcdRequest) method is used for the other requests. It allows for retrieving only a sub-set of the information that is needed for validation and processing of the request.

Since:
2017.0
  • Method Details

    • getFeatureTypes

      List<ILcdWFSFeatureType> getFeatureTypes(ILcdRequest aRequest) throws TLcdWFSServiceException

      Returns all feature types. This method is used for the GetCapabilities request.

      The ILcdRequest can be used to determine whether the request is done by an authenticated user. This allows to return a capabilities response that is tailored to the authorization the user has. Main use is to filter out layers for which the user has not been granted permissions.

      Parameters:
      aRequest - the user request.
      Returns:
      all feature types
      Throws:
      TLcdWFSServiceException - if this method encounters a problem while collecting all feature types.
    • getFeatureTypes

      List<ILcdWFSFeatureType> getFeatureTypes(Collection<String> aFeatureTypeNames, ILcdRequest aRequest) throws TLcdWFSServiceException

      Returns the feature types with the given names.

      If there is no corresponding feature type, this method must throw a TLcdWFSServiceException with the INVALID_TYPE_NAME exception code.

      This method allows to differentiate access to feature types based on the user's authentication information. The user's authentication information can be extracted from the request using the getUserPrincipal method. Use the following exception codes for handling access control.

      • NOT_AUTHORIZED: to indicate the user has requested a feature type he does not have access to.
      • AUTHENTICATION_REQUIRED: to indicate the user has request a feature type for which authentication is required but no authentication has been provided yet.

      The resulting exception is translated in a proper response to the client application.

      Parameters:
      aFeatureTypeNames - the feature type names
      aRequest - the user request
      Returns:
      a list of feature types that correspond to the given names. The resulting collection must not be null, must not contain null elements and must have the same size as the given names collection. If no such result can be produced, a TLcdWFSServiceException should be thrown.
      Throws:
      TLcdWFSServiceException - if there is an exception in retrieving the feature types or if incorrect feature types are requested.
    • getServiceIdentification

      TLcdOWSServiceIdentification getServiceIdentification(ILcdRequest aRequest) throws TLcdWFSServiceException

      Returns the TLcdOWSServiceIdentification which contains metadata about this specific server.

      Parameters:
      aRequest - the user request
      Returns:
      the WFS service metadata
      Throws:
      TLcdWFSServiceException - when a problem is encountered when retrieving the metadata.
    • getServiceProvider

      TLcdOWSServiceProvider getServiceProvider(ILcdRequest aRequest) throws TLcdWFSServiceException

      Returns the TLcdOWSServiceProvider which contains metadata about the organization operating this server.

      Parameters:
      aRequest - the user request
      Returns:
      the WFS service provider
      Throws:
      TLcdWFSServiceException - when a problem is encountered when retrieving the service provider.
    • getUpdateSequence

      default String getUpdateSequence(ILcdRequest aRequest) throws TLcdWFSServiceException

      Returns the update sequence of the WFS service. This method is used for the GetCapabilities request.

      By default, this method returns null, which means that no updateSequence will be published in the capabilities.

      Parameters:
      aRequest - the user request
      Returns:
      the update sequence
      Throws:
      TLcdWFSServiceException - when a problem is encountered when retrieving the update sequence
      Since:
      2017.1