org.rhq.enterprise.server.alert.engine.model
Class AbstractCacheElement<T>

java.lang.Object
  extended by org.rhq.enterprise.server.alert.engine.model.AbstractCacheElement<T>
Direct Known Subclasses:
AbstractEnumCacheElement, CallTimeDataCacheElement, DriftCacheElement, NumericDoubleCacheElement, ResourceConfigurationCacheElement, StringCacheElement

public abstract class AbstractCacheElement<T>
extends Object

Author:
Joseph Marques

Field Summary
protected  boolean active
           
protected  AlertConditionOperator alertConditionOperator
           
protected  Object alertConditionOperatorOption
           
protected  int alertConditionTriggerId
           
protected  T alertConditionValue
           
protected  org.apache.commons.logging.Log log
           
protected  AbstractCacheElement<?> nextCacheElement
           
 
Constructor Summary
AbstractCacheElement(AlertConditionOperator operator, Object operatorOption, T value, int conditionId)
           
AbstractCacheElement(AlertConditionOperator operator, T value, int conditionTriggerId)
           
 
Method Summary
 String convertValueToString(T providedValue)
           
 boolean equals(Object obj)
           
 AlertConditionOperator getAlertConditionOperator()
           
 Object getAlertConditionOperatorOption()
           
 int getAlertConditionTriggerId()
           
 T getAlertConditionValue()
           
abstract  AlertConditionOperator.Type getOperatorSupportsType(AlertConditionOperator operator)
          For the most part, the operator itself denotes whether it makes comparisons against a sliding scale or not.
 int hashCode()
           
 boolean isActive()
           
 boolean isType(AlertConditionOperator.Type type)
          convenience method to test whether this cache element instance equals the specified type
abstract  boolean matches(T providedValue, Object... extras)
           
 boolean process(T providedValue, Object... extraParams)
           
 void setActive(boolean active)
           
 void setAlertConditionValue(T updatedValue)
           
 void setNextCacheElement(AbstractCacheElement<?> nextCacheElement)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log

alertConditionOperator

protected AlertConditionOperator alertConditionOperator

alertConditionOperatorOption

protected Object alertConditionOperatorOption

alertConditionValue

protected T alertConditionValue

alertConditionTriggerId

protected int alertConditionTriggerId

active

protected boolean active

nextCacheElement

protected AbstractCacheElement<?> nextCacheElement
Constructor Detail

AbstractCacheElement

public AbstractCacheElement(AlertConditionOperator operator,
                            T value,
                            int conditionTriggerId)

AbstractCacheElement

public AbstractCacheElement(AlertConditionOperator operator,
                            Object operatorOption,
                            T value,
                            int conditionId)
Method Detail

setNextCacheElement

public void setNextCacheElement(AbstractCacheElement<?> nextCacheElement)

getAlertConditionOperator

public AlertConditionOperator getAlertConditionOperator()

getAlertConditionOperatorOption

public Object getAlertConditionOperatorOption()

getAlertConditionValue

public T getAlertConditionValue()

setAlertConditionValue

public void setAlertConditionValue(T updatedValue)

getAlertConditionTriggerId

public int getAlertConditionTriggerId()

isActive

public boolean isActive()

setActive

public void setActive(boolean active)

process

public final boolean process(T providedValue,
                             Object... extraParams)

matches

public abstract boolean matches(T providedValue,
                                Object... extras)

getOperatorSupportsType

public abstract AlertConditionOperator.Type getOperatorSupportsType(AlertConditionOperator operator)
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.

See Also:
AlertConditionOperator

isType

public boolean isType(AlertConditionOperator.Type type)
convenience method to test whether this cache element instance equals the specified type


convertValueToString

public String convertValueToString(T providedValue)

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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