|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.opennms.netmgt.daemon.AbstractServiceDaemon
org.openoss.opennms.spring.qosd.QoSDimpl2
public class QoSDimpl2
This class is a fiber scheduled by OpenNMS. It's purpose is to collect OpenNMS alarms and transmit them to an OpenOSS QoS bean. The start() method loads the configuration for the QosD daemon and registers for events Configuration is held in 4 files.
QoSD-configuration.xml
qosd.properties
opennms.conf
rmi.policy The Daemon starts in the following sequence;
1. When the deamon starts it initialises the AlarmListJ2eeConnectionManagerThread and registers with the
AlarmMonitor bean in the application server.
2. It then calls the AlarmListJ2eeConnectionManagerThread.Reset_List in order to cause the interface to send an AlarmListRebuiltEvent.
The JNDI naming factory, JMS queues and ejb's conected to by the daemon are specified in the
qosd.properties file. The location of qosd.properties file is set by the JRE system variable
-DpropertiesFile which should be set when OpenNMS is started up. This is set in /etc/opennms.conf file
Contents of opennms.conf:
ADDITIONAL_MANAGER_OPTIONS='-Djava.security.policy=/opt/OpenNMS/etc/rmi.policy \
-DpropertiesFile=/opt/OpenNMS/etc/qosd.properties \
-Drx_propertiesFile=/opt/OpenNMS/etc/qosdrx.properties \
-Djava.naming.provider.url=jnp://jbossjmsserver1:1099 \
-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory \
-Djava.naming.factory.url.pkgs=org.jboss.naming '
rmi.policy sets the security settings to allow the JVM to connect externally
Contents of rmi.policy:
grant{permission java.security.AllPermission;};
3. The daemon then sends out the full current alarm list to the AlarmMonitor bean and registers with OpenNMS for events
The events used to run the QosD bean are determined by the file /etc/QoSD-configuration.xml
By default only the 'uei.opennms.org/vacuumd/alarmListChanged' uei is included in this file. This event
is generated when the notifyOSSJnewAlarm automation running in the vacuumd deamon
determines that the alarm list has changed. In normal operation there is a short delay between an alarm
entering the alarm list and the notifyOSSJnewAlarm automation picking it up. This can be significantly
shortend for high priority alarms if their raise uei's are also included in the QoSD-configuration.xml file.
However for most alarms this is not worth the effort.
| Field Summary | |
|---|---|
static String |
NAME
Constant NAME="OpenOSS.QoSD" |
PropertiesLoader |
props
|
boolean |
useUeiList
|
| 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 | |
|---|---|
QoSDimpl2()
Constructor for QoSDimpl2. |
|
| Method Summary | |
|---|---|
static ThreadCategory |
getLog()
Method to get the QosD's logger from OpenNMS |
String |
getStats()
not used but needed for initialization |
void |
onEvent(Event event)
Process a sent event. |
protected void |
onInit()
Method to set up the fiber Note - not used in Spring activation |
protected void |
onPause()
Pause method of fiber, called by OpenNMS to put the fiber in a suspended state until it can be later resumed. |
protected void |
onResume()
Resume method of fiber, called by OpenNMS to start the fiber up from a paused state. |
protected void |
onStart()
The start() method loads the configuration for the QosD daemon and registers for events |
protected void |
onStop()
Stop method of fiber, called by OpenNMS when fiber execution is to finish. |
void |
registerListener()
Registers an OpenNMS event listener with this class. |
void |
sendAlarms()
A method to request an alarm list from the OpenNMS database using the ossDao, convert them to OSS/J alarms using the onmsAlarmOssjMapper and send the OSS/J alarms using the alarm list connection manager (alcm) to update the the AlarmMonitor bean. |
void |
setAlarmDao(AlarmDao almDao)
Used by Spring Application context to pass in alarmDao |
void |
setAlarmListConnectionManager(AlarmListConnectionManager alcm)
Used by Spring Application context to pass in AlarmListConnectionManager |
void |
setApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext m_context)
Used by jmx mbean QoSD to pass in Spring Application context |
void |
setAssetRecordDao(AssetRecordDao ar)
Used by Spring Application context to pass in AssetRecordDao |
void |
setEventIpcManager(EventIpcManager evtIpcManager)
Used by Spring Application context to pass in EventIpcManager |
void |
setNodeDao(NodeDao nodedao)
Used by Spring Application context to pass in NodeDaof |
void |
setOnmsAlarmOssjMapper(OnmsAlarmOssjMapper _onmsAlarmOssjMapper)
Used by Spring Application context to pass in OnmsAlarmOssjMapper The OnmsAlarmOssjMapper class maps OpenNMS alarms to OSS/J alarms and events |
void |
setOssDao(OssDao _ossDao)
provides an interface to OpenNMS which provides a unified api |
void |
unregisterListener()
Stops OpenNMS calling the onEvent method of this object when an event occurs. |
| 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, 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 |
| Methods inherited from interface org.opennms.core.fiber.PausableFiber |
|---|
pause, resume |
| Methods inherited from interface org.opennms.core.fiber.Fiber |
|---|
getName, getStatus, start, stop |
| Methods inherited from interface org.opennms.netmgt.model.events.EventListener |
|---|
getName |
| Methods inherited from interface org.openoss.opennms.spring.qosd.QoSD |
|---|
getName, getStatus, init, pause, resume, start, stop |
| Field Detail |
|---|
public PropertiesLoader props
public static final String NAME
NAME="OpenOSS.QoSD"
public boolean useUeiList
| Constructor Detail |
|---|
public QoSDimpl2()
Constructor for QoSDimpl2.
| Method Detail |
|---|
public static ThreadCategory getLog()
ThreadCategory object.public void setOssDao(OssDao _ossDao)
setOssDao in interface QoSD_ossDao - the ossDao to setpublic void setOnmsAlarmOssjMapper(OnmsAlarmOssjMapper _onmsAlarmOssjMapper)
setOnmsAlarmOssjMapper in interface QoSD_onmsAlarmOssjMapper - the onmsAlarmOssjMapper to setpublic void setAssetRecordDao(AssetRecordDao ar)
setAssetRecordDao in interface QoSDar - a AssetRecordDao object.public void setNodeDao(NodeDao nodedao)
setNodeDao in interface QoSDnodedao - a NodeDao object.public void setEventIpcManager(EventIpcManager evtIpcManager)
setEventIpcManager in interface QoSDevtIpcManager - a EventIpcManager object.public void setAlarmDao(AlarmDao almDao)
setAlarmDao in interface QoSDalmDao - a AlarmDao object.public void setAlarmListConnectionManager(AlarmListConnectionManager alcm)
setAlarmListConnectionManager in interface QoSDalcm - a AlarmListConnectionManager object.public void setApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext m_context)
setApplicationContext in interface QoSDm_context - - application context for this bean to useprotected void onInit()
onInit in class AbstractServiceDaemonprotected void onStart()
onStart in class AbstractServiceDaemonprotected void onStop()
onStop in class AbstractServiceDaemonprotected void onResume()
onResume in class AbstractServiceDaemonprotected void onPause()
onPause in class AbstractServiceDaemonpublic void registerListener()
registerListener in interface QoSDpublic void unregisterListener()
unregisterListener in interface QoSDpublic void onEvent(Event event)
onEvent in interface EventListeneronEvent in interface QoSDevent - a Event object.public void sendAlarms()
sendAlarms in interface QoSDpublic String getStats()
getStats in interface QoSD
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||