org.hyperic.hq.events.server.session
Class RecoveryConditionEvaluator
java.lang.Object
org.hyperic.hq.events.server.session.MultiConditionEvaluator
org.hyperic.hq.events.server.session.RecoveryConditionEvaluator
- All Implemented Interfaces:
- AlertConditionEvaluator
public class RecoveryConditionEvaluator
- extends MultiConditionEvaluator
Implementation of AlertConditionEvaluator that knows when an
AlertTrigger is fired for the alert it is responsible for recovering. It is
important to isolate this logic b/c a recovery alert shouldn't fire if
condition met events are older than alert fired event (which might happen
during a backfill).
|
Constructor Summary |
RecoveryConditionEvaluator(java.lang.Integer alertDefinitionId,
java.lang.Integer alertTriggerId,
java.lang.Integer recoveringFromAlertDefId,
java.util.Collection alertConditions,
ExecutionStrategy executionStrategy)
|
RecoveryConditionEvaluator(java.lang.Integer alertDefinitionId,
java.lang.Integer alertTriggerId,
java.lang.Integer recoveringFromAlertDefId,
java.util.Collection alertConditions,
ExecutionStrategy executionStrategy,
java.util.Map events)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RecoveryConditionEvaluator
public RecoveryConditionEvaluator(java.lang.Integer alertDefinitionId,
java.lang.Integer alertTriggerId,
java.lang.Integer recoveringFromAlertDefId,
java.util.Collection alertConditions,
ExecutionStrategy executionStrategy)
- Parameters:
alertDefinitionId - The ID of the recovery alert definitionalertTriggerId - The ID of the trigger listening for alert from
which we are to recoveralertConditions - The conditions of the recovery alert - excluding
the "AlertFired" condition. This should just be the conditions
that indicate recoveryexecutionStrategy - The ExecutionStrategy to use for firing
AlertConditionsSatisfied events
RecoveryConditionEvaluator
public RecoveryConditionEvaluator(java.lang.Integer alertDefinitionId,
java.lang.Integer alertTriggerId,
java.lang.Integer recoveringFromAlertDefId,
java.util.Collection alertConditions,
ExecutionStrategy executionStrategy,
java.util.Map events)
- Parameters:
alertDefinitionId - The ID of the recovery alert definitionalertTriggerId - The ID of the trigger listening for alert from
which we are to recoveralertConditions - The conditions of the recovery alert - excluding
the "AlertFired" condition. This should just be the conditions
that indicate recoveryexecutionStrategy - The ExecutionStrategy to use for firing
AlertConditionsSatisfied eventsevents - The collection in which to store trigger events
getState
public java.io.Serializable getState()
- Anything returned from getState() gets persisted to file on server shutdown,
which we don't want to do anymore for the recovery alerts.
- Specified by:
getState in interface AlertConditionEvaluator- Overrides:
getState in class MultiConditionEvaluator
- Returns:
- Any state held by this evaluator that should be persisted between server restarts. May be null if no state saved.
getLastAlertFired
public TriggerFiredEvent getLastAlertFired()
initialize
public void initialize(java.io.Serializable initialState)
- Description copied from interface:
AlertConditionEvaluator
- Initializes this evaluator
- Specified by:
initialize in interface AlertConditionEvaluator- Overrides:
initialize in class MultiConditionEvaluator
- 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.
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- Overrides:
triggerFired in class MultiConditionEvaluator
- 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- Overrides:
triggerNotFired in class MultiConditionEvaluator
- 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.