Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.events.server.session
Class RecoveryConditionEvaluator

java.lang.Object
  extended by org.hyperic.hq.events.server.session.MultiConditionEvaluator
      extended by 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).


Field Summary
 
Fields inherited from class org.hyperic.hq.events.server.session.MultiConditionEvaluator
timeRange
 
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)
           
 
Method Summary
 TriggerFiredEvent getLastAlertFired()
           
 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.
 void initialize(java.io.Serializable initialState)
          Initializes this evaluator
 void triggerFired(TriggerFiredEvent event)
          A trigger was fired, indicating an alert condition evaluated to true
 void triggerNotFired(TriggerNotFiredEvent event)
          A trigger was not fired, indicating that an alert condition evaluated to false
 
Methods inherited from class org.hyperic.hq.events.server.session.MultiConditionEvaluator
evaluate, fireConditionsSatisfied, getAlertDefinitionId, getExecutionStrategy, getFulfillingConditions, isExpired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 definition
alertTriggerId - The ID of the trigger listening for alert from which we are to recover
alertConditions - The conditions of the recovery alert - excluding the "AlertFired" condition. This should just be the conditions that indicate recovery
executionStrategy - 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 definition
alertTriggerId - The ID of the trigger listening for alert from which we are to recover
alertConditions - The conditions of the recovery alert - excluding the "AlertFired" condition. This should just be the conditions that indicate recovery
executionStrategy - The ExecutionStrategy to use for firing AlertConditionsSatisfied events
events - The collection in which to store trigger events
Method Detail

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

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.