Class Trigger

java.lang.Object
org.frankframework.monitoring.Trigger
All Implemented Interfaces:
EventListener, IConfigurable, LazyLoadingEventListener<FireMonitorEvent>, ITrigger, org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<FireMonitorEvent>
Direct Known Subclasses:
Alarm, Clearing

public class Trigger extends Object implements ITrigger, org.springframework.context.ApplicationContextAware
A Trigger that has its type configured at startup. Either use type = ALARM or type = CLEARING.
Since:
4.9
Author:
Gerrit van Brakel
  • Constructor Details

    • Trigger

      public Trigger()
  • Method Details

    • configure

      public void configure() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • isConfigured

      public boolean isConfigured()
      Specified by:
      isConfigured in interface ITrigger
    • onApplicationEvent

      public void onApplicationEvent(@Nonnull FireMonitorEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<FireMonitorEvent>
    • evaluateEvent

      protected void evaluateEvent(FireMonitorEvent event)
    • evaluateAdapterFilters

      protected boolean evaluateAdapterFilters(EventThrowing source)
    • changeState

      protected void changeState(FireMonitorEvent event) throws MonitorException
      Throws:
      MonitorException
    • clearEvents

      public void clearEvents()
      Specified by:
      clearEvents in interface ITrigger
    • cleanUpEvents

      protected void cleanUpEvents(Instant now)
    • toXml

      public void toXml(XmlBuilder monitor)
      Specified by:
      toXml in interface ITrigger
    • setMonitor

      public void setMonitor(Monitor monitor)
      Specified by:
      setMonitor in interface ITrigger
    • addEventCodeText

      public void addEventCodeText(String code)
      Adds one or more events to the trigger. Example: Pipe Exception. Each event requires it's own xml tag. It is not a comma-separated field.
    • setEventCode

      public void setEventCode(String code)
    • setEventCodes

      public void setEventCodes(List<String> events)
      Specified by:
      setEventCodes in interface ITrigger
    • getEventCodes

      public List<String> getEventCodes()
      Specified by:
      getEventCodes in interface ITrigger
    • setThreshold

      public void setThreshold(int i)
      Amount of triggers required before sounding an alarm
      Specified by:
      setThreshold in interface ITrigger
    • setPeriod

      public void setPeriod(int i)
      Amount of hits required within 'x' amount of seconds before it counts as a trigger
      Specified by:
      setPeriod in interface ITrigger
    • getAdapterFilters

      public Map<String,AdapterFilter> getAdapterFilters()
      Specified by:
      getAdapterFilters in interface ITrigger
    • clearAdapterFilters

      public void clearAdapterFilters()
      Specified by:
      clearAdapterFilters in interface ITrigger
    • isFilterOnLowerLevelObjects

      public boolean isFilterOnLowerLevelObjects()
    • addAdapterFilter

      public void addAdapterFilter(AdapterFilter af)
      Specified by:
      addAdapterFilter in interface ITrigger
    • isFilterOnAdapters

      public boolean isFilterOnAdapters()
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception
    • getMonitor

      public Monitor getMonitor()
    • getSeverity

      public Severity getSeverity()
      Specified by:
      getSeverity in interface ITrigger
    • setSeverity

      public void setSeverity(Severity severity)
      Specified by:
      setSeverity in interface ITrigger
    • getSourceFiltering

      public SourceFiltering getSourceFiltering()
      Specified by:
      getSourceFiltering in interface ITrigger
    • setSourceFiltering

      public void setSourceFiltering(SourceFiltering sourceFiltering)
      Specified by:
      setSourceFiltering in interface ITrigger
    • getTriggerType

      public ITrigger.TriggerType getTriggerType()
      Specified by:
      getTriggerType in interface ITrigger
    • setTriggerType

      public void setTriggerType(ITrigger.TriggerType triggerType)
      Specified by:
      setTriggerType in interface ITrigger
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • getThreshold

      public int getThreshold()
      Specified by:
      getThreshold in interface ITrigger
    • getPeriod

      public int getPeriod()
      Specified by:
      getPeriod in interface ITrigger