Class CompositeIncidentHandler

  • All Implemented Interfaces:
    IncidentHandler

    public class CompositeIncidentHandler
    extends java.lang.Object
    implements IncidentHandler

    A composite incident handler that handles incidents of a certain type by the multiple handlers. The result of handling depends on main handler.

    See Also:
    mainIncidentHandler, IncidentHandler
    • Constructor Detail

      • CompositeIncidentHandler

        public CompositeIncidentHandler​(IncidentHandler mainIncidentHandler,
                                        java.util.List<IncidentHandler> incidentHandlers)
        Constructor that takes a list of IncidentHandler that consume the incident.
        Parameters:
        mainIncidentHandler - the main incident handler IncidentHandler that consume the incident and return result.
        incidentHandlers - the list of IncidentHandler that consume the incident.
      • CompositeIncidentHandler

        public CompositeIncidentHandler​(IncidentHandler mainIncidentHandler,
                                        IncidentHandler... incidentHandlers)
        Constructor that takes a varargs parameter IncidentHandler that consume the incident.
        Parameters:
        mainIncidentHandler - the main incident handler IncidentHandler that consume the incident and return result.
        incidentHandlers - the list of IncidentHandler that consume the incident.
    • Method Detail

      • initializeIncidentsHandlers

        protected void initializeIncidentsHandlers​(IncidentHandler mainIncidentHandler,
                                                   java.util.List<IncidentHandler> incidentHandlers)
        Initialize incidentHandlers with data transfered from constructor
        Parameters:
        incidentHandlers -
      • resolveIncident

        public void resolveIncident​(IncidentContext context)
        Description copied from interface: IncidentHandler
        Called in situations in which an incident handler may wish to resolve existing incidents The implementation receives this callback to enable it to resolve any open incidents that may exist.
        Specified by:
        resolveIncident in interface IncidentHandler
      • deleteIncident

        public void deleteIncident​(IncidentContext context)
        Description copied from interface: IncidentHandler
        Called in situations in which an incident handler may wish to delete existing incidents Example: when a scope is ended or a job is deleted. The implementation receives this callback to enable it to delete any open incidents that may exist.
        Specified by:
        deleteIncident in interface IncidentHandler