org.rhq.domain.correlation
Class AvailabilityNormalizationRule

java.lang.Object
  extended by org.rhq.domain.correlation.NormalizationRule
      extended by org.rhq.domain.correlation.AvailabilityNormalizationRule

public class AvailabilityNormalizationRule
extends NormalizationRule

Normalization Rule for Availabilities

Author:
Heiko W. Rupp

Constructor Summary
AvailabilityNormalizationRule(int resourceId, java.lang.String name, ResultState stateForUp, ResultState stateForDown)
          Create a new Rule
 
Method Summary
 int getResourceId()
          Return the resource id this rule is for
 ResultState getStateForDown()
          Returns the result state that should be used if AvailabilityType is DOWN
 ResultState getStateForUp()
          Returns the result state that should be used if AvailabilityType is UP
 ResultState normalize(org.rhq.core.domain.measurement.Availability availability)
          Normalize the provided input
 
Methods inherited from class org.rhq.domain.correlation.NormalizationRule
getId, getRuleName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AvailabilityNormalizationRule

public AvailabilityNormalizationRule(int resourceId,
                                     java.lang.String name,
                                     ResultState stateForUp,
                                     ResultState stateForDown)
Create a new Rule

Parameters:
resourceId - The resource this should apply to
name - The name of the rule
stateForUp - The ResultState if the resource is UP
stateForDown - The ResultState if the resource reports as DOWN
Method Detail

normalize

public ResultState normalize(org.rhq.core.domain.measurement.Availability availability)
Normalize the provided input

Parameters:
availability - The value to check
Returns:
The rule result for the passed availability

getResourceId

public int getResourceId()
Return the resource id this rule is for

Returns:
stored resourceId

getStateForUp

public ResultState getStateForUp()
Returns the result state that should be used if AvailabilityType is UP

Returns:
result state for AvailabilityType.UP

getStateForDown

public ResultState getStateForDown()
Returns the result state that should be used if AvailabilityType is DOWN

Returns:
result state for AvailabilityType.DOWN