|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 java.lang.String |
NAME
|
static PropertiesLoader |
props
|
static 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()
|
|
| Method Summary | |
|---|---|
static org.apache.log4j.Logger |
getLog()
Method to get the QosD's logger from OpenNMS |
java.lang.String |
getName()
Returns the Log category name |
java.lang.String |
getStats()
not used but needed for initialization |
int |
getStatus()
lets OpenNMS know what state the daemon is in |
void |
init()
Method to set up the fiber Note - not used in Spring activation |
void |
onEvent(org.opennms.netmgt.xml.event.Event event)
The OpenNMS event listener runs this routine when a new event is detected. |
void |
pause()
Pause method of fiber, called by OpenNMS to put the fiber in a suspended state until it can be later resumed. |
void |
registerListener()
Registers an OpenNMS event listener with this class. |
void |
resume()
Resume method of fiber, called by OpenNMS to start the fiber up from a paused state. |
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(org.opennms.netmgt.dao.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(org.opennms.netmgt.dao.AssetRecordDao ar)
Used by Spring Application context to pass in AssetRecordDao |
void |
seteventIpcManager(org.opennms.netmgt.eventd.EventIpcManager evtIpcManager)
Used by Spring Application context to pass in EventIpcManager |
void |
setnodeDao(org.opennms.netmgt.dao.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(OssDaoOpenNMSImpl _ossDao)
provides an interface to OpenNMS which provides a unified api |
void |
start()
The start() method loads the configuration for the QosD daemon and registers for events |
void |
stop()
Stop method of fiber, called by OpenNMS when fiber execution is to finish. |
void |
unregisterListener()
Stops OpenNMS calling the onEvent method of this object when an event occurs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static PropertiesLoader props
public static final java.lang.String NAME
public static boolean useUeiList
| Constructor Detail |
|---|
public QoSDimpl2()
| Method Detail |
|---|
public static org.apache.log4j.Logger getLog()
public void setossDao(OssDaoOpenNMSImpl _ossDao)
setossDao in interface QoSDossDao - the ossDao to setpublic void setOnmsAlarmOssjMapper(OnmsAlarmOssjMapper _onmsAlarmOssjMapper)
setOnmsAlarmOssjMapper in interface QoSDonmsAlarmOssjMapper - the onmsAlarmOssjMapper to setpublic void setassetRecordDao(org.opennms.netmgt.dao.AssetRecordDao ar)
setassetRecordDao in interface QoSDar - public void setnodeDao(org.opennms.netmgt.dao.NodeDao nodedao)
setnodeDao in interface QoSDnodedao - public void seteventIpcManager(org.opennms.netmgt.eventd.EventIpcManager evtIpcManager)
seteventIpcManager in interface QoSDeventIpcManager - public void setalarmDao(org.opennms.netmgt.dao.AlarmDao almDao)
setalarmDao in interface QoSDalarmDao - public void setalarmListConnectionManager(AlarmListConnectionManager alcm)
setalarmListConnectionManager in interface QoSDalcm - public void setapplicationcontext(org.springframework.context.support.ClassPathXmlApplicationContext m_context)
setapplicationcontext in interface QoSDm_context - - application conext for this bean to usepublic void init()
init in interface QoSDpublic void start()
start in interface org.opennms.core.fiber.Fiberstart in interface QoSDpublic void stop()
stop in interface org.opennms.core.fiber.Fiberstop in interface QoSDpublic void resume()
resume in interface org.opennms.core.fiber.PausableFiberresume in interface QoSDpublic void pause()
pause in interface org.opennms.core.fiber.PausableFiberpause in interface QoSDpublic java.lang.String getName()
getName in interface org.opennms.core.fiber.FibergetName in interface org.opennms.netmgt.eventd.EventListenergetName in interface QoSDpublic int getStatus()
getStatus in interface org.opennms.core.fiber.FibergetStatus in interface QoSDstatus - public void registerListener()
registerListener in interface QoSDpublic void unregisterListener()
unregisterListener in interface QoSDpublic void onEvent(org.opennms.netmgt.xml.event.Event event)
onEvent in interface org.opennms.netmgt.eventd.EventListeneronEvent in interface QoSDpublic void sendAlarms()
sendAlarms in interface QoSDpublic java.lang.String getStats()
getStats in interface QoSD
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||