Package com.evolveum.midpoint.task.api
Interface Task
- All Superinterfaces:
- ConnIdOperationsListener,- DebugDumpable,- MappingStatisticsCollector,- NotificationStatisticsCollector,- StatisticsCollector,- TaskActionsExecutedCollector,- TaskIterativeOperationCollector,- TaskSynchronizationStatisticsCollector
- All Known Subinterfaces:
- RunningLightweightTask,- RunningTask
- All Known Implementing Classes:
- NullTaskImpl
Task instance - a logical unit of work.
 It is executed either synchronously or asynchronously.
 When running asynchronously, it can be scheduled, suspended, or resumed.
 The classes that implement this interface hold a "java" task state. They represent the in-memory task data structure.
 The instances must be able to serialize the state to the repository object (TaskType) when needed.
 The task implementation should be simple Java objects (POJOs). They are created also for a synchronous tasks, which means
 they are created frequently. We want a low overhead for task management until the task is made persistent.
 API for modifying task properties works like this:
 - A getter (getItemName) reads data from the in-memory representation of a task.
 - A setter (setItemName) writes data to the in-memory representation, and (for persistent tasks)
 prepares a delta to be written into repository later.
 The deltas should be then written by calling 
flushPendingModifications(OperationResult) method.
 In case you want to write property change into the repository immediately, you have to use
 setItemNameImmediate method. In that case, the change does not go into
 the list of pending modifications, but it is instantly written into the repository
 (so the method uses OperationResult as parameter, and can throw relevant exceptions as well).- Author:
