Package org.opennms.netmgt.threshd
Class AbstractThresholdEvaluatorState<T extends org.opennms.netmgt.threshd.AbstractThresholdEvaluatorState.AbstractState>
- java.lang.Object
-
- org.opennms.netmgt.threshd.AbstractThresholdEvaluatorState<T>
-
- All Implemented Interfaces:
ReinitializableState,ThresholdEvaluatorState
- Direct Known Subclasses:
ThresholdEvaluatorAbsoluteChange.ThresholdEvaluatorStateAbsoluteChange,ThresholdEvaluatorHighLow.ThresholdEvaluatorStateHighLow,ThresholdEvaluatorRearmingAbsoluteChange.ThresholdEvaluatorStateRearmingAbsoluteChange,ThresholdEvaluatorRelativeChange.ThresholdEvaluatorStateRelativeChange
public abstract class AbstractThresholdEvaluatorState<T extends org.opennms.netmgt.threshd.AbstractThresholdEvaluatorState.AbstractState> extends Object implements ThresholdEvaluatorState
Abstract AbstractThresholdEvaluatorState class.
- Version:
- $Id: $
- Author:
- ranger
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opennms.netmgt.threshd.ThresholdEvaluatorState
ThresholdEvaluatorState.Status, ThresholdEvaluatorState.ThresholdValues, ThresholdEvaluatorState.ValueStatus
-
-
Field Summary
Fields Modifier and Type Field Description static StringFORMATED_NANstatic org.nustaq.serialization.FSTConfigurationfstprotected Tstateprotected ThresholdingSessionthresholdingSession
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opennms.netmgt.threshd.ThresholdEvaluatorState
evaluate, getCleanClone, getEventForState, getThresholdConfig, isTriggered
-
-
-
-
Field Detail
-
FORMATED_NAN
public static final String FORMATED_NAN
- See Also:
- Constant Field Values
-
fst
public static final org.nustaq.serialization.FSTConfiguration fst
-
state
protected T extends org.opennms.netmgt.threshd.AbstractThresholdEvaluatorState.AbstractState state
-
thresholdingSession
protected final ThresholdingSession thresholdingSession
-
-
Method Detail
-
initializeState
protected abstract void initializeState()
-
markDirty
protected void markDirty()
Marks the state for this evaluator as dirty. When a state is dirty it will be persisted the next timepersistStateIfNeeded()is called.Any operation that alters the state enough that it would affect threshold evaluation should call this method to mark the state dirty.
-
evaluate
public ThresholdEvaluatorState.Status evaluate(double dsValue, Long sequenceNumber)
- Specified by:
evaluatein interfaceThresholdEvaluatorState
-
evaluate
public ThresholdEvaluatorState.Status evaluate(double dsValue, ThresholdEvaluatorState.ThresholdValues thresholdValues, Long sequenceNumber)
- Specified by:
evaluatein interfaceThresholdEvaluatorState
-
evaluate
public ThresholdEvaluatorState.ValueStatus evaluate(ExpressionThresholdValueSupplier valueSupplier, Long sequenceNumber) throws ThresholdExpressionException
- Specified by:
evaluatein interfaceThresholdEvaluatorState- Returns:
- the value that was evaluated along with the resulting status
- Throws:
ThresholdExpressionException
-
evaluate
public ThresholdEvaluatorState.ValueStatus evaluate(ThresholdValuesSupplier thresholdValuesSupplier, Long sequenceNumber) throws ThresholdExpressionException
- Specified by:
evaluatein interfaceThresholdEvaluatorState- Returns:
- the value that was evaluated along with the resulting status
- Throws:
ThresholdExpressionException
-
clearState
public void clearState()
Description copied from interface:ThresholdEvaluatorStateclearState
- Specified by:
clearStatein interfaceThresholdEvaluatorState
-
reinitialize
public void reinitialize()
- Specified by:
reinitializein interfaceReinitializableState
-
clearStateBeforePersist
protected abstract void clearStateBeforePersist()
-
evaluateAfterFetch
protected abstract ThresholdEvaluatorState.Status evaluateAfterFetch(double dsValue, ThresholdEvaluatorState.ThresholdValues thresholdValues)
-
createBasicEvent
protected Event createBasicEvent(String uei, Date date, double dsValue, CollectionResourceWrapper resource, Map<String,String> additionalParams)
createBasicEvent
- Parameters:
uei- aStringobject.date- aDateobject.dsValue- a double.resource- aCollectionResourceWrapperobject.additionalParams- aMapobject.- Returns:
- a
Eventobject.
-
formatValue
protected String formatValue(double value)
formatValue
-
getThresholdingSession
public ThresholdingSession getThresholdingSession()
- Specified by:
getThresholdingSessionin interfaceThresholdEvaluatorState
-
setInstance
public void setInstance(String instance)
- Specified by:
setInstancein interfaceThresholdEvaluatorState
-
-