org.opennms.netmgt.threshd
Class ThresholdingVisitor

java.lang.Object
  extended by org.opennms.netmgt.collectd.AbstractCollectionSetVisitor
      extended by org.opennms.netmgt.threshd.ThresholdingVisitor
All Implemented Interfaces:
CollectionSetVisitor

public class ThresholdingVisitor
extends AbstractCollectionSetVisitor

Implements CollectionSetVisitor to implement thresholding. Works by simply recording all the attributes that come in via visitAttribute into an internal data structure, per resource, and then on "completeResource", does threshold checking against that in memory structure. Suggested usage is one per CollectableService; this object holds the current state of thresholds for this interface/service combination (so perhaps needs a better name than ThresholdingVisitor)

Author:
Constructor Summary
protected ThresholdingVisitor(int nodeId, String hostAddress, String serviceName, RrdRepository repo, List<String> groupNameList)
           
 
Method Summary
 void completeResource(CollectionResource resource)
           
static ThresholdingVisitor createThresholdingVisitor(int nodeId, String hostAddress, String serviceName, RrdRepository repo, Map params)
           
static void handleThresholdConfigChanged()
           
protected static void initThresholdsDao()
           
 void initThresholdState()
          Causes a new set of ThresholdEntity instances (i.e.
 String toString()
           
 void visitAttribute(CollectionAttribute attribute)
           
 void visitResource(CollectionResource resource)
          When called, we're starting a new resource.
 
Methods inherited from class org.opennms.netmgt.collectd.AbstractCollectionSetVisitor
completeAttribute, completeCollectionSet, completeGroup, visitCollectionSet, visitGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThresholdingVisitor

protected ThresholdingVisitor(int nodeId,
                              String hostAddress,
                              String serviceName,
                              RrdRepository repo,
                              List<String> groupNameList)
Method Detail

initThresholdsDao

protected static void initThresholdsDao()

handleThresholdConfigChanged

public static void handleThresholdConfigChanged()

createThresholdingVisitor

public static ThresholdingVisitor createThresholdingVisitor(int nodeId,
                                                            String hostAddress,
                                                            String serviceName,
                                                            RrdRepository repo,
                                                            Map params)

initThresholdState

public void initThresholdState()
Causes a new set of ThresholdEntity instances (i.e. threshold states) to be obtained for this visitor, at some appropraite point in the near future Can be called when thresholding configuration has changed and we need to refresh the threshold state


visitResource

public void visitResource(CollectionResource resource)
When called, we're starting a new resource. Clears out any stored attribute values from previous resource visits

Specified by:
visitResource in interface CollectionSetVisitor
Overrides:
visitResource in class AbstractCollectionSetVisitor

visitAttribute

public void visitAttribute(CollectionAttribute attribute)
Specified by:
visitAttribute in interface CollectionSetVisitor
Overrides:
visitAttribute in class AbstractCollectionSetVisitor

completeResource

public void completeResource(CollectionResource resource)
Specified by:
completeResource in interface CollectionSetVisitor
Overrides:
completeResource in class AbstractCollectionSetVisitor

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009. All Rights Reserved.