Package org.netxms.client.events
Class ActionExecutionConfiguration
java.lang.Object
org.netxms.client.events.ActionExecutionConfiguration
Action execution data
-
Constructor Summary
ConstructorsModifierConstructorDescriptionActionExecutionConfiguration(long actionId, String timerDelay, String snoozeTime, String timerKey, String blockingTimerKey) Create new action execution configurationprotectedActionExecutionConfiguration(NXCPMessage msg, long baseId) Create action execution configuration from NXCP messageCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidfillMessage(NXCPMessage msg, long baseId) Fill NXCP messagestatic StringformatTimerValue(String value) Format timer value (delay or snooze time) for display as a human-readable duration (for example "2h 30m").longGet action IDGet blocking timer key.Get timer delay.Get timer keybooleanisActive()If action should be executedstatic longparseTimerValue(String value) Parse timer value (delay or snooze time) into seconds.voidsetActive(boolean active) Set if action should be activevoidsetBlockingTimerKey(String blockingTimerKey) Set blocking timer keyvoidsetSnoozeTime(String snoozeTime) voidsetTimerDelay(String timerDelay) Set timer delay.voidsetTimerKey(String timerKey) Set timer key
-
Constructor Details
-
ActionExecutionConfiguration
public ActionExecutionConfiguration(long actionId, String timerDelay, String snoozeTime, String timerKey, String blockingTimerKey) Create new action execution configuration- Parameters:
actionId- action IDtimerDelay- timer delay in secondssnoozeTime- snoozeTime in secondstimerKey- timer keyblockingTimerKey- timer key for blocking the action
-
ActionExecutionConfiguration
Create action execution configuration from NXCP message- Parameters:
msg- NXCP messagebaseId- base field ID
-
ActionExecutionConfiguration
Copy constructor- Parameters:
src- source object
-
-
Method Details
-
fillMessage
Fill NXCP message- Parameters:
msg- NXCP messagebaseId- base field ID
-
getTimerDelay
Get timer delay.- Returns:
- timer delay in seconds
-
setTimerDelay
Set timer delay.- Parameters:
timerDelay- timer delay in seconds
-
getTimerKey
Get timer key- Returns:
- current timer key
-
setTimerKey
Set timer key- Parameters:
timerKey- new timer key
-
getActionId
public long getActionId()Get action ID- Returns:
- action ID
-
getBlockingTimerKey
Get blocking timer key.- Returns:
- blocking timer key or empty string if not set
-
setBlockingTimerKey
Set blocking timer key- Parameters:
blockingTimerKey- blocking timer key
-
getSnoozeTime
- Returns:
- the snoozeTime
-
setSnoozeTime
- 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
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
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
-