OpenNMS API 1.2.3

org.opennms.netmgt.threshd
Class Threshd

java.lang.Object
  extended byorg.opennms.netmgt.threshd.Threshd
All Implemented Interfaces:
Fiber, PausableFiber

public final class Threshd
extends java.lang.Object
implements PausableFiber


Field Summary
private static java.lang.String LOG4J_CATEGORY
          Log4j category
private  EventProxy m_proxy
          Reference to the JMS event proxy for sending events.
private  BroadcastEventProcessor m_receiver
          Reference to the event processor
private  Scheduler m_scheduler
          Reference to the threshd scheduler
private  boolean m_schedulingCompleted
          Indicates if all the existing interfaces have been scheduled
private static java.util.Map m_serviceIds
          Holds map of service names to service identifiers
private static Threshd m_singleton
          Singleton instance of the Threshd class
private  int m_status
          Status of the Threshd instance.
private static java.util.Map m_svcThresholders
          Map of all available ServiceThresholder objects indexed by service name
private  java.util.List m_thresholdableServices
          List of all ThresholdableService objects.
private static java.lang.String SQL_RETRIEVE_INTERFACES
          SQL used to retrieve all the interfaces which support a particular service.
private static java.lang.String SQL_RETRIEVE_SERVICE_IDS
          SQL used to retrieve all the service id's and names from the database.
 
Fields inherited from interface org.opennms.core.fiber.PausableFiber
PAUSE_PENDING, PAUSED, RESUME_PENDING
 
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
 
Constructor Summary
private Threshd()
          Constructor.
 
Method Summary
private  boolean alreadyScheduled(java.lang.String ipAddress, java.lang.String pkgName)
          Returns true if specified address/pkg pair is already represented in the thresholdable services list.
 EventProxy getEventProxy()
          Returns reference to the event proxy
static Threshd getInstance()
          Returns singleton instance of the thresholding daemon.
 java.lang.String getName()
          Returns the name of the thresholding daemon.
 Scheduler getScheduler()
          Returns reference to the scheduler
 ServiceThresholder getServiceThresholder(java.lang.String svcName)
          Returns the loaded ServiceThresholder for the specified service name.
 int getStatus()
          Returns current status of the thresholding daemon.
 void init()
           
 boolean isSchedulingCompleted()
           
 void pause()
          Responsible for pausing the thresholding daemon.
 void refreshServicePackages()
           
 void resume()
          Responsible for resuming the thresholding daemon.
private  void scheduleExistingInterfaces()
          Schedule existing interfaces for thresholding.
(package private)  void scheduleInterface(int nodeId, java.lang.String ipAddress, java.lang.String svcName, boolean existing)
          This method is responsible for scheduling the specified node/address/svcname tuple for thresholding.
 void setSchedulingCompleted(boolean schedulingCompleted)
           
 void start()
          Responsible for starting the thresholding daemon.
 void stop()
          Responsible for stopping the thresholding daemon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_CATEGORY

private static final java.lang.String LOG4J_CATEGORY
Log4j category

See Also:
Constant Field Values

SQL_RETRIEVE_INTERFACES

private static final java.lang.String SQL_RETRIEVE_INTERFACES
SQL used to retrieve all the interfaces which support a particular service.

See Also:
Constant Field Values

SQL_RETRIEVE_SERVICE_IDS

private static final java.lang.String SQL_RETRIEVE_SERVICE_IDS
SQL used to retrieve all the service id's and names from the database.

See Also:
Constant Field Values

m_singleton

private static final Threshd m_singleton
Singleton instance of the Threshd class


m_serviceIds

private static final java.util.Map m_serviceIds
Holds map of service names to service identifiers


m_thresholdableServices

private java.util.List m_thresholdableServices
List of all ThresholdableService objects.


m_scheduler

private Scheduler m_scheduler
Reference to the threshd scheduler


m_schedulingCompleted

private boolean m_schedulingCompleted
Indicates if all the existing interfaces have been scheduled


m_proxy

private EventProxy m_proxy
Reference to the JMS event proxy for sending events.


m_status

private int m_status
Status of the Threshd instance.


m_receiver

private BroadcastEventProcessor m_receiver
Reference to the event processor


m_svcThresholders

private static java.util.Map m_svcThresholders
Map of all available ServiceThresholder objects indexed by service name

Constructor Detail

Threshd

private Threshd()
Constructor.

Method Detail

init

public void init()

start

public void start()
Responsible for starting the thresholding daemon.

Specified by:
start in interface Fiber

stop

public void stop()
Responsible for stopping the thresholding daemon.

Specified by:
stop in interface Fiber

pause

public void pause()
Responsible for pausing the thresholding daemon.

Specified by:
pause in interface PausableFiber

resume

public void resume()
Responsible for resuming the thresholding daemon.

Specified by:
resume in interface PausableFiber

getStatus

public int getStatus()
Returns current status of the thresholding daemon.

Specified by:
getStatus in interface Fiber
Returns:
The current status of the Fiber.

getName

public java.lang.String getName()
Returns the name of the thresholding daemon.

Specified by:
getName in interface Fiber
Returns:
The name of the Fiber.

getInstance

public static Threshd getInstance()
Returns singleton instance of the thresholding daemon.


getScheduler

public Scheduler getScheduler()
Returns reference to the scheduler


getEventProxy

public EventProxy getEventProxy()
Returns reference to the event proxy


getServiceThresholder

public ServiceThresholder getServiceThresholder(java.lang.String svcName)
Returns the loaded ServiceThresholder for the specified service name.

Parameters:
svcName - Service name to lookup.
Returns:
ServiceThresholder responsible for performing thresholding on the specified service.

scheduleExistingInterfaces

private void scheduleExistingInterfaces()
                                 throws java.sql.SQLException
Schedule existing interfaces for thresholding.

Throws:
java.sql.SQLException - if database errors encountered.

scheduleInterface

void scheduleInterface(int nodeId,
                       java.lang.String ipAddress,
                       java.lang.String svcName,
                       boolean existing)
This method is responsible for scheduling the specified node/address/svcname tuple for thresholding.

Parameters:
nodeId - Node id
ipAddress - IP address
svcName - Service name
existing - True if called by scheduleExistingInterfaces(), false otheriwse

alreadyScheduled

private boolean alreadyScheduled(java.lang.String ipAddress,
                                 java.lang.String pkgName)
Returns true if specified address/pkg pair is already represented in the thresholdable services list. False otherwise.


isSchedulingCompleted

public boolean isSchedulingCompleted()
Returns:
Returns the schedulingCompleted.

setSchedulingCompleted

public void setSchedulingCompleted(boolean schedulingCompleted)
Parameters:
schedulingCompleted - The schedulingCompleted to set.

refreshServicePackages

public void refreshServicePackages()

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.