Hyperic HQ Plugin API v. 4.4.0.2

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

java.lang.Object
  extended by 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).


Field Summary
protected  long timeRange
           
 
Constructor Summary
MultiConditionEvaluator(java.lang.Integer alertDefinitionId, java.util.Collection alertConditions, long timeRange, ExecutionStrategy executionStrategy)
           
MultiConditionEvaluator(java.lang.Integer alertDefinitionId, java.util.Collection alertConditions, long timeRange, ExecutionStrategy executionStrategy, java.util.Map events)
           
 
Method Summary
protected  java.util.Collection evaluate(AbstractEvent event)
           
protected  void fireConditionsSatisfied(java.util.Collection fulfilled)
           
 java.lang.Integer getAlertDefinitionId()
           
 ExecutionStrategy getExecutionStrategy()
           
protected  java.util.Collection getFulfillingConditions()
           
 java.io.Serializable getState()
           
 void initialize(java.io.Serializable initialState)
          Initializes this evaluator
protected  boolean isExpired(AbstractEvent event)
           
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeRange

protected final long timeRange
Constructor Detail

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 evaluated
alertConditions - The alerting conditions to evaluate
timeRange - 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 evaluated
alertConditions - The alerting conditions to evaluate
timeRange - 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
events - The map in which events should be stored
Method Detail

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

Hyperic HQ Plugin API v. 4.4.0.2

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