@PublicAPI public abstract class CommonAttribute extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
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 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.
|
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 |
setUnresolvedGenericInformation(Map<String,String> unresolvedGenericInformation)
Set the generic information without variable replacement.
|
public static final String GENERIC_INFO_START_AT_KEY
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<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 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.