- Radovan Semancik
- 
Field SummaryFieldsFields inherited from interface com.evolveum.midpoint.util.DebugDumpableINDENT_STRING
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddArchetypeInformation(@NotNull String archetypeOid) Adds an archetype for the task.voidaddArchetypeInformationIfMissing(@NotNull String archetypeOid) AsaddArchetypeInformation(String)but executed only if there's no archetype currently set.voidaddDependent(String taskIdentifier) Add a task as this task's dependent, i.e. the task denoted by taskIdentifier DEPENDS ON (waits for completion of) this task.voidaddExtensionProperty(PrismProperty<?> property) Adds value(s) to a given extension property.voidaddExtensionReference(PrismReference reference) Adds value(s) to a given extension reference.voidaddTracingRequest(TracingRootType point) Requests (future) tracing for given tracing point - for this task.voidapplyDeltasImmediate(Collection<ItemDelta<?, ?>> itemDeltas, OperationResult result) voidapplyModificationsTransient(Collection<ItemDelta<?, ?>> modifications) default booleandefault voidassertPersistentExecution(String message) default booleancanSee(AbstractMappingType mapping) Just a convenience method.default booleancanSee(ObjectType object) Just a convenience method.default booleanJust a convenience method.Creates a transient subtask.voiddeleteExtensionProperty(PrismProperty<?> property) Removes specified VALUES of this extension property (not all of its values).booleandoesItemExist(ItemPath path) TODOvoidflushPendingModifications(OperationResult parentResult) Saves modifications done against the in-memory version of the task into the repository.Gets task work state or its clone (for running tasks).default @Nullable ActivityStateTypegetActivityStateOrClone(@NotNull ActivityPath activityPath) Returns the activity state for given activity path.TODOdefault @Nullable ActivityStateOverviewTypeGets information from the current task and - for running task - its transient subtasks (aka worker threads).Returns task binding.@NotNull Collection<String>Returns an immutable collection of caching profiles.Returns channel URI associated with this task.Returns the completion timestamp - time when the task was closed (or null if it is not closed).<C extends Containerable>
 CgetContainerableOrClone(ItemPath path, Class<C> type) TODOLists all explicit dependents' identifiers.Returns task description.Returns task execution constraintsGets the execution environment configuration.@NotNull TaskExecutionModeReturns the execution mode of this task.Returns high-level execution state.default ExecutionSupport@Nullable LongReturns expected total progress.PrismContainer<? extends ExtensionType>Gets extension clone, or null if there is no extension.<T extends Containerable>
 TgetExtensionContainerRealValueOrClone(ItemName containerName) Returns specified single-valued container real value from the extension To ensure thread safety, in the case of running tasks the returned value is a clone of the live one.<IV extends PrismValue,ID extends ItemDefinition<?>> 
 Item<IV,ID> getExtensionItemOrClone(ItemName itemName) Returns specified item (property, reference or container) from the extension.PrismContainer<? extends ExtensionType>Returns task extension.<T> PrismProperty<T>getExtensionPropertyOrClone(ItemName propertyName) Returns specified property from the extension; or null if extension or property does not exist.default <T> TgetExtensionPropertyRealValue(ItemName propertyName) Returns specified single-valued property real value from the extension (null if extension or property does not exist).Returns specified reference from the extension.getGroup()Gets the execution group name (i.e. executionConstraints/group).@NotNull Collection<String>Returns names of all groups (primary plus all secondary ones).Returns all groups (primary plus all secondary ones) along with task count limits.Returns handler URI.<T> TgetItemRealValueOrClone(ItemPath path, Class<T> expectedType) Returns the time when the task last run was finished (or null if the task was not finished yet).Returns the time when the task last run was started (or null if the task was never started).longReturns task progress, as reported by task handler.getName()Returns human-readable name of the task.getNextRunStartTime(OperationResult result) Returns the time when the task should start again.getNode()Returns the node the task is currently executing at, based on repository information.Returns the node as really observed.<T extends ObjectType>
 PrismObject<T>getObject(Class<T> type, OperationResult result) Returns object that the task is associated with.Returns OID of the object that the task is associated with.Returns reference to the object that the task is associated with.getOid()Returns task OID.@NotNull PrismContainer<? extends ExtensionType>Gets or creates an extension.PrismObject<? extends FocusType>getOwner(OperationResult result) Returns object that owns this task.Returns a reference to the task owner.Returns the identifier of the task's parent (or null of there is no parent task).@NotNull ParentAndRootgetParentAndRoot(OperationResult result) Looks for OID of the parent and the root of the task tree for this task.getParentTask(OperationResult result) Returns the parent task, if any.getPathToRootTask(OperationResult result) Returns the path from this task to the task tree root.@NotNull TaskPersistenceStatusReturns task persistence status.<T> TgetPropertyRealValue(ItemPath path, Class<T> expectedType) <T> TgetPropertyRealValueOrClone(ItemPath path, Class<T> expectedType) @NotNull PrismObject<TaskType>Returns CLONE of backing task prism object without updating with current operation result.@NotNull PrismObject<TaskType>Returns backing task prism object without updating with current operation result.@NotNull TaskRecurrenceTypeReturns task recurrence status.TODO what about thread safety?TODO what about thread safety?Gets the requestee OID - typically an identification of account owner (for notifications).Returns a top-level OperationResult stored in the task.Returns the status of top-level OperationResult stored in the task.default @NotNull TaskgetRoot(OperationResult result) Returns the root of the task tree for this task.default @Nullable XMLGregorianCalendarReturns the completion timestamp of the root activity.default ActivityDefinitionTypeRetrieves the definition of the [root] activity.Returns the schedule.Returns the schedule interval.Returns low-level scheduling state.@NotNull ObjectReferenceTypeReturns a reference to the task prism.@NotNull ObjectReferenceTypeReturns a full (object-bearing) reference to the task prism.@Nullable SimulationTransactionReturns the current simulation transaction, if there is any.Returns operation statistics from the task prism object (i.e. not the live ones).Returns task (lightweight) identifier.Returns thread stop action (what happens when the task thread is stopped e.g. because of node going down).Returns (reference to tracing profile) that was defined for the tracing started by this task.@NotNull Collection<TracingRootType>Get points for which the tracing is requested (within this task).@NotNull PrismObject<TaskType>Returns backing task prism object UPDATED with current operation result.Returns the version of underlying prism object.Returns the task waiting reason for a WAITING task.Gets task work state.booleanReturns true if the task has any assignments.booleanReturns true if the schedule interval is set.voidIncrements legacy progress without creating a pending modification.booleanReturns true if the task is asynchronous.default booleanisClosed()Returns true if the task is closed.default booleandefault booleandefault booleanReturns true if the task is loosely bound.booleanReturns true if task is persistent (i.e. stored in repository).default booleandefault booleanisReady()Returns true if the task is ready.default booleanChecks whether the task is a cyclic (recurring) one.default booleanisRoot()default booleandefault booleandefault booleanisSingle()Checks whether the task is single-run.default booleanReturns true if the task is suspended.default booleanReturns true if the task is tightly bound.booleanReturns true if task is transient (i.e. not stored in repository).default booleanReturns true if the task is waiting.listDependents(OperationResult result) Lists all explicit dependents, i.e. tasks that wait for the completion of this tasks (that depend on it).listPrerequisiteTasks(OperationResult parentResult) List all prerequisite tasks for the current tasks, i.e. tasks that must complete before this one can proceed.listSubtasks(boolean persistentOnly, OperationResult parentResult) listSubtasks(OperationResult parentResult) Lists the (direct) subtasks of a given task.listSubtasksDeeply(boolean persistentOnly, OperationResult result) Lists all tasks in subtasks tree.listSubtasksDeeply(OperationResult result) List all the subtasks of a given task, i.e. whole task tree rooted at the current task.default voidMakes a task single-run, with no particular schedule.voidChanges in-memory representation immediately and schedules a corresponding batched modification.default voidmodify(Collection<ItemDelta<?, ?>> deltas) Applies given collection of deltas.voidrefresh(OperationResult result) Re-reads the task state from the persistent storage.voidregisterConnIdOperationsListener(@NotNull ConnIdOperationsListener listener) Registers aConnIdOperationsListener.voidRemoves all tracing requests for this task.voidsetChannel(String channelUri) Sets channel URI.voidsetCleanupAfterCompletion(Duration duration) voidsetDescription(String value) Sets task description.voidsetDescriptionImmediate(String value, OperationResult result) Sets task description, immediately storing it into the repo.voidSets task execution constraints.voidSets the execution environment configuration.@NotNull TaskExecutionModesetExecutionMode(@NotNull TaskExecutionMode mode) Sets the execution mode of this task.voidsetExpectedTotal(Long value) Stores expected total progress of the task, storing it persistently if needed.<C extends Containerable>
 voidsetExtensionContainer(PrismContainer<C> item) Sets a container in the extension - replaces existing value(s), if any, by the one(s) provided.<T extends Containerable>
 voidsetExtensionContainerValue(QName containerName, T value) Sets a container value in the extension - replaces existing value(s), if any, by the one provided.voidsetExtensionItem(Item<?, ?> item) Puts generic item into extension.voidsetExtensionProperty(PrismProperty<?> property) Sets a property in the extension - replaces existing value(s), if any, by the one(s) provided.voidsetExtensionPropertyImmediate(PrismProperty<?> property, OperationResult result) "Immediate" version of the above method.default <T> voidsetExtensionPropertyValue(QName propertyName, T value) Sets (i.e., replaces) the value of the given property in task extension.voidsetExtensionReference(PrismReference reference) Sets a reference in the extension - replaces existing value(s), if any, by the one(s) provided.voidsetHandlerUri(String value) Sets handler URI.voidsetInitialExecutionAndScheduledState(TaskExecutionStateType executionState, TaskSchedulingStateType schedulingState) Sets initial task execution and scheduled state.default voidSets the initial task execution and scheduling state to allow the task to run.default voidSets the initial task execution and scheduling state to make task suspended.voidSets the initial task execution and scheduling state to make task waiting (for prerequisite tasks).default voidsetItemRealValues(ItemPath path, Object... value) default voidsetItemRealValuesCollection(ItemPath path, Collection<?> values) voidsetLegacyProgress(Long value) Records _legacy_ progress of the task, storing it persistently if needed.voidsetLegacyProgressImmediate(Long progress, OperationResult parentResult) "Immediate" version ofsetLegacyProgress(Long).voidsetName(PolyStringType value) Sets the human-readable name of the task.voidSets the human-readable name of the task.voidsetNameImmediate(PolyStringType value, OperationResult result) Sets the human-readable name of the task, immediately into repository.voidsetObjectRef(ObjectReferenceType objectRef) Sets the object reference.voidsetObjectRef(String oid, QName type) Sets the object reference.voidsetOwner(PrismObject<? extends FocusType> owner) Sets the task owner.voidsetOwnerRef(ObjectReferenceType ownerRef) Sets the task owner reference.<T> voidsetPropertyRealValue(ItemPath path, T value) voidvoidsetResult(OperationResult result) Sets the top-level OperationResult stored in the task.default voidsetRootActivityDefinition(ActivityDefinitionType activityDefinition) voidsetSchedule(ScheduleType schedule) Sets the schedule for the task.Sets the current simulation transaction object.voidSets the thread stop action for this task.voidsetTracingProfile(TracingProfileType tracingProfile) Sets the profile to be used for future tracing within this task.voidunregisterConnIdOperationsListener(@NotNull ConnIdOperationsListener listener) Unregisters aConnIdOperationsListener.Methods inherited from interface com.evolveum.midpoint.task.api.ConnIdOperationsListeneronConnIdOperationEnd, onConnIdOperationResume, onConnIdOperationStart, onConnIdOperationSuspendMethods inherited from interface com.evolveum.midpoint.util.DebugDumpabledebugDump, debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.schema.statistics.MappingStatisticsCollectorrecordMappingOperationMethods inherited from interface com.evolveum.midpoint.schema.statistics.NotificationStatisticsCollectorrecordNotificationOperationMethods inherited from interface com.evolveum.midpoint.schema.statistics.StatisticsCollectorrecordStateMessageMethods inherited from interface com.evolveum.midpoint.schema.statistics.TaskActionsExecutedCollectorrecordObjectActionExecuted, recordObjectActionExecuted, recordObjectActionExecuted, startCollectingActionsExecuted, stopCollectingActionsExecutedMethods inherited from interface com.evolveum.midpoint.schema.statistics.TaskIterativeOperationCollectorrecordIterativeOperationStart, recordIterativeOperationStart, recordIterativeOperationStartMethods inherited from interface com.evolveum.midpoint.schema.statistics.TaskSynchronizationStatisticsCollectoronSynchronizationExclusion, onSynchronizationSituationChange, onSynchronizationStart, startCollectingSynchronizationStatistics, stopCollectingSynchronizationStatistics
