com.espertech.esper.filter
Interface FilterService

All Known Implementing Classes:
FilterServiceImpl

public interface FilterService

Interface for filtering events by event type and event property values. Allows adding and removing filters.

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.


Method Summary
 void 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.
 void evaluate(EventBean event, Collection<FilterHandle> matches)
          Finds matching filters to the event passed in and invokes their associated callback method.
 int getNumEventsEvaluated()
          Return a count of the number of events evaluated by this service.
 void remove(FilterHandle callback)
          Remove a filter callback.
 

Method Detail

evaluate

void evaluate(EventBean event,
              Collection<FilterHandle> matches)
Finds matching filters to the event passed in and invokes their associated callback method.

Parameters:
event - is the event to be matched against filters
matches - is a collection that is populated via add method with any handles for matching filters

add

void 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.

Parameters:
filterValueSet - is a specification of filter parameters, contains event type information, event property values and operators
callback - is the callback to be invoked when the filter matches an event

remove

void remove(FilterHandle callback)
Remove a filter callback.

Parameters:
callback - is the callback to be removed

getNumEventsEvaluated

int getNumEventsEvaluated()
Return a count of the number of events evaluated by this service.

Returns:
count of invocations of evaluate method

destroy

void destroy()
Destroy the service.


© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com