@PublicAPI public abstract class CommonAttribute extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static Long |
DEFAULT_TASK_RETRY_DELAY
The default value of defining how long to wait before restart task in error (zero or negative value means restart immediately)
|
static String |
GENERIC_INFO_START_AT_KEY
The key for specifying start at time as generic information
|
protected Map<String,String> |
genericInformation
Common user informations
|
protected UpdatableProperties<IntegerWrapper> |
maxNumberOfExecution
The maximum number of execution for a task (default 1).
|
protected UpdatableProperties<OnTaskError> |
onTaskError
OnTaskError defines the behavior happening when a task fails.
|
protected UpdatableProperties<RestartMode> |
restartTaskOnError
Define where will a task be restarted if an error occurred (default is ANYWHERE).
|
protected UpdatableProperties<LongWrapper> |
taskRetryDelay
Specify how long to wait before restart the task if an error occurred.
|
protected Map<String,String> |
unresolvedGenericInformation |
Constructor and Description |
---|
CommonAttribute() |
Modifier and Type | Method and Description |
---|---|
void |
addGenericInformation(String key,
String genericInformation)
Add an information to the generic informations map field.
|
void |
addGenericInformations(Map<String,String> genericInformations)
Add a map of generic informations into the generic informations map field.
|
protected static Map<String,String> |
applyReplacementsOnGenericInformation(Map<String,String> genericInformation,
Map<String,Serializable> variables) |
Map<String,String> |
getGenericInformation()
Returns generic information.
|
int |
getMaxNumberOfExecution()
Get the number of execution allowed for this task.
|
UpdatableProperties<IntegerWrapper> |
getMaxNumberOfExecutionProperty()
Get the maximum number Of Execution updatable property.
|
UpdatableProperties<OnTaskError> |
getOnTaskErrorProperty()
Get the OnTaskError UpdatableProperties.
|
RestartMode |
getRestartTaskOnError()
Returns the restartTaskOnError state.
|
UpdatableProperties<RestartMode> |
getRestartTaskOnErrorProperty()
Get the restartTaskOnError updatable property.
|
Long |
getTaskRetryDelay()
Get how long to wait before restart the task if an error occurred.
|
UpdatableProperties<LongWrapper> |
getTaskRetryDelayProperty()
Get taskRetryDelay UpdatableProperties
|
Map<String,String> |
getUnresolvedGenericInformation()
Returns the generic information without variable replacements.
|
void |
setGenericInformation(Map<String,String> genericInformation)
Set the generic information as a hash map.
|
void |
setMaxNumberOfExecution(int numberOfExecution)
To set the number of execution for this task.
|
void |
setOnTaskError(OnTaskError onTaskError)
Set onTaskError property value.
|
void |
setRestartTaskOnError(RestartMode restartOnError)
Sets the restartTaskOnError to the given restartOnError value.
|
void |
setTaskRetryDelay(long taskRetryDelay)
Set how long to wait before restart the task if an error occurred.
|
void |
setUnresolvedGenericInformation(Map<String,String> unresolvedGenericInformation)
Set the generic information without variable replacement.
|
public static final String GENERIC_INFO_START_AT_KEY
public static final Long DEFAULT_TASK_RETRY_DELAY
protected UpdatableProperties<RestartMode> restartTaskOnError
It will be restarted according to the number of execution remaining.
You can override this property inside each task.
protected UpdatableProperties<LongWrapper> taskRetryDelay
protected UpdatableProperties<IntegerWrapper> maxNumberOfExecution
You can override this property inside each task.
protected UpdatableProperties<OnTaskError> onTaskError
public void setOnTaskError(OnTaskError onTaskError)
onTaskError
- A OnTaskError instance.IllegalArgumentException
- If set to null.public UpdatableProperties<OnTaskError> getOnTaskErrorProperty()
public Long getTaskRetryDelay()
public UpdatableProperties<LongWrapper> getTaskRetryDelayProperty()
public void setTaskRetryDelay(long taskRetryDelay)
taskRetryDelay
- delay to restart a task in errorpublic RestartMode getRestartTaskOnError()
public void setRestartTaskOnError(RestartMode restartOnError)
restartOnError
- the restartOnError to set.public UpdatableProperties<RestartMode> getRestartTaskOnErrorProperty()
public int getMaxNumberOfExecution()
public void setMaxNumberOfExecution(int numberOfExecution)
numberOfExecution
- the number of times this task can be executedpublic UpdatableProperties<IntegerWrapper> getMaxNumberOfExecutionProperty()
public Map<String,String> getGenericInformation()
These information are transmitted to the policy that can use it for the scheduling.
public Map<String,String> getUnresolvedGenericInformation()
public void addGenericInformation(String key, String genericInformation)
key
- the key in which to store the informations.genericInformation
- the information to store.public void addGenericInformations(Map<String,String> genericInformations)
genericInformations
- the generic informations map to add.public void setGenericInformation(Map<String,String> genericInformation)
genericInformation
- the generic information to set.public void setUnresolvedGenericInformation(Map<String,String> unresolvedGenericInformation)
unresolvedGenericInformation
- the raw generic information to set.