Interface AlarmLifecycleListener

    • Method Detail

      • handleAlarmSnapshot

        void handleAlarmSnapshot​(List<OnmsAlarm> alarms)
        Called periodically with a complete set of alarms as present in the database at the given timestamp. This should be used to synchronize any state to ensure it matches what is currently in the database. Note that it is possible that the *current* state of alarms is different from the state at the time at which the snapshot was taken. Implementations should take this in consideration when performing any state synchronization. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Parameters:
        alarms - canonical set of alarms in the database
      • postHandleAlarmSnapshot

        void postHandleAlarmSnapshot()
        Called after handleAlarmSnapshot(java.util.List<org.opennms.netmgt.model.OnmsAlarm>) has been called on all the listeners, and after the session & transaction used to perform the snapshot has been closed. This can be used to trigger any necessary post-processing of the results once the related session has been closed. This function may be called immediately after a call to preHandleAlarmSnapshot() if an error occurred while preparing the snapshot i.e. when opening the transaction.
      • handleNewOrUpdatedAlarm

        void handleNewOrUpdatedAlarm​(OnmsAlarm alarm)
        Called when an alarm has been created or updated. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Parameters:
        alarm - a newly created or updated alarm
      • handleDeletedAlarm

        void handleDeletedAlarm​(int alarmId,
                                String reductionKey)
        Called when an alarm has been deleted. This method will be called while the related session & transaction that created the alarm are still open. All of the listeners are invoked serially, so the implementors should avoid blocking when possible.
        Parameters:
        alarmId - id of the alarm that was deleted
        reductionKey - reduction key of the alarm that was deleted