protected void _sendAdditionalNotification ( NotificationContext context , NotificationStatus status ) { requireArgument ( context != null , "Notification context cannot be null." ) ; if ( status == NotificationStatus . TRIGGERED ) { super . sendAdditionalNotification ( context ) ; } else { super . clearAdditionalNotification ( context ) ; } Notification notification = null ; Trigger trigger = null ; for ( Notification tempNotification : context . getAlert ( ) . getNotifications ( ) ) { if ( tempNotification . getName ( ) . equalsIgnoreCase ( context . getNotification ( ) . getName ( ) ) ) { notification = tempNotification ; break ; } } requireArgument ( notification != null , "Notification in notification context cannot be null." ) ; for ( Trigger tempTrigger : context . getAlert ( ) . getTriggers ( ) ) { if ( tempTrigger . getName ( ) . equalsIgnoreCase ( context . getTrigger ( ) . getName ( ) ) ) { trigger = tempTrigger ; break ; } } requireArgument ( trigger != null , "Trigger in notification context cannot be null." ) ; String body = getGOCMessageBody ( notification , trigger , context , status ) ; Severity sev = status == NotificationStatus . CLEARED ? Severity . OK : Severity . ERROR ; sendMessage ( sev , TemplateReplacer . applyTemplateChanges ( context , context . getNotification ( ) . getName ( ) ) , TemplateReplacer . applyTemplateChanges ( context , context . getAlert ( ) . getName ( ) ) , TemplateReplacer . applyTemplateChanges ( context , context . getTrigger ( ) . getName ( ) ) , body , context . getNotification ( ) . getSeverityLevel ( ) , context . getNotification ( ) . getSRActionable ( ) , context . getTriggerFiredTime ( ) , context . getTriggeredMetric ( ) ) ; }
Update the state of the notification to indicate whether the triggering condition exists or has been cleared .