- 
Field Details- 
DOT_INTERFACE
 
- 
- 
Method Details- 
getTaskIdentifierString getTaskIdentifier()Returns task (lightweight) identifier. This is an unique identification of any task, regardless whether it is persistent or transient (cf. OID). Therefore this can be used to identify all tasks, e.g. for the purposes of auditing and logging. Task identifier is assigned automatically when the task is created. It is immutable.
- 
getOidString getOid()Returns task OID. Only persistent tasks have OID. So this method returns null if the task is not persistent.
- 
getOwnerReturns object that owns this task. It usually means the user that started the task or a system used that is used to execute the task. The owner will be used to determine access rights of the task, will be used for auditing, etc. The object is lazily fetched from repository.
- 
getOwnerRefObjectReferenceType getOwnerRef()Returns a reference to the task owner. (Cloned if the task is running.)
- 
setOwnerSets the task owner. Precondition: Task is transient.
- 
setOwnerRefSets the task owner reference. Precondition: Task is transient.
- 
getNamePolyStringType getName()Returns human-readable name of the task.
- 
setNameSets the human-readable name of the task.
- 
setNameSets the human-readable name of the task.
- 
setNameImmediatevoid setNameImmediate(PolyStringType value, OperationResult result) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException Sets the human-readable name of the task, immediately into repository.
- 
getDescriptionString getDescription()Returns task description.
- 
setDescriptionSets task description.
- 
setDescriptionImmediatevoid setDescriptionImmediate(String value, OperationResult result) throws ObjectNotFoundException, SchemaException Sets task description, immediately storing it into the repo.
- 
getExecutionStateTaskExecutionStateType getExecutionState()Returns high-level execution state.
- 
isRunnabledefault boolean isRunnable()
- 
isRunningdefault boolean isRunning()
- 
getSchedulingStateTaskSchedulingStateType getSchedulingState()Returns low-level scheduling state.
- 
isCloseddefault boolean isClosed()Returns true if the task is closed. (Refers to the scheduling state.)
- 
isReadydefault boolean isReady()Returns true if the task is ready. (Refers to the scheduling state.)
- 
isWaitingdefault boolean isWaiting()Returns true if the task is waiting. (BEWARE: Refers to the scheduling state.)
- 
isSuspendeddefault boolean isSuspended()Returns true if the task is suspended. (BEWARE: Refers to the scheduling state.)
- 
getWaitingReasonTaskWaitingReasonType getWaitingReason()Returns the task waiting reason for a WAITING task.
- 
getNodeString getNode()Returns the node the task is currently executing at, based on repository information. This is present in all cases, however, it might be out-of-date, e.g. when node crashes.
- 
getNodeAsObservedString getNodeAsObserved()Returns the node as really observed. This is a transient information that has to be requested explicitly.
- 
setInitialExecutionAndScheduledStatevoid setInitialExecutionAndScheduledState(TaskExecutionStateType executionState, TaskSchedulingStateType schedulingState) Sets initial task execution and scheduled state. It will be used when the task is made persistent. Precondition: Task is transient.
- 
setInitiallyRunnabledefault void setInitiallyRunnable()Sets the initial task execution and scheduling state to allow the task to run.
- 
setInitiallySuspendeddefault void setInitiallySuspended()Sets the initial task execution and scheduling state to make task suspended.
- 
setInitiallyWaitingForPrerequisitesvoid setInitiallyWaitingForPrerequisites()Sets the initial task execution and scheduling state to make task waiting (for prerequisite tasks).
- 
getPersistenceStatusReturns task persistence status.
- 
isTransientboolean isTransient()Returns true if task is transient (i.e. not stored in repository).
- 
isPersistentboolean isPersistent()Returns true if task is persistent (i.e. stored in repository).
- 
isAsynchronousboolean isAsynchronous()Returns true if the task is asynchronous. The asynchronous task is not executing in foreground. Therefore any thread that is not explicitly allocated for the task can be discarded. E.g. if a GUI thread detects that the task is asynchronous it knows that there is no point in waiting for the task result. It can just display appropriate message to the user (e.g. "please come back later") and return control back to the web container. Usually, asynchronous means the same as persistent. However, there can are lightweight tasks that are asynchronous but not stored in repository.- Returns:
- true if the task is asynchronous.
 
