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, NumericDoubleCacheElement, ResourceConfigurationCacheElement, StringCacheElement

public abstract class AbstractCacheElement<T>
extends java.lang.Object

Author:
Joseph Marques

Field Summary
protected  boolean active
           
protected  AlertConditionOperator alertConditionOperator
           
protected  java.lang.Object alertConditionOperatorOption
           
protected  int alertConditionTriggerId
           
protected  T alertConditionValue
           
protected  org.apache.commons.logging.Log log
           
protected  AbstractCacheElement<?> nextCacheElement
           
 
Constructor Summary
AbstractCacheElement(AlertConditionOperator operator, java.lang.Object operatorOption, T value, int conditionId)
           
AbstractCacheElement(AlertConditionOperator operator, T value, int conditionTriggerId)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 AlertConditionOperator getAlertConditionOperator()
           
 java.lang.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, java.lang.Object... extras)
           
 boolean process(T providedValue, java.lang.Object... extraParams)
           
 void setActive(boolean active)
           
 void setAlertConditionValue(T updatedValue)
           
 void setNextCacheElement(AbstractCacheElement<?> nextCacheElement)
           
 java.lang.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 java.lang.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,
                            java.lang.Object operatorOption,
                            T value,
                            int conditionId)
Method Detail

setNextCacheElement

public void setNextCacheElement(AbstractCacheElement<?> nextCacheElement)

getAlertConditionOperator

public AlertConditionOperator getAlertConditionOperator()

getAlertConditionOperatorOption

public java.lang.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,
                             java.lang.Object... extraParams)

matches

public abstract boolean matches(T providedValue,
                                java.lang.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


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


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