Package com.evolveum.midpoint.task.api
Interface TaskHandler
-
- All Known Implementing Classes:
ActivityBasedTaskHandler
public interface TaskHandler
- Author:
- Radovan Semancik
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description @Nullable String
getArchetypeOid(@Nullable String handlerUri)
TODO Decide on the fate of this method.default String
getDefaultChannel()
default @NotNull StatisticsCollectionStrategy
getStatisticsCollectionStrategy()
default Long
heartbeat(Task task)
default void
onNodeDown(@NotNull TaskType task, @NotNull OperationResult result)
Should update the state of the task (or related tasks) when the node on which this task executed was found down.default void
onTaskStalled(@NotNull RunningTask task, long stalledSince, @NotNull OperationResult result)
Should update the state of the task when the task manager finds that the task is stalled, i.e.default void
refreshStatus(Task task)
TaskRunResult
run(@NotNull RunningTask task)
Executes a task handler.
-
-
-
Method Detail
-
run
TaskRunResult run(@NotNull @NotNull RunningTask task) throws TaskException
Executes a task handler. TODO better description- Throws:
TaskException
-
refreshStatus
default void refreshStatus(Task task)
-
getDefaultChannel
default String getDefaultChannel()
- Returns:
- Channel URI for tasks managed by this handler, if applicable.
-
getStatisticsCollectionStrategy
@NotNull default @NotNull StatisticsCollectionStrategy getStatisticsCollectionStrategy()
-
getArchetypeOid
@Nullable @Nullable String getArchetypeOid(@Nullable @Nullable String handlerUri)
TODO Decide on the fate of this method.- Parameters:
handlerUri
- One the handler URIs supported by this handler.- Returns:
- Archetype OID for tasks that are powered by this handler and have the specified handler URI.
-
onNodeDown
default void onNodeDown(@NotNull @NotNull TaskType task, @NotNull @NotNull OperationResult result) throws CommonException
Should update the state of the task (or related tasks) when the node on which this task executed was found down. Currently this means releasing buckets allocated to this task. In the future we plan to execute this method within a dynamic repo transaction.- Throws:
CommonException
-
onTaskStalled
default void onTaskStalled(@NotNull @NotNull RunningTask task, long stalledSince, @NotNull @NotNull OperationResult result) throws CommonException
Should update the state of the task when the task manager finds that the task is stalled, i.e. did not update its progress for a given (long) time.- Throws:
CommonException
-
-