public class QoSDimpl2 extends AbstractServiceDaemon implements EventListener, QoSD
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.
Modifier and Type | Field and Description |
---|---|
static String |
NAME
Constant
NAME="OpenOSS.QoSD" |
PropertiesLoader |
props |
boolean |
useUeiList |
PAUSE_PENDING, PAUSED, RESUME_PENDING
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
Constructor and Description |
---|
QoSDimpl2()
Constructor for QoSDimpl2.
|
Modifier and Type | Method and Description |
---|---|
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.
|
afterPropertiesSet, debugf, debugf, destroy, errorf, errorf, fatalf, fatalf, getName, getStatus, getStatusText, infof, infof, init, isPaused, isRunning, isStarting, log, pause, resume, setStatus, start, status, stop, waitForStatus, waitForStatus, warnf, warnf
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
public PropertiesLoader props
public static final String NAME
NAME="OpenOSS.QoSD"
public boolean useUeiList
public static ThreadCategory getLog()
ThreadCategory
object.public void setOssDao(OssDao _ossDao)
public void setOnmsAlarmOssjMapper(OnmsAlarmOssjMapper _onmsAlarmOssjMapper)
setOnmsAlarmOssjMapper
in interface QoSD
_onmsAlarmOssjMapper
- the onmsAlarmOssjMapper to setpublic void setAssetRecordDao(AssetRecordDao ar)
setAssetRecordDao
in interface QoSD
ar
- a AssetRecordDao
object.public void setNodeDao(NodeDao nodedao)
setNodeDao
in interface QoSD
nodedao
- a NodeDao
object.public void setEventIpcManager(EventIpcManager evtIpcManager)
setEventIpcManager
in interface QoSD
evtIpcManager
- a EventIpcManager
object.public void setAlarmDao(AlarmDao almDao)
setAlarmDao
in interface QoSD
almDao
- a AlarmDao
object.public void setAlarmListConnectionManager(AlarmListConnectionManager alcm)
setAlarmListConnectionManager
in interface QoSD
alcm
- a AlarmListConnectionManager
object.public void setApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext m_context)
setApplicationContext
in interface QoSD
m_context
- - application context for this bean to useprotected void onInit()
onInit
in class AbstractServiceDaemon
protected void onStart()
onStart
in class AbstractServiceDaemon
protected void onStop()
onStop
in class AbstractServiceDaemon
protected void onResume()
onResume
in class AbstractServiceDaemon
protected void onPause()
onPause
in class AbstractServiceDaemon
public void registerListener()
registerListener
in interface QoSD
public void unregisterListener()
unregisterListener
in interface QoSD
public void onEvent(Event event)
onEvent
in interface EventListener
onEvent
in interface QoSD
event
- a Event
object.public void sendAlarms()
sendAlarms
in interface QoSD
Copyright © 2015. All Rights Reserved.