Interface DataChannelQueryFilter

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DataChannelQueryFilter
An interface of a filter that allows to intercept DataChannel query operations. Query filters allow to implement chains of custom processors around a DataChannel.

Example:

public class MyQueryFilter implements DataChannelQueryFilter {
    public List<QueryResult> onQuery(ObjectContext originatingContext, Query query, boolean iteratedResult,
                                     DataChannelQueryFilterChain filterChain) {
        System.out.println("Do something before query");
        // process query or return some custom response
        List<QueryResult> response = filterChain.onQuery(originatingContext, query, iteratedResult);
        System.out.println("Do something after query");
        return response;
    }
}
Since:
4.1
See Also:
  • Method Details

    • onQuery

      List<QueryResult> onQuery(ObjectContext originatingContext, Query query, boolean iteratedResult, DataChannelQueryFilterChain filterChain)
      Parameters:
      originatingContext - originating context of query
      query - that is processed
      iteratedResult - whether the result should be returned as a ResultIterator instead of a list
      filterChain - chain of query filters to invoke after this filter
      Returns:
      query result items