OpenNMS API 1.1.4

org.opennms.netmgt.outage
Class OutageManager

java.lang.Object
  extended byorg.opennms.netmgt.outage.OutageManager
All Implemented Interfaces:
Fiber, PausableFiber

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

The OutageManager receives events selectively and maintains a historical archive of each outage for all devices in the database

Author:
Sowmya Nataraj, Mike Davidson, OpenNMS.org

Field Summary
private static java.lang.String LOG4J_CATEGORY
          The log4j category used to log debug messsages and statements.
private  BroadcastEventProcessor m_eventReceiver
          The events receiver
private  java.util.Map m_serviceTableMap
          The service table map
private static OutageManager m_singleton
          The singleton instance of this class
private  int m_status
          Current status of this fiber
private  RunnableConsumerThreadPool m_writerPool
          The RunnableConsumerThreadPool that runs writers that update the database
private static int NUM_THREADS
          The number of threads that must be started.
 
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
OutageManager()
          The constructor for the OutageManager
 
Method Summary
 void addServiceMapping(java.lang.String svcname, long serviceid)
          Add the svcname/svcid mapping to the servicetable map
private  void buildServiceTableMap(java.sql.Connection dbConn)
          Build the servicename to serviceid map - this map is used so as to avoid a database lookup for each incoming event
private  void closeOutages(java.sql.Connection dbConn)
          Close the currently open outages for services and interfaces that are currently unmanaged
static OutageManager getInstance()
          Return a handle to the OutageManager
 java.lang.String getName()
          Returns a name/id for this process
 long getServiceID(java.lang.String svcname)
          Return the service id for the name passed
 int getStatus()
          Returns the current status
 void init()
           
 void pause()
          Pauses all the threads
 void resume()
          Resumes all the threads
 void start()
          Read the configuration xml, create and start all the subthreads.
 void stop()
          Stops all the threads
 
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
The log4j category used to log debug messsages and statements.

See Also:
Constant Field Values

m_singleton

private static final OutageManager m_singleton
The singleton instance of this class


NUM_THREADS

private static final int NUM_THREADS
The number of threads that must be started.

See Also:
Constant Field Values

m_serviceTableMap

private java.util.Map m_serviceTableMap
The service table map


m_eventReceiver

private BroadcastEventProcessor m_eventReceiver
The events receiver


m_writerPool

private RunnableConsumerThreadPool m_writerPool
The RunnableConsumerThreadPool that runs writers that update the database


m_status

private int m_status
Current status of this fiber

Constructor Detail

OutageManager

public OutageManager()
The constructor for the OutageManager

Method Detail

buildServiceTableMap

private void buildServiceTableMap(java.sql.Connection dbConn)
                           throws java.sql.SQLException
Build the servicename to serviceid map - this map is used so as to avoid a database lookup for each incoming event

Throws:
java.sql.SQLException

closeOutages

private void closeOutages(java.sql.Connection dbConn)
                   throws java.sql.SQLException
Close the currently open outages for services and interfaces that are currently unmanaged

Throws:
java.sql.SQLException

getName

public java.lang.String getName()
Returns a name/id for this process

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

getStatus

public int getStatus()
Returns the current status

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

init

public void init()

start

public void start()
Read the configuration xml, create and start all the subthreads.

Specified by:
start in interface Fiber

pause

public void pause()
Pauses all the threads

Specified by:
pause in interface PausableFiber

resume

public void resume()
Resumes all the threads

Specified by:
resume in interface PausableFiber

stop

public void stop()
Stops all the threads

Specified by:
stop in interface Fiber

getServiceID

public long getServiceID(java.lang.String svcname)
Return the service id for the name passed

Parameters:
svcname - the service name whose service id is required
Returns:
the service id for the name passed, -1 if not found

addServiceMapping

public void addServiceMapping(java.lang.String svcname,
                              long serviceid)
Add the svcname/svcid mapping to the servicetable map


getInstance

public static OutageManager getInstance()
Return a handle to the OutageManager


OpenNMS API 1.1.4

Generated by eevans on November 11 2004 1600.