- 
getRecurrenceReturns task recurrence status.
- 
isRecurringdefault boolean isRecurring()Checks whether the task is a cyclic (recurring) one.
- 
isSingledefault boolean isSingle()Checks whether the task is single-run.
- 
makeSingledefault void makeSingle()Makes a task single-run, with no particular schedule.
- 
setScheduleSets the schedule for the task. Removes also the legacy recurrence flag.
- 
getExecutionConstraintsTaskExecutionConstraintsType getExecutionConstraints()Returns task execution constraints
- 
setExecutionConstraintsSets task execution constraints.
- 
getGroupString getGroup()Gets the execution group name (i.e. executionConstraints/group).
- 
getGroupsReturns names of all groups (primary plus all secondary ones).
- 
getGroupsWithLimitsReturns all groups (primary plus all secondary ones) along with task count limits.
- 
getScheduleScheduleType getSchedule()Returns the schedule.
- 
getScheduleIntervalInteger getScheduleInterval()Returns the schedule interval.
- 
hasScheduleIntervalboolean hasScheduleInterval()Returns true if the schedule interval is set.
- 
getThreadStopActionThreadStopActionType getThreadStopAction()Returns thread stop action (what happens when the task thread is stopped e.g. because of node going down).
- 
setThreadStopActionSets the thread stop action for this task.
- 
getLastRunStartTimestampLong getLastRunStartTimestamp()Returns the time when the task last run was started (or null if the task was never started). This is set only for asynchronously executing tasks. And it is set also for the current execution.
- 
getLastRunFinishTimestampLong getLastRunFinishTimestamp()Returns the time when the task last run was finished (or null if the task was not finished yet). This is set only for asynchronously executing tasks.
- 
getNextRunStartTimeReturns the time when the task should start again. This is transient property, present only if explicitly requested.
- 
getCompletionTimestampLong getCompletionTimestamp()Returns the completion timestamp - time when the task was closed (or null if it is not closed).
- 
getBindingTaskBindingType getBinding()Returns task binding.
- 
isLooselyBounddefault boolean isLooselyBound()Returns true if the task is loosely bound.
- 
isTightlyBounddefault boolean isTightlyBound()Returns true if the task is tightly bound.
- 
getHandlerUriString getHandlerUri()Returns handler URI. It indirectly specifies which class is responsible to handle the task. The handler will execute reaction to a task lifecycle events such as executing the task, task heartbeat, etc.
- 
setHandlerUriSets handler URI.
- 
addArchetypeInformationAdds an archetype for the task. Assumes that the task will NOT undergo full model processing, so this method will do everything by itself: creates an assignment, roleMembershipRef and archetypeRef. Throws an exception if an archetype is already assigned. This is temporary/experimental implementation. It was not tested for persistent tasks (although it should work also for them).
- 
addArchetypeInformationIfMissingAsaddArchetypeInformation(String)but executed only if there's no archetype currently set.
- 
getExtensionOrClonePrismContainer<? extends ExtensionType> getExtensionOrClone()Returns task extension. The extension is a part of task that can store arbitrary data. It usually holds data specific to a task type, internal task state, business state or similar data that are out of scope of this interface definition. To maintain thread safety, for RunningTask this method returns extension clone. (So don't use the return value to modify the task extension if not sure whether the task is running.)
- 
getOrCreateExtension@NotNull @NotNull PrismContainer<? extends ExtensionType> getOrCreateExtension() throws SchemaExceptionGets or creates an extension. Just likePrismObject.getOrCreateExtension(). Cloned if the task is running.- Throws:
- SchemaException
 
- 
getExtensionClonePrismContainer<? extends ExtensionType> getExtensionClone()Gets extension clone, or null if there is no extension.
- 
getExtensionPropertyOrCloneReturns specified property from the extension; or null if extension or property does not exist. Cloned if task is running.
- 
getExtensionPropertyRealValueReturns specified single-valued property real value from the extension (null if extension or property does not exist).
- 
getPropertyRealValue
- 
getPropertyRealValueOrClone
- 
getItemRealValueOrClone
- 
getReferenceRealValueTODO what about thread safety?
- 
getReferenceRealValuesTODO what about thread safety?
- 
getExtensionContainerRealValueOrCloneReturns specified single-valued container real value from the extension To ensure thread safety, in the case of running tasks the returned value is a clone of the live one. Returns null if extension or container does not exist.
- 
getExtensionReferenceOrCloneReturns specified reference from the extension. Cloned if running task. Null if extension or reference does not exist.
- 
getExtensionItemOrClone<IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> getExtensionItemOrClone(ItemName itemName) Returns specified item (property, reference or container) from the extension. Cloned if running task. Null if extension or item does not exist.
- 
setExtensionPropertySets a property in the extension - replaces existing value(s), if any, by the one(s) provided.- Throws:
- SchemaException
 
- 
setExtensionPropertyImmediatevoid setExtensionPropertyImmediate(PrismProperty<?> property, OperationResult result) throws ObjectNotFoundException, SchemaException "Immediate" version of the above method.
- 
setExtensionPropertyValueSets (i.e., replaces) the value of the given property in task extension.- Parameters:
- propertyName- name of the property
- value- value of the property
- Throws:
- SchemaException
 
- 
setPropertyRealValue- Throws:
- SchemaException
 
- 
setItemRealValues- Throws:
- SchemaException
 
- 
setItemRealValuesCollectiondefault void setItemRealValuesCollection(ItemPath path, Collection<?> values) throws SchemaException - Throws:
- SchemaException
 
- 
setExtensionReferenceSets a reference in the extension - replaces existing value(s), if any, by the one(s) provided.- Throws:
- SchemaException
 
- 
setExtensionContainerSets a container in the extension - replaces existing value(s), if any, by the one(s) provided.- Parameters:
- item- Container with value(s) to be put into task extension.
- Throws:
- SchemaException
 
- 
setExtensionContainerValue<T extends Containerable> void setExtensionContainerValue(QName containerName, T value) throws SchemaException Sets a container value in the extension - replaces existing value(s), if any, by the one provided.- Parameters:
- containerName- name of the container
- value- value to be put into extension
- Throws:
- SchemaException
 
- 
setExtensionItemPuts generic item into extension.- Throws:
- SchemaException
 
- 
addExtensionPropertyAdds value(s) to a given extension property.- Parameters:
- property- holder of the value(s) to be added into task extension property
- Throws:
- SchemaException
 
- 
addExtensionReferenceAdds value(s) to a given extension reference.- Parameters:
- reference- holder of the value(s) to be added into task extension reference
- Throws:
- SchemaException
 
- 
deleteExtensionPropertyRemoves specified VALUES of this extension property (not all of its values).- Throws:
- SchemaException
 
- 
getObject<T extends ObjectType> PrismObject<T> getObject(Class<T> type, OperationResult result) throws ObjectNotFoundException, SchemaException Returns object that the task is associated with. Tasks may be associated with a particular objects. For example a "import from resource" task is associated with the resource definition object that it imports from. Similarly for synchronization and reconciliation tasks (cycles). User approval and modification task may be associated with that user. If the task contains a reference without full object, the object is fetched from the repository. (Authorizations are *not* checked.)
- 
getObjectRefOrCloneObjectReferenceType getObjectRefOrClone()Returns reference to the object that the task is associated with. Tasks may be associated with a particular objects. For example a "import from resource" task is associated with the resource definition object that it imports from. Similarly for synchronization and reconciliation tasks (cycles). This is an optional property.
- 
getObjectOidString getObjectOid()Returns OID of the object that the task is associated with. Convenience method. This will get the OID from the objectRef.
- 
setObjectRefSets the object reference.
- 
setObjectRefSets the object reference.
- 
getResultOperationResult getResult()Returns a top-level OperationResult stored in the task. Beware of thread safety. This is a live object!
- 
getResultStatusOperationResultStatusType getResultStatus()Returns the status of top-level OperationResult stored in the task. If "live" operation result is present, the status it taken from it. Otherwise, resultStatus from task prism is fetched. TODO reconsider this method
- 
setResultSets the top-level OperationResult stored in the task. Use with care!
- 
applyDeltasImmediatevoid applyDeltasImmediate(Collection<ItemDelta<?, ?>> itemDeltas, OperationResult result) throws ObjectAlreadyExistsException, ObjectNotFoundException, SchemaException
- 
applyModificationsTransient- Throws:
- SchemaException
 
- 
getLegacyProgresslong getLegacyProgress()Returns task progress, as reported by task handler.
- 
setLegacyProgressRecords _legacy_ progress of the task, storing it persistently if needed.
- 
incrementLegacyProgressTransientvoid incrementLegacyProgressTransient()Increments legacy progress without creating a pending modification.
- 
setLegacyProgressImmediatevoid setLegacyProgressImmediate(Long progress, OperationResult parentResult) throws ObjectNotFoundException, SchemaException "Immediate" version ofsetLegacyProgress(Long). BEWARE: this method can take quite a long time to execute, if invoked in a cycle.
- 
getStoredOperationStatsOrCloneOperationStatsType getStoredOperationStatsOrClone()Returns operation statistics from the task prism object (i.e. not the live ones). Clones if running task.
- 
getAggregatedLiveOperationStatsOperationStatsType getAggregatedLiveOperationStats()Gets information from the current task and - for running task - its transient subtasks (aka worker threads). Clients beware: Update thread-local statistics before! They are not updated inside this method.
- 
getExpectedTotalReturns expected total progress.
- 
setExpectedTotalStores expected total progress of the task, storing it persistently if needed.
- 
createSubtaskTask createSubtask()Creates a transient subtask. Owner is inherited from parent task to subtask.
- 
getParentString getParent()Returns the identifier of the task's parent (or null of there is no parent task).
- 
getParentTaskReturns the parent task, if any.
- 
listSubtasks@NotNull default @NotNull List<? extends Task> listSubtasks(OperationResult parentResult) throws SchemaException Lists the (direct) subtasks of a given task.- Throws:
- SchemaException
 
- 
listSubtasks@NotNull @NotNull List<? extends Task> listSubtasks(boolean persistentOnly, OperationResult parentResult) throws SchemaException - Throws:
- SchemaException
 
- 
listSubtasksDeeplyList all the subtasks of a given task, i.e. whole task tree rooted at the current task. Current task is not contained in the returned list.- Throws:
- SchemaException
 
- 
listSubtasksDeeplyList<? extends Task> listSubtasksDeeply(boolean persistentOnly, OperationResult result) throws SchemaException Lists all tasks in subtasks tree.- Parameters:
- persistentOnly- If true, transient subtasks (i.e. lightweight asynchronous tasks) are ignored.
- Throws:
- SchemaException
 
- 
listDependentsLists all explicit dependents, i.e. tasks that wait for the completion of this tasks (that depend on it). Implicit dependents, i.e. task's parent, grandparent, etc are NOT listed here.
- 
getDependentsLists all explicit dependents' identifiers.
- 
addDependentAdd a task as this task's dependent, i.e. the task denoted by taskIdentifier DEPENDS ON (waits for completion of) this task.
- 
listPrerequisiteTasksList all prerequisite tasks for the current tasks, i.e. tasks that must complete before this one can proceed. If A is on the list of prerequisites of B (THIS), it means that B is on list of dependents of A (i.e. B waits for A to complete). Again, implicit prerequisites (children) are not listed here.- Throws:
- SchemaException
 
- 
getRawTaskObjectClonedIfNecessaryReturns backing task prism object without updating with current operation result. If the task is running, a clone is returned.
- 
getRawTaskObjectCloneReturns CLONE of backing task prism object without updating with current operation result.
- 
getUpdatedTaskObjectReturns backing task prism object UPDATED with current operation result. Assumes that task is not running. (Otherwise IllegalStateException is thrown.)
- 
getSelfReferenceReturns a reference to the task prism. Precondition: Task must be persistent.
- 
getSelfReferenceFullReturns a full (object-bearing) reference to the task prism. Precondition: Task must be persistent.
- 
getVersionString getVersion()Returns the version of underlying prism object.
- 
refreshRe-reads the task state from the persistent storage. The task state may be synchronized with the repository all the time. But the specified timing is implementation-specific. Call to this method will make sure that the task contains fresh data. This has no effect on transient tasks.
- 
modifyChanges in-memory representation immediately and schedules a corresponding batched modification.- Throws:
- SchemaException
 
- 
modifyApplies given collection of deltas.- Throws:
- SchemaException
 
- 
flushPendingModificationsvoid flushPendingModifications(OperationResult parentResult) throws ObjectNotFoundException, SchemaException, ObjectAlreadyExistsException Saves modifications done against the in-memory version of the task into the repository.
- 
getContainerableOrCloneTODO
- 
doesItemExistTODO
- 
getActivityStateOrCloneTODO
- 
getActivityStateOrClone@Nullable default @Nullable ActivityStateType getActivityStateOrClone(@NotNull @NotNull ActivityPath activityPath) Returns the activity state for given activity path. Assumes local execution!
- 
getRootActivityCompletionTimestampReturns the completion timestamp of the root activity. Assumes being executed on the root task.
- 
getRootActivityDefinitionOrCloneRetrieves the definition of the [root] activity.
- 
setRootActivityDefinitiondefault void setRootActivityDefinition(ActivityDefinitionType activityDefinition) throws SchemaException - Throws:
- SchemaException
 
- 
getWorkStateTaskActivityStateType getWorkState()Gets task work state. NOT THREAD SAFE! TODO throw exception for RunningTask. (After revising of all uses.)
- 
getActivitiesStateOrCloneTaskActivityStateType getActivitiesStateOrClone()Gets task work state or its clone (for running tasks). TODO better name
- 
getActivityTreeStateOverviewOrClone
- 
getParentAndRoot@NotNull @NotNull ParentAndRoot getParentAndRoot(OperationResult result) throws SchemaException, ObjectNotFoundException Looks for OID of the parent and the root of the task tree for this task. PRE: task is either persistent or is aRunningTask.
- 
getRoot@NotNull default @NotNull Task getRoot(OperationResult result) throws SchemaException, ObjectNotFoundException Returns the root of the task tree for this task. PRE: task is either persistent or is aRunningTask.
- 
getPathToRootTaskReturns the path from this task to the task tree root. (Starts with this task, ends with the root.)- Throws:
- SchemaException
 
- 
getTracingRequestedForGet points for which the tracing is requested (within this task).
- 
addTracingRequestRequests (future) tracing for given tracing point - for this task.
- 
removeTracingRequestsRemoves all tracing requests for this task.
- 
getTracingProfileReturns (reference to tracing profile) that was defined for the tracing started by this task. NOT THREAD SAFE!
- 
setTracingProfileSets the profile to be used for future tracing within this task.
- 
registerConnIdOperationsListener@Experimental void registerConnIdOperationsListener(@NotNull @NotNull ConnIdOperationsListener listener) Registers aConnIdOperationsListener.
- 
unregisterConnIdOperationsListener@Experimental void unregisterConnIdOperationsListener(@NotNull @NotNull ConnIdOperationsListener listener) Unregisters aConnIdOperationsListener.
- 
getChannelString getChannel()Returns channel URI associated with this task.
- 
setChannelSets channel URI.
- 
getRequesteePrismObject<UserType> getRequestee()Gets the requestee OID - typically an identification of account owner (for notifications). Serves for communication between model and provisioning. It is a temporary feature - will be removed in midPoint 2.3.
- 
setRequesteeTransient
- 
getExecutionEnvironmentTaskExecutionEnvironmentType getExecutionEnvironment()Gets the execution environment configuration. Cloned if running task.
- 
getCachingProfilesReturns an immutable collection of caching profiles. (From execution environment.)
- 
setExecutionEnvironmentSets the execution environment configuration.
- 
hasAssignmentsboolean hasAssignments()Returns true if the task has any assignments.
- 
getCleanupAfterCompletionDuration getCleanupAfterCompletion()
- 
setCleanupAfterCompletion
- 
isRootdefault boolean isRoot()
- 
getExecutionSupport
- 
isIndestructibledefault boolean isIndestructible()
- 
getExecutionModeReturns the execution mode of this task.
- 
isExecutionFullyPersistentdefault boolean isExecutionFullyPersistent()
- 
areShadowChangesSimulateddefault boolean areShadowChangesSimulated()
- 
isProductionConfigurationdefault boolean isProductionConfiguration()
- 
canSeeJust a convenience method.
- 
canSeeJust a convenience method.
- 
canSeeJust a convenience method.
- 
setExecutionModeSets the execution mode of this task. Use with care - preferably only for new tasks. Returns the original value.
- 
assertPersistentExecution
- 
setSimulationTransactionSets the current simulation transaction object.
- 
getSimulationTransactionReturns the current simulation transaction, if there is any.
 
-