com.espertech.esper.filter
Class FilterServiceImpl

java.lang.Object
  extended by com.espertech.esper.filter.FilterServiceImpl
All Implemented Interfaces:
FilterService, FilterServiceSPI

public final class FilterServiceImpl
extends java.lang.Object
implements FilterServiceSPI

Implementation of the filter service interface. Does not allow the same filter callback to be added more then once.


Constructor Summary
protected FilterServiceImpl()
          Constructor.
 
Method Summary
 void add(FilterValueSet filterValueSet, FilterHandle filterCallback)
          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 addFilterServiceListener(FilterServiceListener filterServiceListener)
          Add activity listener.
 void apply(FilterSet filterSet)
          Apply a set of previously taken filters.
 void destroy()
          Destroy the service.
 long evaluate(EventBean theEvent, java.util.Collection<FilterHandle> matches)
          Finds matching filters to the event passed in and collects their associated callback method.
 long evaluate(EventBean theEvent, java.util.Collection<FilterHandle> matches, java.lang.String statementId)
          Finds matching filters to the event passed in and collects their associated callback method, for a particular statement only
 int getCountTypes()
           
 int getFilterCountApprox()
           
 long getFiltersVersion()
          Returns filter version.
 long getNumEventsEvaluated()
          Return a count of the number of events evaluated by this service.
 void remove(FilterHandle filterCallback)
          Remove a filter callback.
 void removeFilterServiceListener(FilterServiceListener filterServiceListener)
          Remove activity listener.
 void removeType(EventType type)
           
 void resetStats()
          Reset the number of events evaluated
 FilterSet take(java.util.Set<java.lang.String> statementIds)
          Take a set of statements of out the active filters, returning a save-set of filters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterServiceImpl

protected FilterServiceImpl()
Constructor.

Method Detail

getFiltersVersion

public long getFiltersVersion()
Description copied from interface: FilterService
Returns filter version.

Specified by:
getFiltersVersion in interface FilterService
Returns:
filter version

destroy

public void destroy()
Description copied from interface: FilterService
Destroy the service.

Specified by:
destroy in interface FilterService

add

public final void add(FilterValueSet filterValueSet,
                      FilterHandle filterCallback)
Description copied from interface: FilterService
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.

Specified by:
add in interface FilterService
Parameters:
filterValueSet - is a specification of filter parameters, contains event type information, event property values and operators
filterCallback - is the callback to be invoked when the filter matches an event

remove

public final void remove(FilterHandle filterCallback)
Description copied from interface: FilterService
Remove a filter callback.

Specified by:
remove in interface FilterService
Parameters:
filterCallback - is the callback to be removed

evaluate

public final long evaluate(EventBean theEvent,
                           java.util.Collection<FilterHandle> matches)
Description copied from interface: FilterService
Finds matching filters to the event passed in and collects their associated callback method.

Specified by:
evaluate in interface FilterService
Parameters:
theEvent - is the event to be matched against filters
matches - is a collection that is populated via add method with any handles for matching filters
Returns:
filter current version

evaluate

public final long evaluate(EventBean theEvent,
                           java.util.Collection<FilterHandle> matches,
                           java.lang.String statementId)
Description copied from interface: FilterService
Finds matching filters to the event passed in and collects their associated callback method, for a particular statement only

Specified by:
evaluate in interface FilterService
Parameters:
theEvent - is the event to be matched against filters
matches - is a collection that is populated via add method with any handles for matching filters
statementId - statement for which to return results for
Returns:
filter current version

getNumEventsEvaluated

public final long getNumEventsEvaluated()
Description copied from interface: FilterService
Return a count of the number of events evaluated by this service.

Specified by:
getNumEventsEvaluated in interface FilterService
Returns:
count of invocations of evaluate method

resetStats

public void resetStats()
Description copied from interface: FilterService
Reset the number of events evaluated

Specified by:
resetStats in interface FilterService

addFilterServiceListener

public void addFilterServiceListener(FilterServiceListener filterServiceListener)
Description copied from interface: FilterServiceSPI
Add activity listener.

Specified by:
addFilterServiceListener in interface FilterServiceSPI
Parameters:
filterServiceListener - to add

removeFilterServiceListener

public void removeFilterServiceListener(FilterServiceListener filterServiceListener)
Description copied from interface: FilterServiceSPI
Remove activity listener.

Specified by:
removeFilterServiceListener in interface FilterServiceSPI
Parameters:
filterServiceListener - to remove

take

public FilterSet take(java.util.Set<java.lang.String> statementIds)
Description copied from interface: FilterServiceSPI
Take a set of statements of out the active filters, returning a save-set of filters.

Specified by:
take in interface FilterServiceSPI
Parameters:
statementIds - statement ids to remove
Returns:
filters

apply

public void apply(FilterSet filterSet)
Description copied from interface: FilterServiceSPI
Apply a set of previously taken filters.

Specified by:
apply in interface FilterServiceSPI
Parameters:
filterSet - to apply

getFilterCountApprox

public int getFilterCountApprox()
Specified by:
getFilterCountApprox in interface FilterServiceSPI

getCountTypes

public int getCountTypes()
Specified by:
getCountTypes in interface FilterServiceSPI

removeType

public void removeType(EventType type)
Specified by:
removeType in interface FilterService

© 2006-2014 EsperTech Inc.
All rights reserved.
Visit us at espertech.com