public interface OssDao
OssDao interface.
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.
|
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()
Used By QoSD to retreive a copy of the current view of the alarm cache.
|
OnmsAlarm |
getCurrentAlarmForUniqueKey(String applicationDN,
String ossPrimaryKey)
getCurrentAlarmForUniqueKey
|
void |
init()
Initialises the Node and Alarm caches
Must be called before any other methods to ensure that ossDao is initialised
|
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()
Used to force an update to the local cache from latest alarm list in database
|
void |
updateAlarmCacheAndSendAlarms()
Used By QoSD to force an update to the local cache from latest alarm list in database
Tries to call back to QoSD to send the latest alarm list.
|
OnmsAlarm |
updateCurrentAlarmForUniqueKey(OnmsAlarm alarm)
Updates Current alarm in OpenNMS database with a new alarmID as an AlarmType= 'raise' ( type 1 ) alarm.
|
void |
updateNodeCaches()
Synchronized method to Update the node cache from the OpenNMS database
May be called from Qosd on receipt of an asset register update event
|
void setDataSource(DataSource dataSource)
setDataSource
dataSource
- The dataSource to setvoid setAssetRecordDao(AssetRecordDao ar)
AssetRecordDao
.ar
- a AssetRecordDao
object.void setNodeDao(NodeDao nodedao)
NodeDao
.nodedao
- a NodeDao
object.void setAlarmDao(AlarmDao alarmDao)
AlarmDao
.alarmDao
- a AlarmDao
object.void setTransTemplate(org.springframework.transaction.support.TransactionTemplate transTemplate)
transTemplate
- a TransactionTemplate
object.void setQoSD(QoSD qoSD)
qoSD
- a QoSD
object.void init()
OnmsAlarm addCurrentAlarmForUniqueKey(OnmsAlarm alarm)
alarm
- - alarm to add.If
- alarm AlarmID not null throws IllegalArgumentException
.
If ApplicationDN() and OssPrimaryKey() not unique in Current Alarm list throws IllegalArgumentException
If alarm type not type 1 throws IllegalArgumentException
.
If ApplicationDN()==null or "" or OssPrimaryKey()==null or "", throws IllegalArgumentException
.
Note any new locally generated OpenNMS alarms will have ApplictionDN or OssPrimaryKey ==null or "" and so are ignoredOnmsAlarm updateCurrentAlarmForUniqueKey(OnmsAlarm alarm)
alarm
- - alarm to add.If
- alarm AlarmID not null throws IllegalArgumentException
.
If alarm type not type 1 throws IllegalArgumentException
.
If ApplicationDN()==null or "" or OssPrimaryKey()==null or "", throws IllegalArgumentException
.
Note any new locally generated OpenNMS alarms will have ApplictionDN or OssPrimaryKey ==null or "" and so are ignoredOnmsAlarm getCurrentAlarmForUniqueKey(String applicationDN, String ossPrimaryKey)
getCurrentAlarmForUniqueKey
void updateAlarmCache() throws IllegalStateException
IllegalStateException
- if any.void updateAlarmCacheAndSendAlarms() throws IllegalStateException
IllegalStateException
- if any.OnmsAlarm[] getAlarmCache()
OnmsAlarm
objects.OnmsNode findNodeByLabel(String label)
label
- NodeLabel of node to look fornull
if not found
Note: Accesses the Node CacheOnmsNode findNodeByInstanceAndType(String managedObjectInstance, String managedObjectType) throws IllegalArgumentException
managedObjectInstance
- a String
object.managedObjectType
- a String
object.IllegalArgumentException
- Note: Accesses the Node Cachevoid updateNodeCaches()
Copyright © 2015. All Rights Reserved.