public abstract class ALcdCSWFilterQueryHandler extends Object implements ILcdCSWQueryHandler
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.
Constructor and Description |
---|
ALcdCSWFilterQueryHandler() |
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
executeFilter(TLcdOGCFilter filter,
TLcdCSWQuery aQuery,
TLcdCSWRecordType aOutputFormat,
long aMaxRecords,
long aStartPosition,
ILcdRequest aRequest)
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. |
Object |
executeQuery(TLcdCSWQuery aQuery,
long aMaxRecords,
long aStartPosition,
TLcdCSWRecordType aOutputFormat,
ILcdRequest aRequest)
Executes the given query and returns its result.
|
boolean |
validateQuery(TLcdCSWQuery aQuery,
ILcdRequest aRequest)
Returns true if the given query is a valid query, meaning that is is syntactically correct and uses the right
property and type names.
|
public boolean validateQuery(TLcdCSWQuery aQuery, ILcdRequest aRequest) throws TLcdCSWServiceException
ILcdCSWQueryHandler
validateQuery
in interface ILcdCSWQueryHandler
aQuery
- the query to validateaRequest
- the request triggering the queryTLcdCSWServiceException
- can be thrown to provide more meaningful error messagespublic final Object executeQuery(TLcdCSWQuery aQuery, long aMaxRecords, long aStartPosition, TLcdCSWRecordType aOutputFormat, ILcdRequest aRequest) throws TLcdCSWServiceException
ILcdCSWQueryHandler
executeQuery
in interface ILcdCSWQueryHandler
aQuery
- A query to executeaMaxRecords
- the maximum number of records to returnaStartPosition
- The start position to return queries foraOutputFormat
- the output format for the recordaRequest
- the request triggering the queryTLcdCSWSearchResults
with Dublin Core or ISO metadata, or an
atom feed
TLcdCSWServiceException
- if the query could not be executedprotected abstract Object executeFilter(TLcdOGCFilter filter, TLcdCSWQuery aQuery, TLcdCSWRecordType aOutputFormat, long aMaxRecords, long aStartPosition, ILcdRequest aRequest) throws TLcdCSWServiceException
referred to
in the query.
The implementation is responsible for pagination, sorting, and transforming the results into the request output type.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 requestaOutputFormat
- the requested record output formataMaxRecords
- The maximum amount of records to returnaStartPosition
- a start position: a positive non-zero value included in the query.aRequest
- the request triggering the queryTLcdCSWSearchResults
object with Dubline Core or ISO metadata, or an atom feed
)TLcdCSWServiceException
- if the query could not be executed