Class ActivityRunResult
java.lang.Object
com.evolveum.midpoint.repo.common.activity.run.ActivityRunResult
- All Implemented Interfaces:
ShortDumpable
Result of an run of an activity.
Fields are currently not final, in order to allow setting them stepwise.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDetails forrunResultStatusbeingActivityRunResultStatus.RESTART_REQUESTED. -
Constructor Summary
ConstructorsConstructorDescriptionActivityRunResult(@NotNull OperationResultStatus operationResultStatus, @NotNull ActivityRunResultStatus runResultStatus) -
Method Summary
Modifier and TypeMethodDescriptionstatic ActivityRunResultaborted(OperationResultStatus opResultStatus, ActivityAbortingInformationType abortingInformation) voidclose(boolean canRun, OperationResultStatus status) "Closes" the result by converting null or "in progress" values into finished/interrupted/success/default ones.static ActivityRunResultfinished(OperationResultStatus opResultStatus) static ActivityRunResultfromException(OperationResultStatus opStatus, ActivityRunResultStatus runStatus, Throwable throwable) Converts exception intoActivityRunResult.@Nullable Stringstatic @NotNull ActivityRunResulthandleException(@NotNull Exception e, @NotNull OperationResult opResult, @NotNull AbstractActivityRun<?, ?, ?> activityRun) Handles exceptions that occurred during run of an activity: . converts them intoActivityRunResult. logs them appropriately . records them into the providedOperationResult(Logging and recording are things we usually do when catching exceptions.)static ActivityRunResultbooleanbooleanisError()booleanbooleanbooleanbooleanvoidShow the content of the object intended for diagnostics.static ActivityRunResultsuccess()toString()static ActivityRunResultwaiting()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
Constructor Details
-
ActivityRunResult
public ActivityRunResult() -
ActivityRunResult
public ActivityRunResult(@NotNull @NotNull OperationResultStatus operationResultStatus, @NotNull @NotNull ActivityRunResultStatus runResultStatus)
-
-
Method Details
-
fromException
public static ActivityRunResult fromException(OperationResultStatus opStatus, ActivityRunResultStatus runStatus, Throwable throwable) Converts exception intoActivityRunResult. Used when the exception is notActivityRunException(that provides its own statuses). Otherwise, consider #fromException(Exception). -
success
-
interrupted
-
finished
-
aborted
public static ActivityRunResult aborted(OperationResultStatus opResultStatus, ActivityAbortingInformationType abortingInformation) -
waiting
-
handleException
@NotNull public static @NotNull ActivityRunResult handleException(@NotNull @NotNull Exception e, @NotNull @NotNull OperationResult opResult, @NotNull @NotNull AbstractActivityRun<?, ?, ?> activityRun) Handles exceptions that occurred during run of an activity: . converts them intoActivityRunResult. logs them appropriately . records them into the providedOperationResult(Logging and recording are things we usually do when catching exceptions.) This method is to be called at places that expectActivityRunResultto be returned, instead of throwing exceptions.- Parameters:
e- Exception to be handledopResult- Operation result into which the exception should be recordedactivityRun- Instance of activity run in which the exception is converted. It is used just for logging purposes.- See Also:
-
getRunResultStatus
-
isError
public boolean isError() -
isFinished
public boolean isFinished() -
isWaiting
public boolean isWaiting() -
isInterrupted
public boolean isInterrupted() -
isAborted
public boolean isAborted() -
getSimplifiedRealizationState
-
isRestartRequested
public boolean isRestartRequested() -
getOperationResultStatus
-
getOperationResultStatusBean
-
getThrowable
-
message
-
getMessage
-
getRestartRequestingInformationRequired
@NotNull public @NotNull ActivityRunResult.RestartRequestingInformation getRestartRequestingInformationRequired() -
toString
-
shortDump
Description copied from interface:ShortDumpableShow the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDumpin interfaceShortDumpable- Parameters:
sb- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
close
"Closes" the result by converting null or "in progress" values into finished/interrupted/success/default ones.
-