org.hyperic.hq.events.server.session
Class MultiConditionEvaluator
java.lang.Object
org.hyperic.hq.events.server.session.MultiConditionEvaluator
- All Implemented Interfaces:
- AlertConditionEvaluator
- Direct Known Subclasses:
- RecoveryConditionEvaluator
public class MultiConditionEvaluator
- extends java.lang.Object
- implements AlertConditionEvaluator
Responsible for evaluating a set of alert conditions and firing an
AlertConditionsSatisfiedZEvent
if an appropriate logical combination
of and/or of conditions has been met within an (optional) time range. This
logic was previously encapsulated in a MultiConditionTrigger class. This
evaluation is expected to occur after watched events have met a single
condition (TriggerFired) or not met a single condition (TriggerNotFired).
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
timeRange
protected final long timeRange
MultiConditionEvaluator
public MultiConditionEvaluator(java.lang.Integer alertDefinitionId,
java.util.Collection alertConditions,
long timeRange,
ExecutionStrategy executionStrategy)
- Parameters:
alertDefinitionId
- The ID of the alert definition whose conditions
are being evaluatedalertConditions
- The alerting conditions to evaluatetimeRange
- The optional time range all conditions should occur in.
This should be set to 0 (never expire) unless a
CounterExecutionStrategy is being used.executionStrategy
- The ExecutionStrategy
to use for firing
an AlertConditionsSatisfiedZEvent
when all conditions have
been met
MultiConditionEvaluator
public MultiConditionEvaluator(java.lang.Integer alertDefinitionId,
java.util.Collection alertConditions,
long timeRange,
ExecutionStrategy executionStrategy,
java.util.Map events)
- Parameters:
alertDefinitionId
- The ID of the alert definition whose conditions
are being evaluatedalertConditions
- The alerting conditions to evaluatetimeRange
- The optional time range all conditions should occur in.
This should be set to 0 (never expire) unless a
CounterExecutionStrategy is being used.executionStrategy
- The ExecutionStrategy
to use for firing
an AlertConditionsSatisfiedZEvent
when all conditions have
been metevents
- The map in which events should be stored
evaluate
protected java.util.Collection evaluate(AbstractEvent event)
fireConditionsSatisfied
protected void fireConditionsSatisfied(java.util.Collection fulfilled)
getAlertDefinitionId
public java.lang.Integer getAlertDefinitionId()
- Specified by:
getAlertDefinitionId
in interface AlertConditionEvaluator
- Returns:
- The ID of the alert definition associated with this evaluator
getExecutionStrategy
public ExecutionStrategy getExecutionStrategy()
- Specified by:
getExecutionStrategy
in interface AlertConditionEvaluator
- Returns:
- The
ExecutionStrategy
used by this evaluator to fire alert condition satisfied events
getFulfillingConditions
protected java.util.Collection getFulfillingConditions()
getState
public java.io.Serializable getState()
- Specified by:
getState
in interface AlertConditionEvaluator
- Returns:
- Any state held by this evaluator that should be persisted between server restarts. May be null if no state saved.
initialize
public void initialize(java.io.Serializable initialState)
- Description copied from interface:
AlertConditionEvaluator
- Initializes this evaluator
- Specified by:
initialize
in interface AlertConditionEvaluator
- Parameters:
initialState
- Any state that was saved by the evaluator with this alertDefinitionId the last time the server was shutdown. May be null if no state saved.
isExpired
protected boolean isExpired(AbstractEvent event)
triggerFired
public void triggerFired(TriggerFiredEvent event)
- Description copied from interface:
AlertConditionEvaluator
- A trigger was fired, indicating an alert condition evaluated to true
- Specified by:
triggerFired
in interface AlertConditionEvaluator
- Parameters:
event
- The TriggerFiredEvent
representing the data that
caused the condition to evaluate to true
triggerNotFired
public void triggerNotFired(TriggerNotFiredEvent event)
- Description copied from interface:
AlertConditionEvaluator
- A trigger was not fired, indicating that an alert condition evaluated to
false
- Specified by:
triggerNotFired
in interface AlertConditionEvaluator
- Parameters:
event
- The TriggerNotFiredEvent
representing the data that
caused the condition to evaluate to true
Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.