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 String
FORMATED_NAN
static org.nustaq.serialization.FSTConfiguration
fst
protected T
state
protected ThresholdingSession
thresholdingSession
-
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:
evaluate
in interfaceThresholdEvaluatorState
-
evaluate
public ThresholdEvaluatorState.Status evaluate(double dsValue, ThresholdEvaluatorState.ThresholdValues thresholdValues, Long sequenceNumber)
- Specified by:
evaluate
in interfaceThresholdEvaluatorState
-
evaluate
public ThresholdEvaluatorState.ValueStatus evaluate(ExpressionThresholdValueSupplier valueSupplier, Long sequenceNumber) throws ThresholdExpressionException
- Specified by:
evaluate
in 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:
evaluate
in interfaceThresholdEvaluatorState
- Returns:
- the value that was evaluated along with the resulting status
- Throws:
ThresholdExpressionException
-
clearState
public void clearState()
Description copied from interface:ThresholdEvaluatorState
clearState
- Specified by:
clearState
in interfaceThresholdEvaluatorState
-
reinitialize
public void reinitialize()
- Specified by:
reinitialize
in 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
- aString
object.date
- aDate
object.dsValue
- a double.resource
- aCollectionResourceWrapper
object.additionalParams
- aMap
object.- Returns:
- a
Event
object.
-
formatValue
protected String formatValue(double value)
formatValue
-
getThresholdingSession
public ThresholdingSession getThresholdingSession()
- Specified by:
getThresholdingSession
in interfaceThresholdEvaluatorState
-
setInstance
public void setInstance(String instance)
- Specified by:
setInstance
in interfaceThresholdEvaluatorState
-
-