Class ActivityBasedTaskHandler
- java.lang.Object
-
- com.evolveum.midpoint.repo.common.activity.run.task.ActivityBasedTaskHandler
-
- All Implemented Interfaces:
TaskHandler
@Component public class ActivityBasedTaskHandler extends Object implements TaskHandler
Handler for tasks that are based on activity (activities) definition.
-
-
Field Summary
Fields Modifier and Type Field Description static String
HANDLER_URI
-
Constructor Summary
Constructors Constructor Description ActivityBasedTaskHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
@Nullable String
getArchetypeOid(@Nullable String handlerUri)
TODO Decide on the fate of this method.CommonTaskBeans
getBeans()
@NotNull StatisticsCollectionStrategy
getStatisticsCollectionStrategy()
Long
heartbeat(Task task)
TODO decide what to do with this method.void
initialize()
void
onNodeDown(@NotNull TaskType taskBean, @NotNull OperationResult result)
Should update the state of the task (or related tasks) when the node on which this task executed was found down.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.void
refreshStatus(Task task)
TODO decide what to do with this method.void
registerLegacyHandlerUri(String handlerUri)
TaskRunResult
run(@NotNull RunningTask localCoordinatorTask)
Main entry point.void
setAvoidAutoAssigningArchetypes(boolean avoidAutoAssigningArchetypes)
void
unregisterLegacyHandlerUri(String handlerUri)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.task.api.TaskHandler
getDefaultChannel
-
-
-
-
Field Detail
-
HANDLER_URI
public static final String HANDLER_URI
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
@PostConstruct public void initialize()
-
destroy
@PreDestroy public void destroy()
-
getBeans
public CommonTaskBeans getBeans()
-
getArchetypeOid
@Nullable public @Nullable String getArchetypeOid(@Nullable @Nullable String handlerUri)
Description copied from interface:TaskHandler
TODO Decide on the fate of this method.- Specified by:
getArchetypeOid
in interfaceTaskHandler
- 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.
-
run
public TaskRunResult run(@NotNull @NotNull RunningTask localCoordinatorTask) throws TaskException
Main entry point. We basically delegate all the processing to aTaskRun
object.- Specified by:
run
in interfaceTaskHandler
- Throws:
TaskException
-
getStatisticsCollectionStrategy
@NotNull public @NotNull StatisticsCollectionStrategy getStatisticsCollectionStrategy()
- Specified by:
getStatisticsCollectionStrategy
in interfaceTaskHandler
-
heartbeat
public Long heartbeat(Task task)
TODO decide what to do with this method.- Specified by:
heartbeat
in interfaceTaskHandler
-
refreshStatus
public void refreshStatus(Task task)
TODO decide what to do with this method.- Specified by:
refreshStatus
in interfaceTaskHandler
-
registerLegacyHandlerUri
public void registerLegacyHandlerUri(String handlerUri)
-
unregisterLegacyHandlerUri
public void unregisterLegacyHandlerUri(String handlerUri)
-
setAvoidAutoAssigningArchetypes
public void setAvoidAutoAssigningArchetypes(boolean avoidAutoAssigningArchetypes)
-
onNodeDown
public void onNodeDown(@NotNull @NotNull TaskType taskBean, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundException
Description copied from interface:TaskHandler
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.- Specified by:
onNodeDown
in interfaceTaskHandler
- Throws:
SchemaException
ObjectNotFoundException
-
onTaskStalled
public void onTaskStalled(@NotNull @NotNull RunningTask task, long stalledSince, @NotNull @NotNull OperationResult result) throws CommonException
Description copied from interface:TaskHandler
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.- Specified by:
onTaskStalled
in interfaceTaskHandler
- Throws:
CommonException
-
-