Package com.redwood.scheduler.action.api
Class ActionScriptObject
- java.lang.Object
-
- com.redwood.scheduler.action.api.ActionScriptObject
-
- All Implemented Interfaces:
RestartableScriptObject
public abstract class ActionScriptObject extends Object implements RestartableScriptObject
Common methods for all job actions.
-
-
Constructor Summary
Constructors Constructor Description ActionScriptObject(boolean newFailJobOnError, Logger newLog)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CloseListgetCloseList()booleangetFailJobOnError()Get the current value of the fail job on error flag.booleangetForceRestart()Get the value of the Force restart flag for this trigger/action.intgetMaximumRestarts()Get the maximum number of restarts allowed for this trigger/action.Map<Object,Object>getPersistentMap()Get the persistent map.intgetRestartCount()Get the number of restarts for this trigger/action.StringgetRestartReason()Get the restart reason for this trigger/action.booleanlogRestarts()Should restarts of this trigger/action be logged?protected voidresetInLoop(int newRestarts)protected voidresetNewLoop()voidsetFailJobOnError(boolean newValue)Set the 'fail job on error' flag.voidsetForceRestart(boolean newValue, String newReason)Set the value of the force restart flag for this trigger/action.voidsetLogRestarts(boolean newValue)Set if restarts of this trigger/action should be logged.voidsetMaximumRestarts(int newValue)Set the maximum number of restarts of allowed for this trigger/action.
-
-
-
Constructor Detail
-
ActionScriptObject
public ActionScriptObject(boolean newFailJobOnError, Logger newLog)
-
-
Method Detail
-
setFailJobOnError
public final void setFailJobOnError(boolean newValue)
Description copied from interface:RestartableScriptObjectSet the 'fail job on error' flag. This flag determines if the job should be failed if the action fails. Set to true to fail the job if the action fails, and false to ignore action failures. The default value is true.- Specified by:
setFailJobOnErrorin interfaceRestartableScriptObject- Parameters:
newValue- new value.
-
getFailJobOnError
public final boolean getFailJobOnError()
Description copied from interface:RestartableScriptObjectGet the current value of the fail job on error flag.- Specified by:
getFailJobOnErrorin interfaceRestartableScriptObject- Returns:
- the current value.
- See Also:
.
-
getMaximumRestarts
public int getMaximumRestarts()
Description copied from interface:RestartableScriptObjectGet the maximum number of restarts allowed for this trigger/action.- Specified by:
getMaximumRestartsin interfaceRestartableScriptObject- Returns:
- the maximum number of restarts allowed.
- See Also:
.
-
logRestarts
public boolean logRestarts()
Description copied from interface:RestartableScriptObjectShould restarts of this trigger/action be logged?- Specified by:
logRestartsin interfaceRestartableScriptObject- Returns:
- true if restarts should be logged, false otherwise.
-
setLogRestarts
public void setLogRestarts(boolean newValue)
Description copied from interface:RestartableScriptObjectSet if restarts of this trigger/action should be logged.- Specified by:
setLogRestartsin interfaceRestartableScriptObject- Parameters:
newValue- true if restarts should be logged, false otherwise.
-
setMaximumRestarts
public void setMaximumRestarts(int newValue)
Description copied from interface:RestartableScriptObjectSet the maximum number of restarts of allowed for this trigger/action. This is a total count for a given modification.- Specified by:
setMaximumRestartsin interfaceRestartableScriptObject- Parameters:
newValue- the maximum number of restarts allowed.
-
getRestartCount
public int getRestartCount()
Description copied from interface:RestartableScriptObjectGet the number of restarts for this trigger/action.- Specified by:
getRestartCountin interfaceRestartableScriptObject- Returns:
- the number of restarts so far.
-
getPersistentMap
public Map<Object,Object> getPersistentMap()
Description copied from interface:RestartableScriptObjectGet the persistent map. This can be used to store data across restarts of the trigger/action.- Specified by:
getPersistentMapin interfaceRestartableScriptObject- Returns:
- the persistent map.
-
setForceRestart
public void setForceRestart(boolean newValue, String newReason)Description copied from interface:RestartableScriptObjectSet the value of the force restart flag for this trigger/action. Forced restarts do not effect the restart count.- Specified by:
setForceRestartin interfaceRestartableScriptObject- Parameters:
newValue- true to force a restart, false to suppress a previous request to force a restart.newReason- the reason for the restart, will be logged.
-
getForceRestart
public boolean getForceRestart()
Description copied from interface:RestartableScriptObjectGet the value of the Force restart flag for this trigger/action.- Specified by:
getForceRestartin interfaceRestartableScriptObject- Returns:
- the value of the force restart flag.
-
getRestartReason
public String getRestartReason()
Description copied from interface:RestartableScriptObjectGet the restart reason for this trigger/action.- Specified by:
getRestartReasonin interfaceRestartableScriptObject- Returns:
- the restart reason.
-
resetNewLoop
protected void resetNewLoop()
-
resetInLoop
protected void resetInLoop(int newRestarts)
-
getCloseList
public CloseList getCloseList()
-
-