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 java.lang.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 java.lang.String
FORMATED_NAN
static org.nustaq.serialization.FSTConfiguration
fst
protected T
state
protected ThresholdingSession
thresholdingSession
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
clearState()
clearStateprotected abstract void
clearStateBeforePersist()
protected Event
createBasicEvent(java.lang.String uei, java.util.Date date, double dsValue, CollectionResourceWrapper resource, java.util.Map<java.lang.String,java.lang.String> additionalParams)
createBasicEventThresholdEvaluatorState.Status
evaluate(double dsValue, java.lang.Long sequenceNumber)
ThresholdEvaluatorState.Status
evaluate(double dsValue, ThresholdEvaluatorState.ThresholdValues thresholdValues, java.lang.Long sequenceNumber)
ThresholdEvaluatorState.ValueStatus
evaluate(ExpressionThresholdValueSupplier valueSupplier, java.lang.Long sequenceNumber)
ThresholdEvaluatorState.ValueStatus
evaluate(ThresholdValuesSupplier thresholdValuesSupplier, java.lang.Long sequenceNumber)
protected abstract ThresholdEvaluatorState.Status
evaluateAfterFetch(double dsValue, ThresholdEvaluatorState.ThresholdValues thresholdValues)
protected java.lang.String
formatValue(double value)
formatValueThresholdingSession
getThresholdingSession()
protected abstract void
initializeState()
protected void
markDirty()
Marks the state for this evaluator as dirty.void
reinitialize()
void
setInstance(java.lang.String instance)
-
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 java.lang.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, java.lang.Long sequenceNumber)
- Specified by:
evaluate
in interfaceThresholdEvaluatorState
-
evaluate
public ThresholdEvaluatorState.Status evaluate(double dsValue, ThresholdEvaluatorState.ThresholdValues thresholdValues, java.lang.Long sequenceNumber)
- Specified by:
evaluate
in interfaceThresholdEvaluatorState
-
evaluate
public ThresholdEvaluatorState.ValueStatus evaluate(ExpressionThresholdValueSupplier valueSupplier, java.lang.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, java.lang.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(java.lang.String uei, java.util.Date date, double dsValue, CollectionResourceWrapper resource, java.util.Map<java.lang.String,java.lang.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 java.lang.String formatValue(double value)
formatValue
- Parameters:
value
- aDouble
object.- Returns:
- a
String
object.
-
getThresholdingSession
public ThresholdingSession getThresholdingSession()
- Specified by:
getThresholdingSession
in interfaceThresholdEvaluatorState
-
setInstance
public void setInstance(java.lang.String instance)
- Specified by:
setInstance
in interfaceThresholdEvaluatorState
-
-