Package org.opennms.netmgt.dao.hibernate
Class AlarmRepositoryHibernate
- java.lang.Object
-
- org.opennms.netmgt.dao.hibernate.AlarmRepositoryHibernate
-
- All Implemented Interfaces:
AlarmRepository
,org.springframework.beans.factory.InitializingBean
public class AlarmRepositoryHibernate extends Object implements AlarmRepository, org.springframework.beans.factory.InitializingBean
DaoWebAlarmRepository class.
- Since:
- 1.8.1
- Version:
- $Id: $
- Author:
- ranger
-
-
Constructor Summary
Constructors Constructor Description AlarmRepositoryHibernate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acknowledgeAlarms(int[] alarmIds, String user, Date timestamp)
Acknowledge Alarms.void
acknowledgeAlarms(String user, Date timestamp, int[] alarmIds)
void
acknowledgeAll(String user, Date timestamp)
Acknowledge all the alarms.void
acknowledgeMatchingAlarms(String user, Date timestamp, OnmsCriteria criteria)
Acknowledge alarms matching a specific criteria.void
afterPropertiesSet()
void
clearAlarms(int[] alarmIds, String user, Date timestamp)
Clear Alarmsint
countMatchingAlarms(OnmsCriteria criteria)
Count alarms matching a criteria.int[]
countMatchingAlarmsBySeverity(OnmsCriteria criteria)
Count alarms by severity matching a specific criteria.void
escalateAlarms(int[] alarmIds, String user, Date timestamp)
Escalate Alarms.List<OnmsAcknowledgment>
getAcknowledgments(int alarmId)
Gets the acknowledgments.OnmsAlarm
getAlarm(int alarmId)
Gets and alarm.List<AlarmSummary>
getCurrentNodeAlarmSummaries()
Gets the current node alarm summaries.List<SituationSummary>
getCurrentSituationSummaries()
Gets the current node alarm summaries.OnmsAlarm[]
getMatchingAlarms(OnmsCriteria criteria)
Gets alarms matching a specific criteria.void
removeReductionKeyMemo(int alarmId)
Removes the reduction key memo.void
removeStickyMemo(Integer alarmId)
Removes the sticky memo.void
unacknowledgeAlarms(int[] alarmIds, String user)
Unacknowledge Alarmsvoid
unacknowledgeAll(String user)
Unacknowledge all the alarms.void
unacknowledgeMatchingAlarms(OnmsCriteria criteria, String user)
Unacknowledge Matching Alarmsvoid
updateReductionKeyMemo(Integer alarmId, String body, String user)
Updates the ReductionKeyMemo of the alarm to persistence.void
updateStickyMemo(Integer alarmId, String body, String user)
Updates the StickyMemo of the alarm to persistence.
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
acknowledgeAll
@Transactional public void acknowledgeAll(String user, Date timestamp)
Acknowledge all the alarms.- Specified by:
acknowledgeAll
in interfaceAlarmRepository
- Parameters:
user
- the usertimestamp
- the timestamp
-
acknowledgeAlarms
@Transactional public void acknowledgeAlarms(String user, Date timestamp, int[] alarmIds)
-
acknowledgeMatchingAlarms
@Transactional public void acknowledgeMatchingAlarms(String user, Date timestamp, OnmsCriteria criteria)
Acknowledge alarms matching a specific criteria.- Specified by:
acknowledgeMatchingAlarms
in interfaceAlarmRepository
- Parameters:
user
- the usertimestamp
- the timestampcriteria
- the criteria
-
clearAlarms
@Transactional public void clearAlarms(int[] alarmIds, String user, Date timestamp)
Clear Alarms- Specified by:
clearAlarms
in interfaceAlarmRepository
- Parameters:
alarmIds
- an array of alarms IDuser
- the usertimestamp
- the timestamp
-
countMatchingAlarms
@Transactional public int countMatchingAlarms(OnmsCriteria criteria)
Count alarms matching a criteria.- Specified by:
countMatchingAlarms
in interfaceAlarmRepository
- Parameters:
criteria
- the criteria- Returns:
- the amount of alarms
-
countMatchingAlarmsBySeverity
@Transactional public int[] countMatchingAlarmsBySeverity(OnmsCriteria criteria)
Count alarms by severity matching a specific criteria.- Specified by:
countMatchingAlarmsBySeverity
in interfaceAlarmRepository
- Parameters:
criteria
- the criteria- Returns:
- an array with the amount of alarms per severity.
-
escalateAlarms
@Transactional public void escalateAlarms(int[] alarmIds, String user, Date timestamp)
Escalate Alarms.- Specified by:
escalateAlarms
in interfaceAlarmRepository
- Parameters:
alarmIds
- an array of alarms IDuser
- the usertimestamp
- the timestamp
-
getAlarm
@Transactional public OnmsAlarm getAlarm(int alarmId)
Gets and alarm.- Specified by:
getAlarm
in interfaceAlarmRepository
- Parameters:
alarmId
- the alarm id- Returns:
- the alarm object
-
getMatchingAlarms
@Transactional public OnmsAlarm[] getMatchingAlarms(OnmsCriteria criteria)
Gets alarms matching a specific criteria.- Specified by:
getMatchingAlarms
in interfaceAlarmRepository
- Parameters:
criteria
- the criteria- Returns:
- a array with matching alarms
-
unacknowledgeAll
@Transactional public void unacknowledgeAll(String user)
Unacknowledge all the alarms.- Specified by:
unacknowledgeAll
in interfaceAlarmRepository
- Parameters:
user
- the user
-
unacknowledgeMatchingAlarms
@Transactional public void unacknowledgeMatchingAlarms(OnmsCriteria criteria, String user)
Unacknowledge Matching Alarms.- Specified by:
unacknowledgeMatchingAlarms
in interfaceAlarmRepository
- Parameters:
criteria
- the criteriauser
- the user
-
acknowledgeAlarms
@Transactional public void acknowledgeAlarms(int[] alarmIds, String user, Date timestamp)
Acknowledge Alarms.- Specified by:
acknowledgeAlarms
in interfaceAlarmRepository
- Parameters:
alarmIds
- an array of alarms IDuser
- the usertimestamp
- the timestamp
-
unacknowledgeAlarms
@Transactional public void unacknowledgeAlarms(int[] alarmIds, String user)
Unacknowledge Alarms- Specified by:
unacknowledgeAlarms
in interfaceAlarmRepository
- Parameters:
alarmIds
- an array of alarms IDuser
- the user
-
updateStickyMemo
@Transactional public void updateStickyMemo(Integer alarmId, String body, String user)
Updates the StickyMemo of the alarm to persistence.- Specified by:
updateStickyMemo
in interfaceAlarmRepository
- Parameters:
alarmId
- the alarmId of the alarm where the StickyMemo has to be persisted.
-
updateReductionKeyMemo
@Transactional public void updateReductionKeyMemo(Integer alarmId, String body, String user)
Updates the ReductionKeyMemo of the alarm to persistence. ReductionKeyMemo aka JournalMemo.- Specified by:
updateReductionKeyMemo
in interfaceAlarmRepository
- Parameters:
alarmId
- the alarm idbody
- the bodyuser
- the user
-
removeStickyMemo
@Transactional public void removeStickyMemo(Integer alarmId)
Removes the sticky memo.- Specified by:
removeStickyMemo
in interfaceAlarmRepository
- Parameters:
alarmId
- the alarm id
-
removeReductionKeyMemo
@Transactional public void removeReductionKeyMemo(int alarmId)
Removes the reduction key memo.- Specified by:
removeReductionKeyMemo
in interfaceAlarmRepository
- Parameters:
alarmId
- the alarm id
-
getAcknowledgments
@Transactional public List<OnmsAcknowledgment> getAcknowledgments(int alarmId)
Description copied from interface:AlarmRepository
Gets the acknowledgments.- Specified by:
getAcknowledgments
in interfaceAlarmRepository
- Parameters:
alarmId
- the alarm id- Returns:
- the acknowledgments
-
getCurrentNodeAlarmSummaries
@Transactional public List<AlarmSummary> getCurrentNodeAlarmSummaries()
Description copied from interface:AlarmRepository
Gets the current node alarm summaries.- Specified by:
getCurrentNodeAlarmSummaries
in interfaceAlarmRepository
- Returns:
- the current node alarm summaries
-
getCurrentSituationSummaries
@Transactional public List<SituationSummary> getCurrentSituationSummaries()
Description copied from interface:AlarmRepository
Gets the current node alarm summaries.- Specified by:
getCurrentSituationSummaries
in interfaceAlarmRepository
- Returns:
- the current node alarm summaries
-
-