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 StringHANDLER_URI
-
Constructor Summary
Constructors Constructor Description ActivityBasedTaskHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()@Nullable StringgetArchetypeOid(@Nullable String handlerUri)TODO Decide on the fate of this method.CommonTaskBeansgetBeans()@NotNull StatisticsCollectionStrategygetStatisticsCollectionStrategy()Longheartbeat(Task task)TODO decide what to do with this method.voidinitialize()voidonNodeDown(@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.voidonTaskStalled(@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.voidrefreshStatus(Task task)TODO decide what to do with this method.voidregisterLegacyHandlerUri(String handlerUri)TaskRunResultrun(@NotNull RunningTask localCoordinatorTask)Main entry point.voidsetAvoidAutoAssigningArchetypes(boolean avoidAutoAssigningArchetypes)voidunregisterLegacyHandlerUri(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:TaskHandlerTODO Decide on the fate of this method.- Specified by:
getArchetypeOidin 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 aTaskRunobject.- Specified by:
runin interfaceTaskHandler- Throws:
TaskException
-
getStatisticsCollectionStrategy
@NotNull public @NotNull StatisticsCollectionStrategy getStatisticsCollectionStrategy()
- Specified by:
getStatisticsCollectionStrategyin interfaceTaskHandler
-
heartbeat
public Long heartbeat(Task task)
TODO decide what to do with this method.- Specified by:
heartbeatin interfaceTaskHandler
-
refreshStatus
public void refreshStatus(Task task)
TODO decide what to do with this method.- Specified by:
refreshStatusin 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, ObjectNotFoundExceptionDescription copied from interface:TaskHandlerShould 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:
onNodeDownin interfaceTaskHandler- Throws:
SchemaExceptionObjectNotFoundException
-
onTaskStalled
public void onTaskStalled(@NotNull @NotNull RunningTask task, long stalledSince, @NotNull @NotNull OperationResult result) throws CommonExceptionDescription copied from interface:TaskHandlerShould 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:
onTaskStalledin interfaceTaskHandler- Throws:
CommonException
-
-