org.openoss.opennms.spring.dao
Class OnmsAlarmOssjMapper

java.lang.Object
  extended by org.openoss.opennms.spring.dao.OnmsAlarmOssjMapper

public class OnmsAlarmOssjMapper
extends java.lang.Object


Field Summary
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 Summary
OnmsAlarmOssjMapper()
           
 
Method Summary
static java.lang.String getAlarmUpdateBehaviourForInt(java.lang.Integer aub)
          REturns string value of alarmUpdateBehaviour
static java.lang.Integer getalarmUpdateBehaviourForString(java.lang.String _alarmUpdateBehaviour)
          Used to convert alarmUpdateBehaviour string to a valid Integer
 short onmsSeverityToOssjSeverity(java.lang.Integer onmsSeverity)
          convenience method to map OpenNMS to OSS/J severities 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
 java.lang.String ossjAlarmTypeToUei(java.lang.String alarmType)
          Maps OSS/J alarm types to OpenNMS uei types
 java.lang.Integer 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
 org.opennms.netmgt.model.OnmsAlarm populateOnmsAlarmFromOssjAlarm(org.opennms.netmgt.model.OnmsAlarm onmsAlarm, javax.oss.fm.monitor.AlarmValue alarmValue, java.lang.Integer almUpdateBehaviour, java.lang.String defaultUpdateNodeLabel)
          This method maps an OSS/J AlarmValue to OpenNMS alarm
 javax.oss.fm.monitor.AlarmValue populateOssjAlarmFromOpenNMSAlarm(javax.oss.fm.monitor.AlarmValue alarmValueSpecification, org.opennms.netmgt.model.OnmsAlarm _openNMSalarm)
          This method maps OpenNMS alarm to an OSS/J alarms and adds additional information
 void setassetRecordDao(org.opennms.netmgt.dao.AssetRecordDao ar)
          Used by Spring Application context to pass in AssetRecordDao
 void setdistPollerDao(org.opennms.netmgt.dao.DistPollerDao _distPollerDao)
          Used by Spring Application context to pass in distPollerDao;
 void setnodeDao(org.opennms.netmgt.dao.NodeDao nodedao)
          Used by Spring Application context to pass in NodeDaof
 void setossDao(OssDaoOpenNMSImpl _ossDao)
          provides an interface to OpenNMS which provides a unified api
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPECIFY_OUTSTATION

public 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. 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 )


USE_TYPE_INSTANCE

public 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. If these cannot be found then the alarm will default to the outstation node

Constructor Detail

OnmsAlarmOssjMapper

public OnmsAlarmOssjMapper()
Method Detail

setdistPollerDao

public void setdistPollerDao(org.opennms.netmgt.dao.DistPollerDao _distPollerDao)
Used by Spring Application context to pass in distPollerDao;


setassetRecordDao

public void setassetRecordDao(org.opennms.netmgt.dao.AssetRecordDao ar)
Used by Spring Application context to pass in AssetRecordDao

Parameters:
ar -

setnodeDao

public void setnodeDao(org.opennms.netmgt.dao.NodeDao nodedao)
Used by Spring Application context to pass in NodeDaof

Parameters:
nodedao -

setossDao

public void setossDao(OssDaoOpenNMSImpl _ossDao)
provides an interface to OpenNMS which provides a unified api

Parameters:
ossDao - the ossDao to set

getAlarmUpdateBehaviourForInt

public static java.lang.String getAlarmUpdateBehaviourForInt(java.lang.Integer aub)
REturns string value of alarmUpdateBehaviour

Parameters:
aub - valid value for alarmUpdateBehaviour SPECIFY_OUTSTATION, or USE_TYPE_INSTANCE
Returns:

getalarmUpdateBehaviourForString

public static java.lang.Integer getalarmUpdateBehaviourForString(java.lang.String _alarmUpdateBehaviour)
Used to convert alarmUpdateBehaviour string to a valid Integer

Parameters:
alarmUpdateBehaviour - must be "USE_TYPE_INSTANCE" or "SPECIFY_OUTSTATION"

populateOnmsAlarmFromOssjAlarm

public org.opennms.netmgt.model.OnmsAlarm populateOnmsAlarmFromOssjAlarm(org.opennms.netmgt.model.OnmsAlarm onmsAlarm,
                                                                         javax.oss.fm.monitor.AlarmValue alarmValue,
                                                                         java.lang.Integer almUpdateBehaviour,
                                                                         java.lang.String defaultUpdateNodeLabel)
                                                                  throws java.lang.IllegalArgumentException,
                                                                         javax.oss.UnsupportedAttributeException
This method maps an OSS/J AlarmValue to OpenNMS alarm

Parameters:
onmsAlarm - OnmsAlarm object to be populated
av - OSS/J AlarmValue data to use to populate OnmsAlarm
almUpdateBehaviour - - 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 defaultUpdateNodeLabel
defaultUpdateNodeLabel - name of node to be updated if almUpdateBehaviour==SPECIFY_OUTSTATION
Returns:
the OnmsAlarm populaed with OSS/J NotifyNewAlarmEvent data
Throws:
java.lang.IllegalArgumentException
javax.oss.UnsupportedAttributeException

populateOssjAlarmFromOpenNMSAlarm

public javax.oss.fm.monitor.AlarmValue populateOssjAlarmFromOpenNMSAlarm(javax.oss.fm.monitor.AlarmValue alarmValueSpecification,
                                                                         org.opennms.netmgt.model.OnmsAlarm _openNMSalarm)
                                                                  throws java.lang.IllegalArgumentException,
                                                                         javax.oss.UnsupportedAttributeException
This method maps OpenNMS alarm to an OSS/J alarms and adds additional information

Parameters:
_openNMSalarm - data to use to populate the OSS/J alarm
alarmValueSpecification - AlarmValue object to be populated - Invariant (Specifcation) values should be already populated
Throws:
java.lang.IllegalArgumentException
javax.oss.UnsupportedAttributeException

ossjSeveritytoOnmsSeverity

public java.lang.Integer ossjSeveritytoOnmsSeverity(short ossjseverity)
                                             throws java.lang.IllegalArgumentException
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

Parameters:
ossjseverity - the severity value according to ossj / X733
Returns:
the severity value according to opennms
Throws:
java.lang.IllegalArgumentException

onmsSeverityToOssjSeverity

public short onmsSeverityToOssjSeverity(java.lang.Integer onmsSeverity)
                                 throws java.lang.IllegalArgumentException
convenience method to map OpenNMS to OSS/J severities 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

Parameters:
onmsSeverity - the severity value according to opennms
Returns:
the severity value according to ossj / X733
Throws:
java.lang.IllegalArgumentException

ossjAlarmTypeToUei

public java.lang.String ossjAlarmTypeToUei(java.lang.String alarmType)
Maps OSS/J alarm types to OpenNMS uei types

Parameters:
alarmType - String representing OSS/J alarm Type
Returns:
string representing equivilent OpenNMS uei


Copyright ? 2006-2008. All Rights Reserved.