Package org.infinispan.objectfilter
Interface Matcher
public interface Matcher
An object matcher able to test a given object against multiple registered filters specified either as Ickle queries
(a JP-QL subset with full-text support) or using the query DSL (see
org.infinispan.query.dsl
). The matching
filters are notified via a callback supplied when registering the filter. The filter will have to specify the fully
qualified type name of the matching entity type because simple names cannot be easily resolved as it would happen
in the case of an javax.persistence.EntityManager
which has knowledge of all types in advance and is able to
translate simple names to fully qualified names unambiguously.
Full-text predicates are not supported at the moment.
This is a low-level interface which should not be directly used by Infinispan users.
- Since:
- 7.0
- Author:
- anistor@redhat.com
-
Method Summary
Modifier and TypeMethodDescriptiongetObjectFilter
(String queryString) getObjectFilter
(String queryString, List<org.infinispan.objectfilter.impl.aggregation.FieldAccumulator> acc) getObjectFilter
(FilterSubscription filterSubscription) Obtains an ObjectFilter instance that is capable of testing a single filter condition.getObjectFilter
(Query<?> query) void
Test the given instance against all the subscribed filters and notify all callbacks registered for instances of the same instance type.void
matchDelta
(Object userContext, Object eventType, Object instanceOld, Object instanceNew, Object joinEvent, Object updateEvent, Object leaveEvent) Test two instances (which are actually before/after snapshots of the same instance) against all the subscribed filters and notify all callbacks registered for instances of the same instance type.registerFilter
(String queryString, Map<String, Object> namedParameters, FilterCallback callback, boolean isDeltaFilter, Object... eventType) registerFilter
(String queryString, Map<String, Object> namedParameters, FilterCallback callback, Object... eventType) registerFilter
(String queryString, FilterCallback callback, boolean isDeltaFilter, Object... eventType) registerFilter
(String queryString, FilterCallback callback, Object... eventType) registerFilter
(Query<?> query, FilterCallback callback, boolean isDeltaFilter, Object... eventType) registerFilter
(Query<?> query, FilterCallback callback, Object... eventType) void
unregisterFilter
(FilterSubscription filterSubscription)
-
Method Details
-
registerFilter
-
registerFilter
FilterSubscription registerFilter(String queryString, Map<String, Object> namedParameters, FilterCallback callback, Object... eventType) -
registerFilter
-
registerFilter
FilterSubscription registerFilter(Query<?> query, FilterCallback callback, boolean isDeltaFilter, Object... eventType) -
registerFilter
FilterSubscription registerFilter(String queryString, Map<String, Object> namedParameters, FilterCallback callback, boolean isDeltaFilter, Object... eventType) -
registerFilter
FilterSubscription registerFilter(String queryString, FilterCallback callback, boolean isDeltaFilter, Object... eventType) -
unregisterFilter
-
match
Test the given instance against all the subscribed filters and notify all callbacks registered for instances of the same instance type. TheisDelta
parameter of the callback will befalse
.- Parameters:
userContext
- an optional user provided object to be passed to matching subscribers along with the matching instance; can benull
eventType
- on optional event type discriminator that is matched against the event type specified when the filter was registered; can benull
instance
- the object to test against the registered filters; nevernull
-
matchDelta
void matchDelta(Object userContext, Object eventType, Object instanceOld, Object instanceNew, Object joinEvent, Object updateEvent, Object leaveEvent) Test two instances (which are actually before/after snapshots of the same instance) against all the subscribed filters and notify all callbacks registered for instances of the same instance type. TheisDelta
parameter of the callback will betrue
.- Parameters:
userContext
- an optional user provided object to be passed to matching subscribers along with the matching instance; can benull
eventType
- on optional event type discriminator that is matched against the event type specified when the filter was registered; can benull
instanceOld
- the 'before' object to test against the registered filters; nevernull
instanceNew
- the 'after' object to test against the registered filters; nevernull
joinEvent
- the event to generate if the instance joins the matching setupdateEvent
- the event to generate if a matching instance is updated and continues to the matchleaveEvent
- the event to generate if the instance leaves the matching set
-
getObjectFilter
Obtains an ObjectFilter instance that is capable of testing a single filter condition.- Parameters:
filterSubscription
- a filter subscription previously registered with this Matcher; the newly created ObjectFilter will be based on the same filter condition- Returns:
- the single-filter
-
getObjectFilter
-
getObjectFilter
-
getObjectFilter
ObjectFilter getObjectFilter(String queryString, List<org.infinispan.objectfilter.impl.aggregation.FieldAccumulator> acc)
-