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 CloseList
getCloseList()
boolean
getFailJobOnError()
Get the current value of the fail job on error flag.boolean
getForceRestart()
Get the value of the Force restart flag for this trigger/action.int
getMaximumRestarts()
Get the maximum number of restarts allowed for this trigger/action.Map<Object,Object>
getPersistentMap()
Get the persistent map.int
getRestartCount()
Get the number of restarts for this trigger/action.String
getRestartReason()
Get the restart reason for this trigger/action.boolean
logRestarts()
Should restarts of this trigger/action be logged?protected void
resetInLoop(int newRestarts)
protected void
resetNewLoop()
void
setFailJobOnError(boolean newValue)
Set the 'fail job on error' flag.void
setForceRestart(boolean newValue, String newReason)
Set the value of the force restart flag for this trigger/action.void
setLogRestarts(boolean newValue)
Set if restarts of this trigger/action should be logged.void
setMaximumRestarts(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:RestartableScriptObject
Set 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:
setFailJobOnError
in interfaceRestartableScriptObject
- Parameters:
newValue
- new value.
-
getFailJobOnError
public final boolean getFailJobOnError()
Description copied from interface:RestartableScriptObject
Get the current value of the fail job on error flag.- Specified by:
getFailJobOnError
in interfaceRestartableScriptObject
- Returns:
- the current value.
- See Also:
.
-
getMaximumRestarts
public int getMaximumRestarts()
Description copied from interface:RestartableScriptObject
Get the maximum number of restarts allowed for this trigger/action.- Specified by:
getMaximumRestarts
in interfaceRestartableScriptObject
- Returns:
- the maximum number of restarts allowed.
- See Also:
.
-
logRestarts
public boolean logRestarts()
Description copied from interface:RestartableScriptObject
Should restarts of this trigger/action be logged?- Specified by:
logRestarts
in interfaceRestartableScriptObject
- Returns:
- true if restarts should be logged, false otherwise.
-
setLogRestarts
public void setLogRestarts(boolean newValue)
Description copied from interface:RestartableScriptObject
Set if restarts of this trigger/action should be logged.- Specified by:
setLogRestarts
in interfaceRestartableScriptObject
- Parameters:
newValue
- true if restarts should be logged, false otherwise.
-
setMaximumRestarts
public void setMaximumRestarts(int newValue)
Description copied from interface:RestartableScriptObject
Set the maximum number of restarts of allowed for this trigger/action. This is a total count for a given modification.- Specified by:
setMaximumRestarts
in interfaceRestartableScriptObject
- Parameters:
newValue
- the maximum number of restarts allowed.
-
getRestartCount
public int getRestartCount()
Description copied from interface:RestartableScriptObject
Get the number of restarts for this trigger/action.- Specified by:
getRestartCount
in interfaceRestartableScriptObject
- Returns:
- the number of restarts so far.
-
getPersistentMap
public Map<Object,Object> getPersistentMap()
Description copied from interface:RestartableScriptObject
Get the persistent map. This can be used to store data across restarts of the trigger/action.- Specified by:
getPersistentMap
in interfaceRestartableScriptObject
- Returns:
- the persistent map.
-
setForceRestart
public void setForceRestart(boolean newValue, String newReason)
Description copied from interface:RestartableScriptObject
Set the value of the force restart flag for this trigger/action. Forced restarts do not effect the restart count.- Specified by:
setForceRestart
in 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:RestartableScriptObject
Get the value of the Force restart flag for this trigger/action.- Specified by:
getForceRestart
in interfaceRestartableScriptObject
- Returns:
- the value of the force restart flag.
-
getRestartReason
public String getRestartReason()
Description copied from interface:RestartableScriptObject
Get the restart reason for this trigger/action.- Specified by:
getRestartReason
in interfaceRestartableScriptObject
- Returns:
- the restart reason.
-
resetNewLoop
protected void resetNewLoop()
-
resetInLoop
protected void resetInLoop(int newRestarts)
-
getCloseList
public CloseList getCloseList()
-
-