public interface FilterService
Filters are defined by a FilterSpecCompiled
and are associated with a FilterHandle
callback.
Implementations may decide if the same filter callback can be registered twice for different or some
filter specifications.
The performance of an implementation of this service is crucial in achieving a high overall event throughput.
Modifier and Type | Method and Description |
---|---|
FilterServiceEntry |
add(FilterValueSet filterValueSet,
FilterHandle callback)
Add a filter for events as defined by the filter specification, and register a
callback to be invoked upon evaluation of an event that matches the filter spec.
|
void |
destroy()
Destroy the service.
|
long |
evaluate(EventBean theEvent,
Collection<FilterHandle> matches)
Finds matching filters to the event passed in and collects their associated callback method.
|
long |
evaluate(EventBean theEvent,
Collection<FilterHandle> matches,
int statementId)
Finds matching filters to the event passed in and collects their associated callback method, for a particular statement only
|
long |
getFiltersVersion()
Returns filter version.
|
long |
getNumEventsEvaluated()
Return a count of the number of events evaluated by this service.
|
void |
remove(FilterHandle callback,
FilterServiceEntry filterServiceEntry)
Remove a filter callback.
|
void |
removeType(EventType type) |
void |
resetStats()
Reset the number of events evaluated
|
long evaluate(EventBean theEvent, Collection<FilterHandle> matches)
theEvent
- is the event to be matched against filtersmatches
- is a collection that is populated via add method with any handles for matching filterslong evaluate(EventBean theEvent, Collection<FilterHandle> matches, int statementId)
theEvent
- is the event to be matched against filtersmatches
- is a collection that is populated via add method with any handles for matching filtersstatementId
- statement for which to return results forFilterServiceEntry add(FilterValueSet filterValueSet, FilterHandle callback)
filterValueSet
- is a specification of filter parameters, contains
event type information, event property values and operatorscallback
- is the callback to be invoked when the filter matches an eventvoid remove(FilterHandle callback, FilterServiceEntry filterServiceEntry)
callback
- is the callback to be removedfilterServiceEntry
- entrylong getNumEventsEvaluated()
void resetStats()
void destroy()
long getFiltersVersion()
void removeType(EventType type)