com.eventgnosis.filters
Class FilterBase

java.lang.Object
  extended bycom.eventgnosis.system.SystemObject
      extended bycom.eventgnosis.filters.FilterBase

public abstract class FilterBase
extends SystemObject

Contains critical, common methods that filers use.
Most filters have a primary condition witch must be evaluated and if evaluated true the main filter processing is initiated.


Field Summary
 
Fields inherited from class com.eventgnosis.system.SystemObject
CONFIG_MGR, DEST_CREATION_MGR, DEST_MGR, DOWN, ERROR, FILTER_STACK_MGR, HIER_SEP, INITIALIZING, MAX_LEVELS, QUEUE_MGR, SHUTTINGDOWN, SRC_ADAPTER_MGR, SRC_LISTENER_MGR, STARTED, statusMap, UNKNOWN, UP
 
Constructor Summary
FilterBase()
           
 
Method Summary
 SystemObject createDestination(Event ev)
          Must be overridden for each of the base types of system objects.
This method finds successor system object for event flow based on emml configuration(called destination name).
 SystemObject createDestination(java.lang.String destName)
          Creates (finds) standard out destination for this system objects.
 void deleteExpired(java.util.HashMap hm)
          Method for cleaning up property maps (*UniqueEventsFilters ) for those elements witch are expired.
 Condition getCondition()
          Gets the primary filter condition.
 boolean matchCondition(Event ev)
          Evaluates incoming event against primary filter condition.
 void setCondition(Condition cond)
          Sets the primary filter condition.
 void setCondition(EmmlConfig eCfg)
          Sets the primary filter condition.
 void setExpirationTime(long time)
          Sets the expiration for expiring property maps that are often associated with filters.
 void setVars(Log log, java.lang.String name, SystemObject myMgr, com.eventgnosis.config.ConfigurationManager configMgr, EmmlConfig eCfg)
          This method is called after default constructor to set object variable values.
Also allows setting internal configuration values from properties list.
Initialize a system object per it's input params and emml configurations.
Every significant system object(source, destination, filter) should implement this method.
 java.lang.String toString()
           
 
Methods inherited from class com.eventgnosis.system.SystemObject
addMember, checkForLock, continueOperation, doWork, findObject, getCanDelete, getConfig, getConfigMgr, getConfigXml, getDestination, getDestinationInfo, getDestinationName, getDestName, getEventStatisticsXml, getEventStats, getEventStream, getLog, getMember, getMember, getMyManager, getName, getNumMembers, getObjectId, getQueueStatisticsXml, getRuntimeXml, getShutdownTime, getStartTime, getStatus, getStatusAsString, getSummaryXml, getThreadName, getToString, installChildByName, isDisabled, isLocked, kill, locateObject, processEvent, removeAllMembers, removeMember, removeSelf, setCanDelete, setConfigMgr, setDestination, setDestinationName, setLocked, setStartupErrors, setUnlocked, shutdown, startupErrors, submit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterBase

public FilterBase()
Method Detail

createDestination

public SystemObject createDestination(Event ev)
Description copied from class: SystemObject
Must be overridden for each of the base types of system objects.
This method finds successor system object for event flow based on emml configuration(called destination name).

Overrides:
createDestination in class SystemObject
Parameters:
ev - Event - in case destination creation depends on event contents (dynamic destination creation). This is currently not supported.
Returns:
destination SystemObject on witch submit(event) will be called

createDestination

public SystemObject createDestination(java.lang.String destName)
Creates (finds) standard out destination for this system objects.

Parameters:
destName - globally unique system object identifier for this objects stdOut, witch should exists itself in the system as system object.
Returns:
standard out destination system object witch currently can be destination, or another filter stack (destination creation rules).

deleteExpired

public void deleteExpired(java.util.HashMap hm)
Method for cleaning up property maps (*UniqueEventsFilters ) for those elements witch are expired.

Parameters:
hm - - the property map to be cleaned

getCondition

public Condition getCondition()
Gets the primary filter condition.

Returns:
the primary filter condition.

matchCondition

public boolean matchCondition(Event ev)
Evaluates incoming event against primary filter condition.

Parameters:
ev - incoming event
Returns:
true if condition satisfied; false otherwise.
See Also:
Condition.match(com.eventgnosis.types.Event)

setCondition

public void setCondition(Condition cond)
Sets the primary filter condition.

Parameters:
cond - Condition

setCondition

public void setCondition(EmmlConfig eCfg)
Sets the primary filter condition.

Parameters:
eCfg - emml config from the ECA

setExpirationTime

public void setExpirationTime(long time)
Sets the expiration for expiring property maps that are often associated with filters.

Parameters:
time - time in milliseconds from now until expiration

setVars

public void setVars(Log log,
                    java.lang.String name,
                    SystemObject myMgr,
                    com.eventgnosis.config.ConfigurationManager configMgr,
                    EmmlConfig eCfg)
Description copied from class: SystemObject
This method is called after default constructor to set object variable values.
Also allows setting internal configuration values from properties list.
Initialize a system object per it's input params and emml configurations.
Every significant system object(source, destination, filter) should implement this method.

Overrides:
setVars in class SystemObject
Parameters:
log - logger instance for tracking error, warning and info messages.
name - unique name for an instance of system object.
myMgr - managing SystemObject who is responsible for the life-cycle (startup, run, shutdown) of this object.
configMgr - holds configuration data structure used to properly configure runtime setup based on input ECA(s).
eCfg - EmmlConfig instance - specifies the configuration/behavior of the object, witch can be quite complex.

toString

public java.lang.String toString()
Overrides:
toString in class SystemObject