Package com.evolveum.midpoint.task.api
Class TaskRunResult
java.lang.Object
com.evolveum.midpoint.task.api.TaskRunResult
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringMessage that should be recorded in the root operation result.protected OperationResultStatusStatus to be reported to the user.protected LongProgress to be recorded in the task.protected TaskRunResult.TaskRunResultStatusFinal status of the run.protected ThrowableAn exception that has occurred and that is going to be recorded at the root of the operation result. -
Constructor Summary
ConstructorsConstructorDescriptionTaskRunResult(TaskRunResult.TaskRunResultStatus runResultStatus, OperationResultStatus operationResultStatus) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull TaskRunResultcreateFailureTaskRunResult(String message, Throwable t) static @NotNull TaskRunResultstatic TaskRunResultbooleanstatic TaskRunResultfinished(OperationResultStatus operationResultStatus) inthashCode()static TaskRunResultof(TaskRunResult.TaskRunResultStatus taskRunResultStatus, OperationResultStatus operationResultStatus) static TaskRunResultvoidsetMessage(String message) voidsetOperationResultStatus(OperationResultStatus operationResultStatus) voidsetProgress(Long progress) voidvoidsetThrowable(Throwable throwable) static TaskRunResulttemporaryError(OperationResultStatus operationResultStatus) toString()
-
Field Details
-
progress
Progress to be recorded in the task. Null means "do not update, take whatever is in the task". -
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
Status to be reported to the user. -
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. -
message
Message that should be recorded in the root operation result. It has the same meaning asthrowable. (Including the fact that if it's null, it won't overwrite whatever is in the result.)
-
-
Constructor Details
-
TaskRunResult
public TaskRunResult() -
TaskRunResult
public TaskRunResult(TaskRunResult.TaskRunResultStatus runResultStatus, OperationResultStatus operationResultStatus)
-
-
Method Details
-
of
public static TaskRunResult of(TaskRunResult.TaskRunResultStatus taskRunResultStatus, OperationResultStatus operationResultStatus) -
finished
-
temporaryError
-
permanentFatalError
-
getProgress
- Returns:
- the progress
-
setProgress
- Parameters:
progress- the progress to set
-
getRunResultStatus
- Returns:
- the status
-
setRunResultStatus
- Parameters:
status- the status to set
-
getOperationResultStatus
-
setOperationResultStatus
-
getThrowable
-
setThrowable
-
getMessage
-
setMessage
-
equals
-
hashCode
public int hashCode() -
toString
-
createFailureTaskRunResult
@NotNull public static @NotNull TaskRunResult createFailureTaskRunResult(String message, Throwable t) -
createFromTaskException
-
createNotApplicableTaskRunResult
-