Class AlarmRepositoryHibernate

  • All Implemented Interfaces:
    AlarmRepository, org.springframework.beans.factory.InitializingBean

    public class AlarmRepositoryHibernate
    extends java.lang.Object
    implements AlarmRepository, org.springframework.beans.factory.InitializingBean

    DaoWebAlarmRepository class.

    Since:
    1.8.1
    Version:
    $Id: $
    Author:
    ranger
    • Constructor Detail

      • AlarmRepositoryHibernate

        public AlarmRepositoryHibernate()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception
      • acknowledgeAll

        @Transactional
        public void acknowledgeAll​(java.lang.String user,
                                   java.util.Date timestamp)
        Acknowledge all the alarms.
        Specified by:
        acknowledgeAll in interface AlarmRepository
        Parameters:
        user - the user
        timestamp - the timestamp
      • acknowledgeAlarms

        @Transactional
        public void acknowledgeAlarms​(java.lang.String user,
                                      java.util.Date timestamp,
                                      int[] alarmIds)
      • acknowledgeMatchingAlarms

        @Transactional
        public void acknowledgeMatchingAlarms​(java.lang.String user,
                                              java.util.Date timestamp,
                                              OnmsCriteria criteria)
        Acknowledge alarms matching a specific criteria.
        Specified by:
        acknowledgeMatchingAlarms in interface AlarmRepository
        Parameters:
        user - the user
        timestamp - the timestamp
        criteria - the criteria
      • clearAlarms

        @Transactional
        public void clearAlarms​(int[] alarmIds,
                                java.lang.String user,
                                java.util.Date timestamp)
        Clear Alarms
        Specified by:
        clearAlarms in interface AlarmRepository
        Parameters:
        alarmIds - an array of alarms ID
        user - the user
        timestamp - the timestamp
      • countMatchingAlarms

        @Transactional
        public int countMatchingAlarms​(OnmsCriteria criteria)
        Count alarms matching a criteria.
        Specified by:
        countMatchingAlarms in interface AlarmRepository
        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 interface AlarmRepository
        Parameters:
        criteria - the criteria
        Returns:
        an array with the amount of alarms per severity.
      • escalateAlarms

        @Transactional
        public void escalateAlarms​(int[] alarmIds,
                                   java.lang.String user,
                                   java.util.Date timestamp)
        Escalate Alarms.
        Specified by:
        escalateAlarms in interface AlarmRepository
        Parameters:
        alarmIds - an array of alarms ID
        user - the user
        timestamp - the timestamp
      • getAlarm

        @Transactional
        public OnmsAlarm getAlarm​(int alarmId)
        Gets and alarm.
        Specified by:
        getAlarm in interface AlarmRepository
        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 interface AlarmRepository
        Parameters:
        criteria - the criteria
        Returns:
        a array with matching alarms
      • unacknowledgeAll

        @Transactional
        public void unacknowledgeAll​(java.lang.String user)
        Unacknowledge all the alarms.
        Specified by:
        unacknowledgeAll in interface AlarmRepository
        Parameters:
        user - the user
      • unacknowledgeMatchingAlarms

        @Transactional
        public void unacknowledgeMatchingAlarms​(OnmsCriteria criteria,
                                                java.lang.String user)
        Unacknowledge Matching Alarms

        .
        Specified by:
        unacknowledgeMatchingAlarms in interface AlarmRepository
        Parameters:
        criteria - the criteria
        user - the user
      • acknowledgeAlarms

        @Transactional
        public void acknowledgeAlarms​(int[] alarmIds,
                                      java.lang.String user,
                                      java.util.Date timestamp)
        Acknowledge Alarms.
        Specified by:
        acknowledgeAlarms in interface AlarmRepository
        Parameters:
        alarmIds - an array of alarms ID
        user - the user
        timestamp - the timestamp
      • unacknowledgeAlarms

        @Transactional
        public void unacknowledgeAlarms​(int[] alarmIds,
                                        java.lang.String user)
        Unacknowledge Alarms
        Specified by:
        unacknowledgeAlarms in interface AlarmRepository
        Parameters:
        alarmIds - an array of alarms ID
        user - the user
      • updateStickyMemo

        @Transactional
        public void updateStickyMemo​(java.lang.Integer alarmId,
                                     java.lang.String body,
                                     java.lang.String user)
        Updates the StickyMemo of the alarm to persistence.
        Specified by:
        updateStickyMemo in interface AlarmRepository
        Parameters:
        alarmId - the alarmId of the alarm where the StickyMemo has to be persisted.
      • updateReductionKeyMemo

        @Transactional
        public void updateReductionKeyMemo​(java.lang.Integer alarmId,
                                           java.lang.String body,
                                           java.lang.String user)
        Updates the ReductionKeyMemo of the alarm to persistence. ReductionKeyMemo aka JournalMemo.
        Specified by:
        updateReductionKeyMemo in interface AlarmRepository
        Parameters:
        alarmId - the alarm id
        body - the body
        user - the user
      • removeStickyMemo

        @Transactional
        public void removeStickyMemo​(java.lang.Integer alarmId)
        Removes the sticky memo.
        Specified by:
        removeStickyMemo in interface AlarmRepository
        Parameters:
        alarmId - the alarm id
      • removeReductionKeyMemo

        @Transactional
        public void removeReductionKeyMemo​(int alarmId)
        Removes the reduction key memo.
        Specified by:
        removeReductionKeyMemo in interface AlarmRepository
        Parameters:
        alarmId - the alarm id