org.rhq.enterprise.server.alert.engine.model
Class AvailabilityDurationCacheElement

java.lang.Object
  extended by org.rhq.enterprise.server.alert.engine.model.AbstractCacheElement<E>
      extended by org.rhq.enterprise.server.alert.engine.model.AbstractEnumCacheElement<org.rhq.core.domain.measurement.AvailabilityType>
          extended by org.rhq.enterprise.server.alert.engine.model.AvailabilityDurationCacheElement

public final class AvailabilityDurationCacheElement
extends AbstractEnumCacheElement<org.rhq.core.domain.measurement.AvailabilityType>

Author:
Jay Shaughnessy

Field Summary
 
Fields inherited from class org.rhq.enterprise.server.alert.engine.model.AbstractCacheElement
active, alertConditionOperator, alertConditionOperatorOption, alertConditionTriggerId, alertConditionValue, log, nextCacheElement
 
Constructor Summary
AvailabilityDurationCacheElement(org.rhq.core.domain.alert.AlertConditionOperator operator, String operatorOption, org.rhq.core.domain.measurement.AvailabilityType value, int conditionTriggerId)
           
 
Method Summary
static void checkCacheElements(List<AvailabilityDurationCacheElement> cacheElements, org.rhq.core.domain.resource.Resource resource, org.rhq.core.domain.measurement.AvailabilityType providedValue)
          Here we check to see if an availability change for a resource should initiate an avail duration check.
 org.rhq.core.domain.alert.AlertConditionOperator.Type getOperatorSupportsType(org.rhq.core.domain.alert.AlertConditionOperator operator)
          For the most part, the operator itself denotes whether it makes comparisons against a sliding scale or not.
 boolean matches(org.rhq.core.domain.measurement.AvailabilityType providedValue, Object... extraParams)
           
 
Methods inherited from class org.rhq.enterprise.server.alert.engine.model.AbstractCacheElement
convertValueToString, equals, getAlertConditionOperator, getAlertConditionOperatorOption, getAlertConditionTriggerId, getAlertConditionValue, hashCode, isActive, isType, process, setActive, setAlertConditionValue, setNextCacheElement, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AvailabilityDurationCacheElement

public AvailabilityDurationCacheElement(org.rhq.core.domain.alert.AlertConditionOperator operator,
                                        String operatorOption,
                                        org.rhq.core.domain.measurement.AvailabilityType value,
                                        int conditionTriggerId)
Parameters:
operator -
operatorOption - the duration, in seconds (as String)
value -
conditionTriggerId - this is actually the alertConditionId, renamed here.
Method Detail

checkCacheElements

public static void checkCacheElements(List<AvailabilityDurationCacheElement> cacheElements,
                                      org.rhq.core.domain.resource.Resource resource,
                                      org.rhq.core.domain.measurement.AvailabilityType providedValue)
Here we check to see if an availability change for a resource should initiate an avail duration check. For each relevant avail duration condition for the resource schedule a job to check the avail state after the condition's duration.

Parameters:
cacheElements -
resource -
providedValue -

matches

public boolean matches(org.rhq.core.domain.measurement.AvailabilityType providedValue,
                       Object... extraParams)
Overrides:
matches in class AbstractEnumCacheElement<org.rhq.core.domain.measurement.AvailabilityType>

getOperatorSupportsType

public org.rhq.core.domain.alert.AlertConditionOperator.Type getOperatorSupportsType(org.rhq.core.domain.alert.AlertConditionOperator operator)
Description copied from class: AbstractCacheElement
For the most part, the operator itself denotes whether it makes comparisons against a sliding scale or not. However, this doesn't hold in every conceivable scenario. Thus, the defaultSupportsType will support 95% of the use cases, and the AbstractCacheElement's getOperatorSupportsType will have a chance to override this.

Overrides:
getOperatorSupportsType in class AbstractEnumCacheElement<org.rhq.core.domain.measurement.AvailabilityType>
See Also:
AlertConditionOperator


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.