Class 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 Detail

      • AlarmRepositoryHibernate

        public AlarmRepositoryHibernate()
    • Method Detail

      • afterPropertiesSet

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

        @Transactional
        public void acknowledgeAll​(String user,
                                   Date timestamp)
        Acknowledge all the alarms.
        Specified by:
        acknowledgeAll in interface AlarmRepository
        Parameters:
        user - the user
        timestamp - 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 interface AlarmRepository
        Parameters:
        user - the user
        timestamp - the timestamp
        criteria - the criteria
      • clearAlarms

        @Transactional
        public void clearAlarms​(int[] alarmIds,
                                String user,
                                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,
                                   String user,
                                   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​(String user)
        Unacknowledge all the alarms.
        Specified by:
        unacknowledgeAll in interface AlarmRepository
        Parameters:
        user - the user
      • acknowledgeAlarms

        @Transactional
        public void acknowledgeAlarms​(int[] alarmIds,
                                      String user,
                                      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,
                                        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​(Integer alarmId,
                                     String body,
                                     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​(Integer alarmId,
                                           String body,
                                           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​(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