Class DefaultAlarmProcessor

All Implemented Interfaces:
PropertyChangeListener, EventListener, ValueProcessor
Direct Known Subclasses:
HostPingAlarmProcessor, StateWatchdogProcessor, StatusCheckAlarmProcessor, SummaryAlarmProcessor, SystemProcessWatchdogProcessor, ValueDiffAlarmProcessor, ValueLevelAlarmProcessor

public class DefaultAlarmProcessor extends MemoryValueProcessor implements PropertyChangeListener

DefaultAlarmProcessor class.

Author:
igor@scictrl.com
  • Constructor Details

    • DefaultAlarmProcessor

      public DefaultAlarmProcessor()

      Constructor for DefaultAlarmProcessor.

  • Method Details

    • newProcessor

      public static final DefaultAlarmProcessor newProcessor(String name, String description, boolean value, boolean fixed, org.apache.commons.configuration.HierarchicalConfiguration conf)
      Creates new instance of DefaultAlarmProcessor and initializes it with Record from provided parameters.
      Parameters:
      name - the name of the record/processor
      description - the description of the record/processor
      value - the alarm value, high or low
      fixed - if value is fixed
      conf - configuration which could include parameters gate.mask and gate.link.
      Returns:
      new instance of DefaultAlarmProvider, configured with own Record
    • configure

      public void configure(Record record, org.apache.commons.configuration.HierarchicalConfiguration config)
      Configures the internals of value processor, provides reference to parent record and to configuration with root inside processor tag. Parent record is not yet initialized, so does not have reference to Database, the Database reference will be available during activate call.
      Specified by:
      configure in interface ValueProcessor
      Overrides:
      configure in class MemoryValueProcessor
      Parameters:
      record - the parent record.
      config - configuration with room inside processor tag.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • updateOrSupress

      public boolean updateOrSupress(gov.aps.jca.dbr.Severity newSeverity, gov.aps.jca.dbr.Status newStatus, boolean notify)
      Updates alarm state. It looks at newSeverity and newStatus fields and sets them to record if necessary.
      Parameters:
      newSeverity - a Severity object
      newStatus - a Status object
      notify - if notification event should be fired from the record.
      Returns:
      true if alarm status was changed
    • update

      public void update(boolean value, gov.aps.jca.dbr.Severity newSeverity, gov.aps.jca.dbr.Status newStatus, boolean notify)
      Updates value and alarm values. Alarm values go trough gate filter.
      Parameters:
      value - new alarm value
      newSeverity - new alarm severity
      newStatus - new alarm status
      notify - if listeners of this objects should be notified
    • activate

      public void activate()
      Record has now reference to Database. processor might want to connect to other records on this server or PVs on other servers. This can not be done until all records from configuration has been loaded. Call to this method signals to the processor that records has been loaded and linking to other values can be commenced.
      Specified by:
      activate in interface ValueProcessor
      Overrides:
      activate in class MemoryValueProcessor
    • updateAlarmStatus

      public void updateAlarmStatus()

      Alarm processor should check connections and other parameters and update alarm status.

      This method should be called by processor itself, for example from PropertyChange update loop.

      As well could be called by asynchronous update loop, which does the supress_time handling.

    • disableSupressTime

      public void disableSupressTime()

      disableSupressTime.