Class ActionExecutionConfiguration

java.lang.Object
org.netxms.client.events.ActionExecutionConfiguration

public class ActionExecutionConfiguration extends Object
Action execution data
  • Constructor Details

    • ActionExecutionConfiguration

      public ActionExecutionConfiguration(long actionId, String timerDelay, String snoozeTime, String timerKey, String blockingTimerKey)
      Create new action execution configuration
      Parameters:
      actionId - action ID
      timerDelay - timer delay in seconds
      snoozeTime - snoozeTime in seconds
      timerKey - timer key
      blockingTimerKey - timer key for blocking the action
    • ActionExecutionConfiguration

      protected ActionExecutionConfiguration(NXCPMessage msg, long baseId)
      Create action execution configuration from NXCP message
      Parameters:
      msg - NXCP message
      baseId - base field ID
    • ActionExecutionConfiguration

      public ActionExecutionConfiguration(ActionExecutionConfiguration src)
      Copy constructor
      Parameters:
      src - source object
  • Method Details

    • fillMessage

      public void fillMessage(NXCPMessage msg, long baseId)
      Fill NXCP message
      Parameters:
      msg - NXCP message
      baseId - base field ID
    • getTimerDelay

      public String getTimerDelay()
      Get timer delay.
      Returns:
      timer delay in seconds
    • setTimerDelay

      public void setTimerDelay(String timerDelay)
      Set timer delay.
      Parameters:
      timerDelay - timer delay in seconds
    • getTimerKey

      public String getTimerKey()
      Get timer key
      Returns:
      current timer key
    • setTimerKey

      public void setTimerKey(String timerKey)
      Set timer key
      Parameters:
      timerKey - new timer key
    • getActionId

      public long getActionId()
      Get action ID
      Returns:
      action ID
    • getBlockingTimerKey

      public String getBlockingTimerKey()
      Get blocking timer key.
      Returns:
      blocking timer key or empty string if not set
    • setBlockingTimerKey

      public void setBlockingTimerKey(String blockingTimerKey)
      Set blocking timer key
      Parameters:
      blockingTimerKey - blocking timer key
    • getSnoozeTime

      public String getSnoozeTime()
      Returns:
      the snoozeTime
    • setSnoozeTime

      public void setSnoozeTime(String snoozeTime)
      Parameters:
      snoozeTime - the snoozeTime to set
    • isActive

      public boolean isActive()
      If action should be executed
      Returns:
      true if is active
    • setActive

      public void setActive(boolean active)
      Set if action should be active
    • parseTimerValue

      public static long parseTimerValue(String value)
      Parse timer value (delay or snooze time) into seconds. The value may carry an optional unit suffix (case-insensitive): s (seconds), m (minutes), h (hours), d (days), w (weeks); without a suffix the value is interpreted as seconds.
      Parameters:
      value - timer value as stored
      Returns:
      time in seconds, or -1 if the value is empty or cannot be parsed as a plain duration (for example when it contains a macro)
    • formatTimerValue

      public static String formatTimerValue(String value)
      Format timer value (delay or snooze time) for display as a human-readable duration (for example "2h 30m"). If the value cannot be parsed as a plain duration (for example when it contains a macro) it is returned unchanged.
      Parameters:
      value - timer value as stored
      Returns:
      human-readable representation