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 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 Detail

      • 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. The isDelta parameter of the callback will be false.
        Parameters:
        userContext - an optional user provided object to be passed to matching subscribers along with the matching instance; can be null
        eventType - on optional event type discriminator that is matched against the event type specified when the filter was registered; can be null
        instance - the object to test against the registered filters; never null
      • 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. The isDelta parameter of the callback will be true.
        Parameters:
        userContext - an optional user provided object to be passed to matching subscribers along with the matching instance; can be null
        eventType - on optional event type discriminator that is matched against the event type specified when the filter was registered; can be null
        instanceOld - the 'before' object to test against the registered filters; never null
        instanceNew - the 'after' object to test against the registered filters; never null
        joinEvent - the event to generate if the instance joins the matching set
        updateEvent - the event to generate if a matching instance is updated and continues to the match
        leaveEvent - 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​(String queryString,
                                     List<org.infinispan.objectfilter.impl.aggregation.FieldAccumulator> acc)