Package com.evolveum.midpoint.task.api
Class TaskRunResult
- java.lang.Object
-
- com.evolveum.midpoint.task.api.TaskRunResult
-
- All Implemented Interfaces:
Serializable
public class TaskRunResult extends Object implements Serializable
Single-purpose class to return task run results. More than one value is returned, therefore it is bundled into a class.- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TaskRunResult.TaskRunResultStatus
-
Field Summary
Fields Modifier and Type Field Description protected String
message
Message that should be recorded in the root operation result.protected OperationResultStatus
operationResultStatus
Status to be reported to the user.protected Long
progress
Progress to be recorded in the task.protected TaskRunResult.TaskRunResultStatus
runResultStatus
Final status of the run.protected Throwable
throwable
An exception that has occurred and that is going to be recorded at the root of the operation result.
-
Constructor Summary
Constructors Constructor Description TaskRunResult()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull TaskRunResult
createFailureTaskRunResult(String message, Throwable t)
static @NotNull TaskRunResult
createFromTaskException(TaskException e)
static TaskRunResult
createNotApplicableTaskRunResult()
boolean
equals(Object o)
String
getMessage()
OperationResultStatus
getOperationResultStatus()
Long
getProgress()
TaskRunResult.TaskRunResultStatus
getRunResultStatus()
Throwable
getThrowable()
int
hashCode()
void
setMessage(String message)
void
setOperationResultStatus(OperationResultStatus operationResultStatus)
void
setProgress(Long progress)
void
setRunResultStatus(TaskRunResult.TaskRunResultStatus status)
void
setThrowable(Throwable throwable)
String
toString()
-
-
-
Field Detail
-
progress
protected Long progress
Progress to be recorded in the task. Null means "do not update, take whatever is in the task".
-
runResultStatus
protected TaskRunResult.TaskRunResultStatus runResultStatus
Final status of the run. It drives what should be done next. (E.g. repeat the run in the case of temporary errors and recurring tasks.)
-
operationResultStatus
protected OperationResultStatus operationResultStatus
Status to be reported to the user.
-
throwable
protected Throwable throwable
An exception that has occurred and that is going to be recorded at the root of the operation result. This is the "main" exception that caused the task run to be stopped. (It should be recorded somewhere in the operation result as well, if possible. But here it is designated as _the_ cause of the run being stopped.) If null, we will not overwrite the value that is computed for the result.
-
-
Method Detail
-
getProgress
public Long getProgress()
- Returns:
- the progress
-
setProgress
public void setProgress(Long progress)
- Parameters:
progress
- the progress to set
-
getRunResultStatus
public TaskRunResult.TaskRunResultStatus getRunResultStatus()
- Returns:
- the status
-
setRunResultStatus
public void setRunResultStatus(TaskRunResult.TaskRunResultStatus status)
- Parameters:
status
- the status to set
-
getOperationResultStatus
public OperationResultStatus getOperationResultStatus()
-
setOperationResultStatus
public void setOperationResultStatus(OperationResultStatus operationResultStatus)
-
getThrowable
public Throwable getThrowable()
-
setThrowable
public void setThrowable(Throwable throwable)
-
getMessage
public String getMessage()
-
setMessage
public void setMessage(String message)
-
createFailureTaskRunResult
@NotNull public static @NotNull TaskRunResult createFailureTaskRunResult(String message, Throwable t)
-
createFromTaskException
@NotNull public static @NotNull TaskRunResult createFromTaskException(TaskException e)
-
createNotApplicableTaskRunResult
public static TaskRunResult createNotApplicableTaskRunResult()
-
-