Class MonitorEventWorkflowUnit

  • All Implemented Interfaces:
    com.qfs.snl.workflows.units.IWorkflowUnit, com.quartetfs.fwk.types.IExtendedPluginValue, Serializable

    @QuartetExtendedPluginValue(intf=com.qfs.snl.workflows.units.IWorkflowUnit.class,
                                key="MonitorEventWorkflowUnit")
    public class MonitorEventWorkflowUnit
    extends Object
    implements com.qfs.snl.workflows.units.IWorkflowUnit
    Author:
    ActiveViam
    See Also:
    Serialized Form
    • Constructor Detail

      • MonitorEventWorkflowUnit

        public MonitorEventWorkflowUnit()
    • Method Detail

      • getType

        public String getType()
        Specified by:
        getType in interface com.quartetfs.fwk.types.IExtendedPluginValue
      • process

        public void process​(com.qfs.snl.workflows.IWorkflowPayload payload)
        Specified by:
        process in interface com.qfs.snl.workflows.units.IWorkflowUnit
      • hasStatusChanged

        public boolean hasStatusChanged()
        Returns:
        true if the status of this monitor has changed.
      • enterBreach

        public boolean enterBreach()
        Decides if the event starts a new breach.

        This is true under the condition of a status change.

        Returns:
        true if the event denotes for the first time a failure
      • exitBreach

        public boolean exitBreach()
        Decides if the event stops the current breach.

        This is true under the condition of a status change.

        Returns:
        true if the event denotes for the first event after a failure
      • sendMessage

        public void sendMessage​(com.qfs.snl.messages.IMessageService messageService)
        Sends a message notifying of the transition.
        Parameters:
        messageService - the service for messaging
      • getStatusValue

        protected int getStatusValue​(Double status)
        Gets a value representing the status.
        Parameters:
        status - the event status
        Returns:
        the corresponding integer
      • processEvents

        public void processEvents​(List<com.qfs.snl.data.ISentinelEvent> events,
                                  com.qfs.snl.alerts.IEventAlertAggregator alertAggregator)
        Processes all events in a batch.

        This creates new alerts for events breaching and closes others on resolutions.
        Events are processed one by one to properly close alerts, even if it reopens it later, as it will be a new alert.
        As a consequence, alerts remain created one by one.

        Parameters:
        events - events to process
        alertAggregator - aggregator managing alerts for events
      • notifyChanges

        public void notifyChanges​(List<com.qfs.snl.data.ISentinelEvent> events,
                                  com.qfs.snl.messages.IMessageService messageService)
        Creates a message, summarizing all changes among events.
        Parameters:
        events - events to consider
        messageService - message service to use for notifications
      • toStatusString

        protected String toStatusString​(int status)
        Gets a name describing the status code.
        Parameters:
        status - status code
        Returns:
        associated name