Interface DataChannelQueryFilter

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

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.


 public class MyQueryFilter implements DataChannelQueryFilter {
     public QueryResponse onQuery(ObjectContext originatingContext, Query query,
                                  DataChannelQueryFilterChain filterChain) {
         System.out.println("Do something before query");
         // process query or return some custom response
         QueryResponse response = filterChain.onQuery(originatingContext, query);
         System.out.println("Do something after query");
         return response;
See Also:
DataChannelSyncFilter, ServerModule.contributeDomainQueryFilters(org.apache.cayenne.di.Binder)
  • Method Details

    • onQuery

      QueryResponse onQuery​(ObjectContext originatingContext, Query query, DataChannelQueryFilterChain filterChain)
      originatingContext - originating context of query
      query - that is processed
      filterChain - chain of query filters to invoke after this filter
      query response