Class SendEmailAction

java.lang.Object
alarm.actions.AlarmAction
alarm.actions.email.SendEmailAction
All Implemented Interfaces:
PamSettings, SettingsNameProvider

public class SendEmailAction extends AlarmAction implements PamSettings
Author:
mo55
  • Constructor Details

    • SendEmailAction

      public SendEmailAction(AlarmControl alarmControl)
      Parameters:
      alarmControl -
  • Method Details

    • getActionName

      public String getActionName()
      Specified by:
      getActionName in class AlarmAction
      Returns:
      the name of the alarm action
    • hasSettings

      public boolean hasSettings()
      Specified by:
      hasSettings in class AlarmAction
      Returns:
      true if the action has configurable settings
    • getEmailSettings

      public SendEmailSettings getEmailSettings()
    • setSettings

      public boolean setSettings(Window window)
      Description copied from class: AlarmAction
      Open an action specific dialog to configure the action
      Specified by:
      setSettings in class AlarmAction
      Parameters:
      window - parent window
      Returns:
      true if settings changed.
    • actOnAlarm

      public boolean actOnAlarm(AlarmDataUnit alarmDataUnit)
      Description copied from class: AlarmAction
      Act on the alarm - called every time the data unit is updated.
      Specified by:
      actOnAlarm in class AlarmAction
      Parameters:
      alarmDataUnit - alarm data unit that has changed.
      Returns:
      true if action completed ok
    • createAndSendEmail

      public void createAndSendEmail(AlarmDataUnit alarmDataUnit)
      Create and send an email detailing the alarm
      Parameters:
      alarmDataUnit -
    • canDo

      public int canDo()
      Description copied from class: AlarmAction
      Alarm action can complete (i.e. some tests have been conducted)
      Specified by:
      canDo in class AlarmAction
      Returns:
      0 = no, 1 = yes, -1 = don't know.
    • prepareAction

      public boolean prepareAction()
      Description copied from class: AlarmAction
      Called when PAMGuard initialises to prepare any alarm actions, e.g. open a serial port, find a file, etc.
      Overrides:
      prepareAction in class AlarmAction
      Returns:
      true if preparation completed Ok.
    • getUnitName

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • getSettingsReference

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • restoreSettings

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required