Class ALcdCSWFilterQueryHandler

java.lang.Object
com.luciad.ogc.csw.server.ALcdCSWFilterQueryHandler
All Implemented Interfaces:
ILcdCSWQueryHandler

public abstract class ALcdCSWFilterQueryHandler extends Object implements ILcdCSWQueryHandler
Abstract handler for OGC Filter based catalog record queries. It takes care of all data-independent functionality. The data-dependent functionality is to execute an OGC Filter query. The method should retrieve metadata from a data storage, such as a database or in-memory collection.

The simplest implementation of a filter query handler is backed by an in-memory collection of Dublin Core records. It can use TLcdOGCFilter.asPredicate(com.luciad.ogc.filter.evaluator.TLcdOGCFilterContext) and TLcdOGCSortBy.asComparator(com.luciad.ogc.filter.evaluator.TLcdOGCFilterContext) to filter and sort, and TLcdCSWRecordTransformationFactory to perform the needed record transformations.

Database backed implementations should translate the filter, pagination, and sorting constraints into equivalent database query statements, such as SQL or QueryDSL.

Since:
2017.0
  • Constructor Details

    • ALcdCSWFilterQueryHandler

      public ALcdCSWFilterQueryHandler()
  • Method Details

    • validateQuery

      public boolean validateQuery(TLcdCSWQuery aQuery, ILcdRequest aRequest) throws TLcdCSWServiceException
      Description copied from interface: ILcdCSWQueryHandler
      Returns true if the given query is a valid query, meaning that is is syntactically correct and uses the right property and type names.
      Specified by:
      validateQuery in interface ILcdCSWQueryHandler
      Parameters:
      aQuery - the query to validate
      aRequest - the request triggering the query
      Returns:
      true if the given query is a valid query, false otherwise.
      Throws:
      TLcdCSWServiceException - can be thrown to provide more meaningful error messages
    • executeQuery

      public final Object executeQuery(TLcdCSWQuery aQuery, long aMaxRecords, long aStartPosition, TLcdCSWRecordType aOutputFormat, ILcdRequest aRequest) throws TLcdCSWServiceException
      Description copied from interface: ILcdCSWQueryHandler
      Executes the given query and returns its result.
      Specified by:
      executeQuery in interface ILcdCSWQueryHandler
      Parameters:
      aQuery - A query to execute
      aMaxRecords - the maximum number of records to return
      aStartPosition - The start position to return queries for
      aOutputFormat - the output format for the record
      aRequest - the request triggering the query
      Returns:
      a result set corresponding to the output format and output schema (for example, TLcdCSWSearchResults with Dublin Core or ISO metadata, or an atom feed
      Throws:
      TLcdCSWServiceException - if the query could not be executed
    • executeFilter

      protected abstract Object executeFilter(TLcdOGCFilter filter, TLcdCSWQuery aQuery, TLcdCSWRecordType aOutputFormat, long aMaxRecords, long aStartPosition, ILcdRequest aRequest) throws TLcdCSWServiceException
      Returns the result of applying the given OGC filter expression to the underlying data set(s) corresponding to the types referred to in the query. The implementation is responsible for pagination, sorting, and transforming the results into the request output type.
      Parameters:
      filter - An OGC Filter. Can be null, in which case no filter should be applied.
      aQuery - additional query properties of the corresponding GetRecords or GetRecordByID request
      aOutputFormat - the requested record output format
      aMaxRecords - The maximum amount of records to return
      aStartPosition - a start position: a positive non-zero value included in the query.
      aRequest - the request triggering the query
      Returns:
      a result set corresponding to the output format and output schema (usually a TLcdCSWSearchResults object with Dubline Core or ISO metadata, or an atom feed)
      Throws:
      TLcdCSWServiceException - if the query could not be executed