Package org.opennms.netmgt.threshd
Class ThresholdEntity
- java.lang.Object
-
- org.opennms.netmgt.threshd.ThresholdEntity
-
-
Constructor Summary
Constructors Constructor Description ThresholdEntity(EntityScopeProvider entityScopeProvider)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddThreshold(BaseThresholdDefConfigWrapper threshold, ThresholdingSession thresholdingSession)addThresholdThresholdEntityclone()Returns a copy of this ThresholdEntity object.voiddelete()Delete this will check states and will send rearm for all triggered.List<Event>evaluateAndCreateEvents(Map<String,Double> values, Date date)Evaluates the threshold in light of the provided datasource value and create any events for thresholds.List<Event>evaluateAndCreateEvents(CollectionResourceWrapper resource, Map<String,Double> values, Date date)Evaluates the threshold in light of the provided datasource value, for the named instance (or the generic instance if instance is null) and create any events for thresholds.StringgetDataSourceExpression()Get datasource nameStringgetDatasourceLabel()Get datasource LabelStringgetDatasourceType()Get datasource typeCollection<String>getRequiredDatasources()Returns the names of the dataousrces required to evaluate this threshold entityBaseThresholdDefConfigWrappergetThresholdConfig()getThresholdConfigstatic List<ThresholdEvaluator>getThresholdEvaluators()getThresholdEvaluatorsList<ThresholdEvaluatorState>getThresholdEvaluatorStates(String instance)Returns the evaluator states *for the given instance.voidmerge(ThresholdEntity entity)Merges the configuration and update states using parameter entity as a reference.voidsetEventProxy(ThresholdingEventProxy eventProxy)StringtoString()This method is responsible for returning a String object which represents the content of this ThresholdEntity.
-
-
-
Constructor Detail
-
ThresholdEntity
public ThresholdEntity(EntityScopeProvider entityScopeProvider)
Constructor.
-
-
Method Detail
-
getThresholdConfig
public BaseThresholdDefConfigWrapper getThresholdConfig()
getThresholdConfig
- Returns:
- a
BaseThresholdDefConfigWrapperobject.
-
getDataSourceExpression
public String getDataSourceExpression()
Get datasource name- Returns:
- a
Stringobject.
-
getDatasourceLabel
public String getDatasourceLabel()
Get datasource Label- Returns:
- a
Stringobject.
-
getRequiredDatasources
public Collection<String> getRequiredDatasources()
Returns the names of the dataousrces required to evaluate this threshold entity- Returns:
- Collection of the names of datasources
-
clone
public ThresholdEntity clone()
Returns a copy of this ThresholdEntity object. NOTE: The m_lowThreshold and m_highThreshold member variables are not actually cloned...the returned ThresholdEntity object will simply contain references to the same Threshold objects as the original ThresholdEntity object. All state will be lost, particularly instances, so it's not a true clone by any stretch of the imagination- Overrides:
clonein classObject- Returns:
- a
ThresholdEntityobject.
-
toString
public String toString()
This method is responsible for returning a String object which represents the content of this ThresholdEntity. Primarily used for debugging purposes.
-
evaluateAndCreateEvents
public List<Event> evaluateAndCreateEvents(Map<String,Double> values, Date date)
Evaluates the threshold in light of the provided datasource value and create any events for thresholds. Semi-deprecated method; only used for old Thresholding code (threshd and friends) Implemented in terms of the other method with the same name and the extra param- Parameters:
values- map of values (by datasource name) to evaluate against the threshold (might be an expression)date- Date to use in created events- Returns:
- List of events
-
evaluateAndCreateEvents
public List<Event> evaluateAndCreateEvents(CollectionResourceWrapper resource, Map<String,Double> values, Date date)
Evaluates the threshold in light of the provided datasource value, for the named instance (or the generic instance if instance is null) and create any events for thresholds.- Parameters:
values- map of values (by datasource name) to evaluate against the threshold (might be an expression)date- Date to use in created eventsresource- aCollectionResourceWrapperobject.- Returns:
- List of events
-
addThreshold
public void addThreshold(BaseThresholdDefConfigWrapper threshold, ThresholdingSession thresholdingSession)
addThreshold
- Parameters:
threshold- aBaseThresholdDefConfigWrapperobject.
-
getThresholdEvaluatorStates
public List<ThresholdEvaluatorState> getThresholdEvaluatorStates(String instance)
Returns the evaluator states *for the given instance.- Parameters:
instance- The key to use to identify the instance to get states for. Can be null to get the default instance- Returns:
- a
Listobject.
-
merge
public void merge(ThresholdEntity entity)
Merges the configuration and update states using parameter entity as a reference.- Parameters:
entity- aThresholdEntityobject.
-
delete
public void delete()
Delete this will check states and will send rearm for all triggered.
-
getThresholdEvaluators
public static final List<ThresholdEvaluator> getThresholdEvaluators()
getThresholdEvaluators
- Returns:
- a
Listobject.
-
setEventProxy
public void setEventProxy(ThresholdingEventProxy eventProxy)
-
-