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.
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 Summary
Modifier and TypeMethodDescriptiononQuery(ObjectContext originatingContext, Query query, boolean iteratedResult, DataChannelQueryFilterChain filterChain)
-
Method Details
-
onQuery
List<QueryResult> onQuery(ObjectContext originatingContext, Query query, boolean iteratedResult, DataChannelQueryFilterChain filterChain) - Parameters:
originatingContext- originating context of queryquery- that is processediteratedResult- whether the result should be returned as aResultIteratorinstead of a listfilterChain- chain of query filters to invoke after this filter- Returns:
- query result items
-