|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.rtc.DataSender
The DataSender is responsible to send data out to 'listeners' When the RTCManager's timers go off, the DataSender is prompted to send data, which it does by maintaining a 'SendRequest' runnable queue so as to not block the RTCManager
Nested Class Summary | |
private class |
DataSender.SendRequest
Inner class to send data to all the categories - this runnable prevents the RTCManager from having to block until data is computed, converted to XML and sent out |
Field Summary | |
private java.util.Map |
m_categories
The category map |
private java.util.Map |
m_catUrlMap
The listeners like the webui that send a URL to which the data is to be sent |
private FifoQueue |
m_dataSenderQ
The queue to which data send requests are queued |
private RunnableConsumerThreadPool |
m_dsrPool
The data sender thread pool |
private EuiLevelMapper |
m_euiMapper
The category to xml mapper |
private int |
m_status
The current status of this fiber |
private int |
POST_ERROR_LIMIT
The allowable number of times posts can have errors before an URL is automatically unsubscribed |
Fields inherited from interface org.opennms.core.fiber.Fiber |
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED |
Constructor Summary | |
DataSender(java.util.Map categories,
int numSenders)
The constructor for this object |
Method Summary | |
java.lang.String |
getName()
Returns a name/id for this fiber |
int |
getStatus()
Returns the current status |
void |
notifyToSend()
Notify the DataSender to send data - create a new 'SendRequest' to send the data and queue to the consumer |
void |
sendData()
Loop through the categories and send out data for all categories that have changed |
private int |
setCurrentThreadPriority(int priority)
Set the current thread's priority to the passed value and return the old priority |
void |
start()
Start the datasender threadpool |
void |
stop()
Shutdown the data sender thread pool |
void |
subscribe(java.lang.String url,
java.lang.String catlabel,
java.lang.String user,
java.lang.String passwd)
Subscribe - Add the recd. |
void |
unsubscribe(java.lang.String urlStr)
Unsubscribe - remove the recd. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.Map m_categories
private java.util.Map m_catUrlMap
private RunnableConsumerThreadPool m_dsrPool
private FifoQueue m_dataSenderQ
private EuiLevelMapper m_euiMapper
private final int POST_ERROR_LIMIT
private int m_status
Constructor Detail |
public DataSender(java.util.Map categories, int numSenders)
categories
- The category map.numSenders
- The number of senders.Method Detail |
private int setCurrentThreadPriority(int priority)
public void start()
start
in interface Fiber
public void stop()
Shutdown the data sender thread pool
stop
in interface Fiber
public java.lang.String getName()
getName
in interface Fiber
Fiber
.public int getStatus()
getStatus
in interface Fiber
Fiber
.public void subscribe(java.lang.String url, java.lang.String catlabel, java.lang.String user, java.lang.String passwd)
public void unsubscribe(java.lang.String urlStr)
public void sendData()
public void notifyToSend()
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |