Modifier and Type | Field and Description |
---|---|
protected AlarmDao |
_alarmDao
Used to search and update opennms alarm list
|
protected AssetRecordDao |
_assetRecordDao
Used to obtain opennms asset information for inclusion in alarms
|
protected DataSource |
_dataSource
Used to create new Lazy objects
|
protected NodeDao |
_nodeDao
Used to obtain opennms node information for inclusion in alarms
|
protected org.springframework.transaction.support.TransactionTemplate |
transTemplate
Used to ensure that objects retreived from OpenNMS through Hibernate
contain all of their internal objects populated with values
|
Constructor and Description |
---|
OssDaoOpenNMSImpl() |
Modifier and Type | Method and Description |
---|---|
OnmsAlarm |
addCurrentAlarmForUniqueKey(OnmsAlarm alarm)
Adds Current alarm to OpenNMS database with a new alarmID as an AlarmType= 'raise' ( type 1 ) alarm.
|
static String |
alarmToString(OnmsAlarm alarm)
Debug method to print out opennms alarms
|
OnmsNode |
findNodeByID(Integer nodeid)
Returns the OnmsNode for the supplied node id
|
OnmsNode |
findNodeByInstanceAndType(String managedObjectInstance,
String managedObjectType)
This will return the first node with entry in Assets table having matching managedObjectInstance and
managedObjectType.
|
OnmsNode |
findNodeByLabel(String label)
This will return the first node in nodes table with nodeLable entry matching label
Note for this to work, the configuration of OpenNMS must ensure that the node label is unique
otherwise only the first instance will be returned
|
OnmsAlarm[] |
getAlarmCache()
getAlarmCache
|
OnmsAlarm |
getCurrentAlarmForUniqueKey(String applicationDN,
String ossPrimaryKey)
getCurrentAlarmForUniqueKey
|
void |
init()
init
|
void |
setAlarmDao(AlarmDao alarmDao)
Used by Spring Application context to pass in
AlarmDao . |
void |
setAssetRecordDao(AssetRecordDao ar)
Used by Spring Application context to pass in
AssetRecordDao . |
void |
setDataSource(DataSource dataSource)
setDataSource
|
void |
setNodeDao(NodeDao nodedao)
Used by Spring Application context to pass in
NodeDao . |
void |
setQoSD(QoSD _qoSD)
Used by running QoSD to set up OssDao to call back alarm list updates
|
void |
setTransTemplate(org.springframework.transaction.support.TransactionTemplate _transTemplate)
Used by Spring Application context to pass in a Spring transaction manager
|
void |
updateAlarmCache()
updateAlarmCache
|
void |
updateAlarmCacheAndSendAlarms()
updateAlarmCacheAndSendAlarms
|
OnmsAlarm |
updateCurrentAlarmForUniqueKey(OnmsAlarm alarm)
Updates Current alarm in OpenNMS database with a new alarmID as an AlarmType= 'raise' ( type 1 ) alarm.
|
void |
updateNodeCaches()
updateNodeCaches
|
protected DataSource _dataSource
protected AssetRecordDao _assetRecordDao
AssetRecordDao
protected NodeDao _nodeDao
NodeDao
protected AlarmDao _alarmDao
AlarmDao
protected org.springframework.transaction.support.TransactionTemplate transTemplate
public void setDataSource(DataSource dataSource)
setDataSource
setDataSource
in interface OssDao
dataSource
- The dataSource to setpublic void setAssetRecordDao(AssetRecordDao ar)
AssetRecordDao
.setAssetRecordDao
in interface OssDao
ar
- a AssetRecordDao
object.public void setNodeDao(NodeDao nodedao)
NodeDao
.setNodeDao
in interface OssDao
nodedao
- a NodeDao
object.public void setAlarmDao(AlarmDao alarmDao)
AlarmDao
.setAlarmDao
in interface OssDao
alarmDao
- a AlarmDao
object.public void setTransTemplate(org.springframework.transaction.support.TransactionTemplate _transTemplate)
setTransTemplate
in interface OssDao
_transTemplate
- a TransactionTemplate
object.public void setQoSD(QoSD _qoSD)
public OnmsAlarm addCurrentAlarmForUniqueKey(OnmsAlarm alarm)
addCurrentAlarmForUniqueKey
in interface OssDao
alarm
- - alarm to add.public OnmsAlarm updateCurrentAlarmForUniqueKey(OnmsAlarm alarm)
updateCurrentAlarmForUniqueKey
in interface OssDao
alarm
- - alarm to add.public OnmsAlarm getCurrentAlarmForUniqueKey(String applicationDN, String ossPrimaryKey)
getCurrentAlarmForUniqueKey
getCurrentAlarmForUniqueKey
in interface OssDao
applicationDN
- a String
object.ossPrimaryKey
- a String
object.public void updateAlarmCache() throws IllegalStateException
updateAlarmCache
updateAlarmCache
in interface OssDao
IllegalStateException
- if any.public void updateAlarmCacheAndSendAlarms() throws IllegalStateException
updateAlarmCacheAndSendAlarms
updateAlarmCacheAndSendAlarms
in interface OssDao
IllegalStateException
- if any.public OnmsAlarm[] getAlarmCache()
getAlarmCache
getAlarmCache
in interface OssDao
OnmsAlarm
objects.public static String alarmToString(OnmsAlarm alarm)
alarm
- a OnmsAlarm
object.public OnmsNode findNodeByLabel(String label)
findNodeByLabel
in interface OssDao
label
- NodeLabel of node to look fornull
if not found
Note: Accesses the Node Cachepublic OnmsNode findNodeByInstanceAndType(String managedObjectInstance, String managedObjectType) throws IllegalArgumentException
findNodeByInstanceAndType
in interface OssDao
managedObjectInstance
- a String
object.managedObjectType
- a String
object.IllegalArgumentException
- Note: Accesses the Node Cachepublic OnmsNode findNodeByID(Integer nodeid)
findNodeByID
in interface OssDao
nodeid
- a Integer
object.OnmsNode
object.public void updateNodeCaches()
updateNodeCaches
updateNodeCaches
in interface OssDao
Copyright © 2015. All Rights Reserved.