org.opennms.netmgt.rtc
Class RTCManager

java.lang.Object
  extended by org.opennms.netmgt.daemon.AbstractServiceDaemon
      extended by org.opennms.netmgt.rtc.RTCManager
All Implemented Interfaces:
Fiber, PausableFiber, SpringServiceDaemon, ServiceDaemon, org.springframework.beans.factory.InitializingBean

public final class RTCManager
extends AbstractServiceDaemon

Maintains calculations for categories.

The RTCManager maintains data required so as to calculate availability for the different categories configured in categories.xml

The RTC initializes its data from the database when it comes up. It then subscribes to the Events subsystem to receive events of interest to keep the data up-to-date

Availability data is sent out to listeners who indicate that they are listening by sending an RTC 'subscribe' event. The subscribe event has an URL and user/passwd info. so RTC can post data to the URL

The RTC has two timers(a low threshold and a high threshold) and a counter that can run upto a configurable max number of events - these are used to determine when availability information is to be sent out when event streams are coming in at normal rates. When no events are received, a timer configured with a user configured time(defaulting to one minute) decides the interval at which data is sent

Author:
Sowmya Kumaraswamy , OpenNMS.org
See Also:
RTCConstants, DataSender, DataManager

Field Summary
 
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
RTCManager()
          The constructor for the RTCManager
 
Method Summary
 void checkTimerTasksOnEventReceipt()
          Check the timer tasks.
static Map<String,RTCCategory> getCategories()
          Gets the categories.
static DataManager getDataManager()
          Gets the data manager.
 org.opennms.netmgt.rtc.DataSender getDataSender()
          Get the data sender.
static RTCManager getInstance()
          Gets the instance of the RTCmanager.
static long getRollingWindow()
          Gets the rolling window.
 void incrementCounter()
          Updates the number of events received.
protected  void onInit()
           
protected  void onStart()
           
protected  void onStop()
           
 void resetUserTimer()
          Reset the user timer.
static void setDataManager(DataManager dataMgr)
          Sets the data manager.
 
Methods inherited from class org.opennms.netmgt.daemon.AbstractServiceDaemon
afterPropertiesSet, debugf, debugf, errorf, errorf, fatalf, fatalf, getName, getStatus, getStatusText, infof, infof, init, isPaused, isRunning, isStarting, isStartPending, log, onPause, onResume, pause, resume, setStatus, start, status, stop, waitForStatus, waitForStatus, warnf, warnf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTCManager

public RTCManager()
The constructor for the RTCManager

Method Detail

checkTimerTasksOnEventReceipt

public void checkTimerTasksOnEventReceipt()
Check the timer tasks. Reset any of the timer tasks if they need to be reset (indicated by their being set to null on timer task completion). If the events counter has exceeded maxEventsBeforeResend, send data out and reset timers


resetUserTimer

public void resetUserTimer()
Reset the user timer.


onInit

protected void onInit()
Specified by:
onInit in class AbstractServiceDaemon

onStart

protected void onStart()
Overrides:
onStart in class AbstractServiceDaemon

onStop

protected void onStop()
Overrides:
onStop in class AbstractServiceDaemon

incrementCounter

public void incrementCounter()
Updates the number of events received. Increment the counter that keeps track of number of events received since data was last sent out


getDataSender

public org.opennms.netmgt.rtc.DataSender getDataSender()
Get the data sender.

Returns:
the data sender

getCategories

public static Map<String,RTCCategory> getCategories()
Gets the categories.

Returns:
the categories

getDataManager

public static DataManager getDataManager()
Gets the data manager.

Returns:
the data manager

setDataManager

public static void setDataManager(DataManager dataMgr)
Sets the data manager.


getRollingWindow

public static long getRollingWindow()
Gets the rolling window.

Returns:
the configured rolling window

getInstance

public static RTCManager getInstance()
Gets the instance of the RTCmanager.

Returns:
the RTCManager singleton.


Copyright © 2009. All Rights Reserved.