Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hq.bizapp.server.trigger.conditional
Class MeasurementThresholdTrigger

java.lang.Object
  extended by org.hyperic.hq.events.ext.AbstractTrigger
      extended by org.hyperic.hq.bizapp.server.trigger.conditional.MeasurementThresholdTrigger
All Implemented Interfaces:
ConditionalTriggerInterface, RegisterableTriggerInterface, TriggerInterface

public class MeasurementThresholdTrigger
extends AbstractTrigger
implements ConditionalTriggerInterface

A simple trigger which fires if a measurement event exceeds a threshold.


Field Summary
 
Fields inherited from interface org.hyperic.hq.bizapp.server.trigger.conditional.ConditionalTriggerInterface
CFG_COMPARATOR, CFG_ID, CFG_NAME, CFG_OPTION, CFG_THRESHOLD, CFG_TYPE, MAP_COND_TRIGGER
 
Constructor Summary
MeasurementThresholdTrigger()
           
 
Method Summary
 ConfigResponse getConfigResponse()
           
 ConfigResponse getConfigResponse(AppdefEntityID id, AlertConditionValue cond)
          Translate alert condition to config response object
 ConfigSchema getConfigSchema()
          Return the schema for the configuration of this trigger.
 java.lang.Class[] getInterestedEventTypes()
          Get the event classes that the trigger is interested in seeing.
 java.lang.Integer[] getInterestedInstanceIDs(java.lang.Class c)
          Get a list of instance IDs specific to a class (as returned by getInterestedEventTypes) which the trigger is interested in seeing.
 java.lang.Integer getMeasurementID()
           
 int getOperator()
           
protected  int getOperator(java.lang.String soperator)
          extracts the operator
protected  ConfigResponse getSharedConfigResponse(AlertConditionValue cond)
           
 double getThreshold()
           
 void init(RegisteredTriggerValue tval, AlertConditionEvaluator alertConditionEvaluator)
          Initialize the trigger with a value object.
 void processEvent(AbstractEvent e)
          Process an event from the dispatcher.
 void setMeasurementID(java.lang.Integer val)
           
 void setOperator(int val)
           
 void setThreshold(double val)
           
 
Methods inherited from class org.hyperic.hq.events.ext.AbstractTrigger
fireActions, getId, isEnabled, notFired, prepareTriggerFiredEvent, prepareTriggerFiredEvent, setAlertConditionEvaluator, setEnabled, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementThresholdTrigger

public MeasurementThresholdTrigger()
Method Detail

getConfigResponse

public ConfigResponse getConfigResponse()

getConfigResponse

public ConfigResponse getConfigResponse(AppdefEntityID id,
                                        AlertConditionValue cond)
                                 throws InvalidOptionException,
                                        InvalidOptionValueException
Description copied from interface: ConditionalTriggerInterface
Translate alert condition to config response object

Specified by:
getConfigResponse in interface ConditionalTriggerInterface
cond - the alert condition
Returns:
the equivalent config response object
Throws:
InvalidOptionException
InvalidOptionValueException

getConfigSchema

public ConfigSchema getConfigSchema()
Description copied from interface: ConditionalTriggerInterface
Return the schema for the configuration of this trigger. This does not actually get called by anyone, it's here to enforce the authors of triggers to implement getConfigSchema() for the CLI.

Specified by:
getConfigSchema in interface ConditionalTriggerInterface
Specified by:
getConfigSchema in interface RegisterableTriggerInterface
See Also:
RegisterableTriggerInterface.getConfigSchema()

getInterestedEventTypes

public java.lang.Class[] getInterestedEventTypes()
Description copied from interface: RegisterableTriggerInterface
Get the event classes that the trigger is interested in seeing. This is an optimization, so that a trigger's processEvent() method is called only when a valid event occurs.

Specified by:
getInterestedEventTypes in interface RegisterableTriggerInterface
Returns:
an array of Class objects which implement the 'Event' interface
See Also:
RegisterableTriggerInterface.getInterestedEventTypes()

getInterestedInstanceIDs

public java.lang.Integer[] getInterestedInstanceIDs(java.lang.Class c)
Description copied from interface: RegisterableTriggerInterface
Get a list of instance IDs specific to a class (as returned by getInterestedEventTypes) which the trigger is interested in seeing. These values are specific to the event type, and represent things such as specific measurements.

Specified by:
getInterestedInstanceIDs in interface RegisterableTriggerInterface
Parameters:
c - Class to get the interested event IDs for
Returns:
An array of integers representing the instance IDs for the specific event class
See Also:
RegisterableTriggerInterface.getInterestedInstanceIDs(java.lang.Class)

getMeasurementID

public java.lang.Integer getMeasurementID()

getOperator

public int getOperator()

getOperator

protected int getOperator(java.lang.String soperator)
                   throws InvalidTriggerDataException
extracts the operator

Throws:
InvalidTriggerDataException

getSharedConfigResponse

protected ConfigResponse getSharedConfigResponse(AlertConditionValue cond)
                                          throws InvalidOptionException,
                                                 InvalidOptionValueException
Throws:
InvalidOptionException
InvalidOptionValueException

getThreshold

public double getThreshold()

init

public void init(RegisteredTriggerValue tval,
                 AlertConditionEvaluator alertConditionEvaluator)
          throws InvalidTriggerDataException
Description copied from interface: RegisterableTriggerInterface
Initialize the trigger with a value object.

Specified by:
init in interface RegisterableTriggerInterface
Parameters:
tval - The trigger data object containing all the configuration data
alertConditionEvaluator - The evaluator to use for reporting trigger fired/trigger not fired events
Throws:
InvalidTriggerDataException - if the configuration data is invalid.
See Also:
org.hyperic.hq.events.ext.RegisterableTriggerInterface#init(org.hyperic.hq.events.shared.RegisteredTriggerValue)

processEvent

public void processEvent(AbstractEvent e)
                  throws EventTypeException
Description copied from interface: TriggerInterface
Process an event from the dispatcher.

Specified by:
processEvent in interface TriggerInterface
Parameters:
e - the Event to process
Throws:
EventTypeException - if the trigger does not process events of the type provided

setMeasurementID

public void setMeasurementID(java.lang.Integer val)

setOperator

public void setOperator(int val)

setThreshold

public void setThreshold(double val)

Hyperic HQ Plugin API v. 4.4.0.2

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