public class OnmsAlarmOssjMapper extends Object
OnmsAlarmOssjMapper class.
Modifier and Type | Field and Description |
---|---|
static int |
SPECIFY_OUTSTATION
if
alarmUpdateBehaviour is set to SPECIFY_OUTSTATION
the receiver name will be used as the node name which will be updated with
alarms from this receiver. |
static int |
USE_TYPE_INSTANCE
if
alarmUpdateBehaviour is set to USE_TYPE_INSTANCE
the alarm will be created with the node name corrsponding to a concatenation
of the ManagedObjectID and ManagedObjectType. |
Constructor and Description |
---|
OnmsAlarmOssjMapper() |
Modifier and Type | Method and Description |
---|---|
static String |
ossjAlarmTypeToUei(String alarmType)
Maps OSS/J alarm types to OpenNMS uei types
|
static OnmsSeverity |
ossjSeveritytoOnmsSeverity(short ossjseverity)
convenience method to map OSS/J to OpenNMS severities
A switch statement converts the OSS/J severity qualifier
over to one compatible with OpenNMS
From OpenNMS code;
public static final int INDETERMINATE_SEVERITY = 1;
public static final int CLEARED_SEVERITY = 2;
public static final int NORMAL_SEVERITY = 3;
public static final int WARNING_SEVERITY = 4;
public static final int MINOR_SEVERITY = 5;
public static final int MAJOR_SEVERITY = 6;
public static final int CRITICAL_SEVERITY = 7;
NOTE org.opennms.web.alarm.Alarm.NORMAL_SEVERITY has no equivilent in OSS/J X733
|
OnmsAlarm |
populateOnmsAlarmFromOssjAlarm(OnmsAlarm onmsAlarm,
javax.oss.fm.monitor.AlarmValue alarmValue,
Integer almUpdateBehaviour,
String defaultUpdateNodeLabel)
This method maps an OSS/J AlarmValue to OpenNMS alarm
|
javax.oss.fm.monitor.AlarmValue |
populateOssjAlarmFromOpenNMSAlarm(javax.oss.fm.monitor.AlarmValue alarmValueSpecification,
OnmsAlarm _openNMSalarm)
This method maps OpenNMS alarm to an OSS/J alarms and adds additional information
|
void |
setAssetRecordDao(AssetRecordDao ar)
Used by Spring Application context to pass in AssetRecordDao
|
void |
setDistPollerDao(DistPollerDao _distPollerDao)
Used by Spring Application context to pass in distPollerDao;
|
void |
setNodeDao(NodeDao nodedao)
Used by Spring Application context to pass in NodeDaof
|
void |
setOssDao(OssDao _ossDao)
provides an interface to OpenNMS which provides a unified api
|
public static int SPECIFY_OUTSTATION
alarmUpdateBehaviour
is set to SPECIFY_OUTSTATION
the receiver name will be used as the node name which will be updated with
alarms from this receiver. Usually this is set to the name of the node
associated with the outstation but it can be set to a node which is a
catch all for received alarms ( i.e. the local host perhaps )public static int USE_TYPE_INSTANCE
alarmUpdateBehaviour
is set to USE_TYPE_INSTANCE
the alarm will be created with the node name corrsponding to a concatenation
of the ManagedObjectID and ManagedObjectType. If these cannot be found
then the alarm will default to the outstation nodepublic void setDistPollerDao(DistPollerDao _distPollerDao)
_distPollerDao
- a DistPollerDao
object.public void setAssetRecordDao(AssetRecordDao ar)
ar
- a AssetRecordDao
object.public void setNodeDao(NodeDao nodedao)
nodedao
- a NodeDao
object.public void setOssDao(OssDao _ossDao)
_ossDao
- the ossDao to setpublic OnmsAlarm populateOnmsAlarmFromOssjAlarm(OnmsAlarm onmsAlarm, javax.oss.fm.monitor.AlarmValue alarmValue, Integer almUpdateBehaviour, String defaultUpdateNodeLabel) throws IllegalArgumentException, javax.oss.UnsupportedAttributeException
onmsAlarm
- OnmsAlarm object to be populatedalarmValue
- OSS/J AlarmValue data to use to populate OnmsAlarmalmUpdateBehaviour
- - determines how to treat the node name of the new alarm must be of value;
USE_TYPE_INSTANCE
- populate nodeID with node having same asset type and instance data as alarm
or SPECIFY_OUTSTATION
- populate nodeID with node having same nodeLabel as defaultUpdateNodeLabeldefaultUpdateNodeLabel
- name of node to be updated if almUpdateBehaviour==SPECIFY_OUTSTATIONIllegalArgumentException
- if any.javax.oss.UnsupportedAttributeException
- if any.public javax.oss.fm.monitor.AlarmValue populateOssjAlarmFromOpenNMSAlarm(javax.oss.fm.monitor.AlarmValue alarmValueSpecification, OnmsAlarm _openNMSalarm) throws IllegalArgumentException, javax.oss.UnsupportedAttributeException
_openNMSalarm
- data to use to populate the OSS/J alarmalarmValueSpecification
- AlarmValue object to be populated - Invariant (Specifcation) values should be already populatedIllegalArgumentException
- if any.javax.oss.UnsupportedAttributeException
- if any.public static OnmsSeverity ossjSeveritytoOnmsSeverity(short ossjseverity) throws IllegalArgumentException
ossjseverity
- the severity value according to ossj / X733IllegalArgumentException
- if any.Copyright © 2015. All Rights Reserved.