Class TaskInformation
java.lang.Object
com.evolveum.midpoint.schema.util.task.TaskInformation
- All Implemented Interfaces:
DebugDumpable,Serializable
- Direct Known Subclasses:
ActivityBasedTaskInformation,LegacyTaskInformation
Contains all non-trivial task information (progress, workers, overall status, and so on) needed for the use
of GUI and reporting.
This is a kind of middle layer (or "API") that isolates higher layers (GUI, reporting) from the details
of data representation at the level of tasks and activities. It also hides the complexities induced by
the transition from tasks-based approach to activities-based one, namely the existence of legacy tasks
that live outside of the new activity framework.
Instances of this class can be created in one of two ways:
1. For a root task (either activity-based or not),
2. For any subtask in hierarchy (either persistent or not, activity-based or not).
The task(s) provided here may have subtasks resolved or not.
If possible, we try to do our best to extract as much information as possible.
But currently we are quite limited. E.g. we ignore the subtasks that were loaded.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final @NotNull OperationResultStatusTypeResult status covering this task and its subtasks.protected final @NotNull TaskTypeThe original task.protected final @NotNull ActivityWorkersInformationWorkers information covering this task and its subtasks.Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTaskInformation(@NotNull TaskType task, @NotNull ActivityWorkersInformation workersInformation, @NotNull OperationResultStatusType overallStatus) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull TaskInformationcreateForTask(@NotNull TaskType task, @Nullable TaskType rootTask) debugDump(int indent) abstract IntegerReturns number of items failed to be processed by the task and its children, if known.@Nullable XMLGregorianCalendarReturns the "stalled since" information for the task and its children.abstract XMLGregorianCalendarReturns the "end timestamp" with the analogous semantics togetStartTimestamp().abstract ObjectReturns textual form of information about nodes on which the task and its children execute.abstract doubleReturns the progress of the task based on activity tree state.abstract StringgetProgressDescription(boolean longForm) Returns short description of progress of the task and its children.@NotNull OperationResultStatusTypeReturns the overall status of the task with its children that is displayable to the user.abstract @Nullable ActivityStatePersistenceTypeabstract XMLGregorianCalendarReturns the "start timestamp", whatever that means.@NotNull TaskTypegetTask()abstract LocalizableMessageReturns the message that describes primarily the overall status (health) of the task and it's subtasks.Return list of technical messages that contains concrete errors/warnings that are related to the task health (plus it's subtasks).abstract OperationResultStatusTypeOverall health status of the task and it's subtasks.abstract List<LocalizableMessage>Return list of localizable messages that contains concrete errors/warnings that are related to the task health (plus it's subtasks).abstract TaskResultStatusabstract booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Field Details
-
task
The original task. -
workersInformation
Workers information covering this task and its subtasks. -
overallStatus
Result status covering this task and its subtasks.
-
-
Constructor Details
-
TaskInformation
protected TaskInformation(@NotNull @NotNull TaskType task, @NotNull @NotNull ActivityWorkersInformation workersInformation, @NotNull @NotNull OperationResultStatusType overallStatus)
-
-
Method Details
-
createForTask
@NotNull public static @NotNull TaskInformation createForTask(@NotNull @NotNull TaskType task, @Nullable @Nullable TaskType rootTask) -
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
getTask
-
getProgressDescriptionShort
Returns short description of progress of the task and its children. -
getProgressDescription
-
getProgress
public abstract double getProgress()Returns the progress of the task based on activity tree state. Progress (%) is based on the number of completed activities to all activities. Each activity represents the same amount of work.- Returns:
- The progress is a number between 0 and 1. If the progress is unknown, the method returns -1.
-
isComplete
public abstract boolean isComplete() -
getAllErrors
Returns number of items failed to be processed by the task and its children, if known. BEWARE: Fatal errors (e.g. resource not found for import task) are not counted here. -
getNodesDescription
Returns textual form of information about nodes on which the task and its children execute. -
getCompletelyStalledSince
Returns the "stalled since" information for the task and its children. -
getResultStatus
Returns the overall status of the task with its children that is displayable to the user. -
getStartTimestamp
Returns the "start timestamp", whatever that means. Currently, it is the execution start for trivial tasks (a single non-bucketed activity, or a legacy task); and realization start otherwise. -
getEndTimestamp
Returns the "end timestamp" with the analogous semantics togetStartTimestamp(). -
getLiveSyncToken
-
getTaskHealthStatus
Overall health status of the task and it's subtasks. Not related to items/objects processing, rather just task execution (e.g. failed/stalled workers). -
getTaskHealthDescription
Returns the message that describes primarily the overall status (health) of the task and it's subtasks. Description should not be based on errors created as a result of items/objects processing, just state of tasks/subtasks and their execution. This should be a short message that is suitable for displaying to the user/table. -
getTaskHealthUserFriendlyMessages
Return list of localizable messages that contains concrete errors/warnings that are related to the task health (plus it's subtasks). Collected messages might repeat, therefore might not be unique. It's up to client to decide whether to filter them. E.g. Policy violation error localizable messages. -
getTaskHealthMessages
Return list of technical messages that contains concrete errors/warnings that are related to the task health (plus it's subtasks). Collected messages might repeat, therefore might not be unique. It's up to client to decide whether to filter them. E.g. Policy violation error messages. -
getRootActivityStatePersistence
-
getTaskUserFriendlyStatus
-