Package org.infinispan.objectfilter
Interface Matcher
-
- All Known Implementing Classes:
BaseMatcher
,ProtobufMatcher
,ProtobufObjectReflectionMatcher
,ReflectionMatcher
,RowMatcher
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 (seeorg.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 anEntityManager
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ObjectFilter
getObjectFilter(String queryString)
ObjectFilter
getObjectFilter(String queryString, List<org.infinispan.objectfilter.impl.aggregation.FieldAccumulator> acc)
ObjectFilter
getObjectFilter(FilterSubscription filterSubscription)
Obtains an ObjectFilter instance that is capable of testing a single filter condition.ObjectFilter
getObjectFilter(Query query)
void
match(Object userContext, Object eventType, Object instance)
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.FilterSubscription
registerFilter(String queryString, Map<String,Object> namedParameters, FilterCallback callback, boolean isDeltaFilter, Object... eventType)
FilterSubscription
registerFilter(String queryString, Map<String,Object> namedParameters, FilterCallback callback, Object... eventType)
FilterSubscription
registerFilter(String queryString, FilterCallback callback, boolean isDeltaFilter, Object... eventType)
FilterSubscription
registerFilter(String queryString, FilterCallback callback, Object... eventType)
FilterSubscription
registerFilter(Query query, FilterCallback callback, boolean isDeltaFilter, Object... eventType)
FilterSubscription
registerFilter(Query query, FilterCallback callback, Object... eventType)
void
unregisterFilter(FilterSubscription filterSubscription)
-
-
-
Method Detail
-
registerFilter
FilterSubscription registerFilter(Query query, FilterCallback callback, Object... eventType)
-
registerFilter
FilterSubscription registerFilter(String queryString, Map<String,Object> namedParameters, FilterCallback callback, Object... eventType)
-
registerFilter
FilterSubscription registerFilter(String queryString, FilterCallback callback, Object... eventType)
-
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
void unregisterFilter(FilterSubscription filterSubscription)
-
match
void match(Object userContext, Object eventType, Object instance)
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
ObjectFilter getObjectFilter(FilterSubscription filterSubscription)
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
ObjectFilter getObjectFilter(Query query)
-
getObjectFilter
ObjectFilter getObjectFilter(String queryString)
-
getObjectFilter
ObjectFilter getObjectFilter(String queryString, List<org.infinispan.objectfilter.impl.aggregation.FieldAccumulator> acc)
-
-