Class NullTaskImpl
java.lang.Object
com.evolveum.midpoint.task.api.test.NullTaskImpl
- All Implemented Interfaces:
MappingStatisticsCollector
,NotificationStatisticsCollector
,StatisticsCollector
,TaskActionsExecutedCollector
,TaskIterativeOperationCollector
,TaskSynchronizationStatisticsCollector
,ConnIdOperationsListener
,Task
,DebugDumpable
DO NOT USE in production code. This is only for testing purposes: provides a no-op implementation of Task interface
to be used when task-quartz-impl is not available.
TODO move to src/main/test tree.
- Author:
- lazyman
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
Fields inherited from interface com.evolveum.midpoint.task.api.Task
DOT_INTERFACE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addArchetypeInformation
(@NotNull String archetypeOid) Adds an archetype for the task.void
addArchetypeInformationIfMissing
(@NotNull String archetypeOid) AsTask.addArchetypeInformation(String)
but executed only if there's no archetype currently set.void
addDependent
(String taskIdentifier) Add a task as this task's dependent, i.e.void
addExtensionProperty
(PrismProperty<?> property) Adds value(s) to a given extension property.void
addExtensionReference
(PrismReference reference) Adds value(s) to a given extension reference.void
addTracingRequest
(TracingRootType point) Requests (future) tracing for given tracing point - for this task.void
applyDeltasImmediate
(Collection<ItemDelta<?, ?>> itemDeltas, OperationResult result) void
applyModificationsTransient
(Collection<ItemDelta<?, ?>> modifications) Creates a transient subtask.Show the content of the object intended for diagnostics by system administrator.debugDump
(int indent) void
deleteExtensionProperty
(PrismProperty<?> property) Removes specified VALUES of this extension property (not all of its values).boolean
doesItemExist
(ItemPath path) TODOvoid
flushPendingModifications
(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).TODOGets 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 TaskExecutionMode
Returns the execution mode of this task.Returns high-level execution state.Returns 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 propertyName) 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.Returns specified reference from the extension.getGroup()
Gets the execution group name (i.e.@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> T
getItemRealValueOrClone
(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).long
Returns 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 ParentAndRoot
getParentAndRoot
(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 TaskPersistenceStatus
Returns task persistence status.<T> T
getPropertyRealValue
(ItemPath path, Class<T> expectedType) <T> T
getPropertyRealValueOrClone
(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 TaskRecurrenceType
Returns 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.Returns the schedule.Returns the schedule interval.Returns low-level scheduling state.@NotNull ObjectReferenceType
Returns a reference to the task prism.@NotNull ObjectReferenceType
Returns a full (object-bearing) reference to the task prism.@Nullable SimulationTransaction
Returns the current simulation transaction, if there is any.Returns operation statistics from the task prism object (i.e.Returns task (lightweight) identifier.Returns thread stop action (what happens when the task thread is stopped e.g.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.boolean
Returns true if the task has any assignments.boolean
Returns true if the schedule interval is set.void
Increments legacy progress without creating a pending modification.boolean
Returns true if the task is asynchronous.boolean
Returns true if task is persistent (i.e.boolean
Returns true if task is transient (i.e.listDependents
(OperationResult result) Lists all explicit dependents, i.e.listPrerequisiteTasks
(OperationResult parentResult) List all prerequisite tasks for the current tasks, i.e.listSubtasks
(boolean persistentOnly, OperationResult parentResult) listSubtasksDeeply
(boolean persistentOnly, OperationResult result) Lists all tasks in subtasks tree.listSubtasksDeeply
(OperationResult result) List all the subtasks of a given task, i.e.void
Changes in-memory representation immediately and schedules a corresponding batched modification.void
onSynchronizationExclusion
(@Nullable String processingIdentifier, @NotNull SynchronizationExclusionReasonType exclusionReason) Informs the task that no synchronization will take place.void
onSynchronizationSituationChange
(@Nullable String processingIdentifier, String shadowOid, @Nullable SynchronizationSituationType situation) Informs the task that sync situation has changed for given shadow OID.void
onSynchronizationStart
(@Nullable String processingIdentifier, @Nullable String shadowOid, @Nullable SynchronizationSituationType situation) Called when a situation was determined right before a synchronization takes place.@NotNull Operation
recordIterativeOperationStart
(@NotNull IterativeOperationStartInfo info) Records the start of iterative operation.void
recordMappingOperation
(String objectOid, String objectName, String objectTypeName, String mappingName, long duration) void
recordNotificationOperation
(String transportName, boolean success, long duration) void
recordObjectActionExecuted
(PrismObject<? extends ObjectType> object, ChangeType changeType, Throwable exception) Logs under default channel known to the current task.<T extends ObjectType>
voidrecordObjectActionExecuted
(PrismObject<T> objectOld, Class<T> objectTypeClass, String oid, ChangeType delete, String channel, Throwable o) void
recordObjectActionExecuted
(String objectName, String objectDisplayName, QName objectType, String objectOid, ChangeType changeType, String channel, Throwable exception) void
recordStateMessage
(String message) Records a state message.void
refresh
(OperationResult result) Re-reads the task state from the persistent storage.void
registerConnIdOperationsListener
(@NotNull ConnIdOperationsListener listener) Registers aConnIdOperationsListener
.void
Removes all tracing requests for this task.void
setChannel
(String channelUri) Sets channel URI.void
setCleanupAfterCompletion
(Duration duration) void
setDescription
(String value) Sets task description.void
setDescriptionImmediate
(String value, OperationResult result) Sets task description, immediately storing it into the repo.void
Sets task execution constraints.void
Sets the execution environment configuration.@NotNull TaskExecutionMode
setExecutionMode
(@NotNull TaskExecutionMode mode) Sets the execution mode of this task.void
setExpectedTotal
(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.void
setExtensionItem
(Item<?, ?> item) Puts generic item into extension.void
setExtensionProperty
(PrismProperty<?> property) Sets a property in the extension - replaces existing value(s), if any, by the one(s) provided.void
setExtensionPropertyImmediate
(PrismProperty<?> property, OperationResult result) "Immediate" version of the above method.void
setExtensionReference
(PrismReference reference) Sets a reference in the extension - replaces existing value(s), if any, by the one(s) provided.void
setHandlerUri
(String value) Sets handler URI.void
setInitialExecutionAndScheduledState
(TaskExecutionStateType executionState, TaskSchedulingStateType schedulingState) Sets initial task execution and scheduled state.void
Sets the initial task execution and scheduling state to make task waiting (for prerequisite tasks).void
setLegacyProgress
(Long value) Records _legacy_ progress of the task, storing it persistently if needed.void
setLegacyProgressImmediate
(Long progress, OperationResult parentResult) "Immediate" version ofTask.setLegacyProgress(Long)
.void
setName
(PolyStringType value) Sets the human-readable name of the task.void
Sets the human-readable name of the task.void
setNameImmediate
(PolyStringType value, OperationResult parentResult) Sets the human-readable name of the task, immediately into repository.void
setObjectRef
(ObjectReferenceType objectRef) Sets the object reference.void
setObjectRef
(String oid, QName type) Sets the object reference.void
setOwner
(PrismObject<? extends FocusType> owner) Sets the task owner.void
setOwnerRef
(ObjectReferenceType ownerRef) Sets the task owner reference.<T> void
setPropertyRealValue
(ItemPath path, T value) void
void
setResult
(OperationResult result) Sets the top-level OperationResult stored in the task.void
setSchedule
(ScheduleType schedule) Sets the schedule for the task.Sets the current simulation transaction object.void
Sets the thread stop action for this task.void
setTracingProfile
(TracingProfileType tracingProfile) Sets the profile to be used for future tracing within this task.void
void
Starts collecting synchronization statistics within the task.void
void
stopCollectingSynchronizationStatistics
(@NotNull QualifiedItemProcessingOutcomeType outcome) void
unregisterConnIdOperationsListener
(@NotNull ConnIdOperationsListener listener) Unregisters aConnIdOperationsListener
.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.ConnIdOperationsListener
onConnIdOperationEnd, onConnIdOperationResume, onConnIdOperationStart, onConnIdOperationSuspend
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.task.api.Task
areShadowChangesSimulated, assertPersistentExecution, canSee, canSee, canSee, getActivityStateOrClone, getActivityTreeStateOverviewOrClone, getExecutionSupport, getExtensionPropertyRealValue, getRoot, getRootActivityCompletionTimestamp, getRootActivityDefinitionOrClone, isClosed, isExecutionFullyPersistent, isIndestructible, isLooselyBound, isProductionConfiguration, isReady, isRecurring, isRoot, isRunnable, isRunning, isSingle, isSuspended, isTightlyBound, isWaiting, listSubtasks, makeSingle, modify, setExtensionPropertyValue, setInitiallyRunnable, setInitiallySuspended, setItemRealValues, setItemRealValuesCollection, setRootActivityDefinition
Methods inherited from interface com.evolveum.midpoint.schema.statistics.TaskIterativeOperationCollector
recordIterativeOperationStart, recordIterativeOperationStart
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
NullTaskImpl
public NullTaskImpl()
-
-
Method Details
-
addDependent
Description copied from interface:Task
Add a task as this task's dependent, i.e. the task denoted by taskIdentifier DEPENDS ON (waits for completion of) this task.- Specified by:
addDependent
in interfaceTask
-
isAsynchronous
public boolean isAsynchronous()Description copied from interface:Task
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.- Specified by:
isAsynchronous
in interfaceTask
- Returns:
- true if the task is asynchronous.
-
getExecutionState
Description copied from interface:Task
Returns high-level execution state.- Specified by:
getExecutionState
in interfaceTask
-
getSchedulingState
Description copied from interface:Task
Returns low-level scheduling state.- Specified by:
getSchedulingState
in interfaceTask
-
setInitialExecutionAndScheduledState
public void setInitialExecutionAndScheduledState(TaskExecutionStateType executionState, TaskSchedulingStateType schedulingState) Description copied from interface:Task
Sets initial task execution and scheduled state. It will be used when the task is made persistent. Precondition: Task is transient.- Specified by:
setInitialExecutionAndScheduledState
in interfaceTask
-
setInitiallyWaitingForPrerequisites
public void setInitiallyWaitingForPrerequisites()Description copied from interface:Task
Sets the initial task execution and scheduling state to make task waiting (for prerequisite tasks).- Specified by:
setInitiallyWaitingForPrerequisites
in interfaceTask
-
getPersistenceStatus
Description copied from interface:Task
Returns task persistence status.- Specified by:
getPersistenceStatus
in interfaceTask
-
isTransient
public boolean isTransient()Description copied from interface:Task
Returns true if task is transient (i.e. not stored in repository).- Specified by:
isTransient
in interfaceTask
-
isPersistent
public boolean isPersistent()Description copied from interface:Task
Returns true if task is persistent (i.e. stored in repository).- Specified by:
isPersistent
in interfaceTask
-
getRecurrence
Description copied from interface:Task
Returns task recurrence status.- Specified by:
getRecurrence
in interfaceTask
-
setSchedule
Description copied from interface:Task
Sets the schedule for the task. Removes also the legacy recurrence flag.- Specified by:
setSchedule
in interfaceTask
-
getSchedule
Description copied from interface:Task
Returns the schedule.- Specified by:
getSchedule
in interfaceTask
-
getScheduleInterval
Description copied from interface:Task
Returns the schedule interval.- Specified by:
getScheduleInterval
in interfaceTask
-
hasScheduleInterval
public boolean hasScheduleInterval()Description copied from interface:Task
Returns true if the schedule interval is set.- Specified by:
hasScheduleInterval
in interfaceTask
-
getBinding
Description copied from interface:Task
Returns task binding.- Specified by:
getBinding
in interfaceTask
-
getHandlerUri
Description copied from interface:Task
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.- Specified by:
getHandlerUri
in interfaceTask
-
setHandlerUri
Description copied from interface:Task
Sets handler URI.- Specified by:
setHandlerUri
in interfaceTask
-
getTaskIdentifier
Description copied from interface:Task
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.- Specified by:
getTaskIdentifier
in interfaceTask
-
getOwner
Description copied from interface:Task
Returns 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. -
setOwner
Description copied from interface:Task
Sets the task owner. Precondition: Task is transient. -
setOwnerRef
Description copied from interface:Task
Sets the task owner reference. Precondition: Task is transient.- Specified by:
setOwnerRef
in interfaceTask
-
getChannel
Description copied from interface:Task
Returns channel URI associated with this task.- Specified by:
getChannel
in interfaceTask
-
setChannel
Description copied from interface:Task
Sets channel URI.- Specified by:
setChannel
in interfaceTask
-
getRequestee
Description copied from interface:Task
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.- Specified by:
getRequestee
in interfaceTask
-
setRequesteeTransient
- Specified by:
setRequesteeTransient
in interfaceTask
-
getOid
Description copied from interface:Task
Returns task OID. Only persistent tasks have OID. So this method returns null if the task is not persistent. -
getObject
Description copied from interface:Task
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.) -
getObjectRefOrClone
Description copied from interface:Task
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.- Specified by:
getObjectRefOrClone
in interfaceTask
-
setObjectRef
Description copied from interface:Task
Sets the object reference.- Specified by:
setObjectRef
in interfaceTask
-
setObjectRef
Description copied from interface:Task
Sets the object reference.- Specified by:
setObjectRef
in interfaceTask
-
getObjectOid
Description copied from interface:Task
Returns OID of the object that the task is associated with. Convenience method. This will get the OID from the objectRef.- Specified by:
getObjectOid
in interfaceTask
-
getResult
Description copied from interface:Task
Returns a top-level OperationResult stored in the task. Beware of thread safety. This is a live object! -
setResult
Description copied from interface:Task
Sets the top-level OperationResult stored in the task. Use with care! -
getLastRunStartTimestamp
Description copied from interface:Task
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.- Specified by:
getLastRunStartTimestamp
in interfaceTask
-
getLastRunFinishTimestamp
Description copied from interface:Task
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.- Specified by:
getLastRunFinishTimestamp
in interfaceTask
-
getNextRunStartTime
Description copied from interface:Task
Returns the time when the task should start again. This is transient property, present only if explicitly requested.- Specified by:
getNextRunStartTime
in interfaceTask
-
getName
Description copied from interface:Task
Returns human-readable name of the task. -
setName
Description copied from interface:Task
Sets the human-readable name of the task. -
setName
Description copied from interface:Task
Sets the human-readable name of the task. -
setNameImmediate
Description copied from interface:Task
Sets the human-readable name of the task, immediately into repository.- Specified by:
setNameImmediate
in interfaceTask
-
getExtensionItemOrClone
public <IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> getExtensionItemOrClone(ItemName propertyName) Description copied from interface:Task
Returns specified item (property, reference or container) from the extension. Cloned if running task. Null if extension or item does not exist.- Specified by:
getExtensionItemOrClone
in interfaceTask
-
setExtensionContainer
Description copied from interface:Task
Sets a container in the extension - replaces existing value(s), if any, by the one(s) provided.- Specified by:
setExtensionContainer
in interfaceTask
- Parameters:
item
- Container with value(s) to be put into task extension.
-
setExtensionReference
Description copied from interface:Task
Sets a reference in the extension - replaces existing value(s), if any, by the one(s) provided.- Specified by:
setExtensionReference
in interfaceTask
-
setExtensionProperty
Description copied from interface:Task
Sets a property in the extension - replaces existing value(s), if any, by the one(s) provided.- Specified by:
setExtensionProperty
in interfaceTask
-
setExtensionPropertyImmediate
Description copied from interface:Task
"Immediate" version of the above method.- Specified by:
setExtensionPropertyImmediate
in interfaceTask
-
addExtensionProperty
Description copied from interface:Task
Adds value(s) to a given extension property.- Specified by:
addExtensionProperty
in interfaceTask
- Parameters:
property
- holder of the value(s) to be added into task extension property
-
setPropertyRealValue
- Specified by:
setPropertyRealValue
in interfaceTask
-
setExtensionContainerValue
Description copied from interface:Task
Sets a container value in the extension - replaces existing value(s), if any, by the one provided.- Specified by:
setExtensionContainerValue
in interfaceTask
- Parameters:
containerName
- name of the containervalue
- value to be put into extension
-
setExtensionItem
Description copied from interface:Task
Puts generic item into extension.- Specified by:
setExtensionItem
in interfaceTask
-
getLegacyProgress
public long getLegacyProgress()Description copied from interface:Task
Returns task progress, as reported by task handler.- Specified by:
getLegacyProgress
in interfaceTask
-
setLegacyProgress
Description copied from interface:Task
Records _legacy_ progress of the task, storing it persistently if needed.- Specified by:
setLegacyProgress
in interfaceTask
-
incrementLegacyProgressTransient
public void incrementLegacyProgressTransient()Description copied from interface:Task
Increments legacy progress without creating a pending modification.- Specified by:
incrementLegacyProgressTransient
in interfaceTask
-
setLegacyProgressImmediate
Description copied from interface:Task
"Immediate" version ofTask.setLegacyProgress(Long)
. BEWARE: this method can take quite a long time to execute, if invoked in a cycle.- Specified by:
setLegacyProgressImmediate
in interfaceTask
-
getUpdatedTaskObject
Description copied from interface:Task
Returns backing task prism object UPDATED with current operation result. Assumes that task is not running. (Otherwise IllegalStateException is thrown.)- Specified by:
getUpdatedTaskObject
in interfaceTask
-
getRawTaskObjectClone
Description copied from interface:Task
Returns CLONE of backing task prism object without updating with current operation result.- Specified by:
getRawTaskObjectClone
in interfaceTask
-
refresh
Description copied from interface:Task
Re-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. -
debugDump
Description copied from interface:DebugDumpable
Show the content of the object intended for diagnostics by system administrator. The out put should be suitable to use in system logs at "debug" level. It may be multi-line, but in that case it should be well indented and quite terse. As it is intended to be used by system administrator, it should not use any developer terms such as class names, exceptions or stack traces.- Specified by:
debugDump
in interfaceDebugDumpable
- Returns:
- content of the object intended for diagnostics by system administrator.
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
flushPendingModifications
Description copied from interface:Task
Saves modifications done against the in-memory version of the task into the repository.- Specified by:
flushPendingModifications
in interfaceTask
-
getNode
Description copied from interface:Task
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. -
getNodeAsObserved
Description copied from interface:Task
Returns the node as really observed. This is a transient information that has to be requested explicitly.- Specified by:
getNodeAsObserved
in interfaceTask
-
getResultStatus
Description copied from interface:Task
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- Specified by:
getResultStatus
in interfaceTask
-
getThreadStopAction
Description copied from interface:Task
Returns thread stop action (what happens when the task thread is stopped e.g. because of node going down).- Specified by:
getThreadStopAction
in interfaceTask
-
addArchetypeInformation
Description copied from interface:Task
Adds 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).- Specified by:
addArchetypeInformation
in interfaceTask
-
addArchetypeInformationIfMissing
Description copied from interface:Task
AsTask.addArchetypeInformation(String)
but executed only if there's no archetype currently set.- Specified by:
addArchetypeInformationIfMissing
in interfaceTask
-
getExtensionOrClone
Description copied from interface:Task
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.)- Specified by:
getExtensionOrClone
in interfaceTask
-
getOrCreateExtension
Description copied from interface:Task
Gets or creates an extension. Just likePrismObject.getOrCreateExtension()
. Cloned if the task is running.- Specified by:
getOrCreateExtension
in interfaceTask
-
getExtensionClone
Description copied from interface:Task
Gets extension clone, or null if there is no extension.- Specified by:
getExtensionClone
in interfaceTask
-
getExtensionPropertyOrClone
Description copied from interface:Task
Returns specified property from the extension; or null if extension or property does not exist. Cloned if task is running.- Specified by:
getExtensionPropertyOrClone
in interfaceTask
-
getPropertyRealValue
- Specified by:
getPropertyRealValue
in interfaceTask
-
getPropertyRealValueOrClone
- Specified by:
getPropertyRealValueOrClone
in interfaceTask
-
getItemRealValueOrClone
- Specified by:
getItemRealValueOrClone
in interfaceTask
-
getReferenceRealValue
Description copied from interface:Task
TODO what about thread safety?- Specified by:
getReferenceRealValue
in interfaceTask
-
getReferenceRealValues
Description copied from interface:Task
TODO what about thread safety?- Specified by:
getReferenceRealValues
in interfaceTask
-
getExtensionContainerRealValueOrClone
Description copied from interface:Task
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. Returns null if extension or container does not exist.- Specified by:
getExtensionContainerRealValueOrClone
in interfaceTask
-
getExtensionReferenceOrClone
Description copied from interface:Task
Returns specified reference from the extension. Cloned if running task. Null if extension or reference does not exist.- Specified by:
getExtensionReferenceOrClone
in interfaceTask
-
setDescriptionImmediate
Description copied from interface:Task
Sets task description, immediately storing it into the repo.- Specified by:
setDescriptionImmediate
in interfaceTask
-
setDescription
Description copied from interface:Task
Sets task description.- Specified by:
setDescription
in interfaceTask
-
getDescription
Description copied from interface:Task
Returns task description.- Specified by:
getDescription
in interfaceTask
-
deleteExtensionProperty
Description copied from interface:Task
Removes specified VALUES of this extension property (not all of its values).- Specified by:
deleteExtensionProperty
in interfaceTask
-
setThreadStopAction
Description copied from interface:Task
Sets the thread stop action for this task.- Specified by:
setThreadStopAction
in interfaceTask
-
createSubtask
Description copied from interface:Task
Creates a transient subtask. Owner is inherited from parent task to subtask.- Specified by:
createSubtask
in interfaceTask
-
getParent
Description copied from interface:Task
Returns the identifier of the task's parent (or null of there is no parent task). -
listSubtasks
@NotNull public @NotNull List<Task> listSubtasks(boolean persistentOnly, OperationResult parentResult) - Specified by:
listSubtasks
in interfaceTask
-
listSubtasksDeeply
Description copied from interface:Task
List 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.- Specified by:
listSubtasksDeeply
in interfaceTask
-
listPrerequisiteTasks
Description copied from interface:Task
List 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.- Specified by:
listPrerequisiteTasks
in interfaceTask
-
getRawTaskObjectClonedIfNecessary
Description copied from interface:Task
Returns backing task prism object without updating with current operation result. If the task is running, a clone is returned.- Specified by:
getRawTaskObjectClonedIfNecessary
in interfaceTask
-
getDependents
Description copied from interface:Task
Lists all explicit dependents' identifiers.- Specified by:
getDependents
in interfaceTask
-
listDependents
Description copied from interface:Task
Lists 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.- Specified by:
listDependents
in interfaceTask
-
getParentTask
Description copied from interface:Task
Returns the parent task, if any.- Specified by:
getParentTask
in interfaceTask
-
getWaitingReason
Description copied from interface:Task
Returns the task waiting reason for a WAITING task.- Specified by:
getWaitingReason
in interfaceTask
-
getCompletionTimestamp
Description copied from interface:Task
Returns the completion timestamp - time when the task was closed (or null if it is not closed).- Specified by:
getCompletionTimestamp
in interfaceTask
-
addExtensionReference
Description copied from interface:Task
Adds value(s) to a given extension reference.- Specified by:
addExtensionReference
in interfaceTask
- Parameters:
reference
- holder of the value(s) to be added into task extension reference
-
listSubtasksDeeply
Description copied from interface:Task
Lists all tasks in subtasks tree.- Specified by:
listSubtasksDeeply
in interfaceTask
- Parameters:
persistentOnly
- If true, transient subtasks (i.e. lightweight asynchronous tasks) are ignored.
-
getExecutionMode
Description copied from interface:Task
Returns the execution mode of this task.- Specified by:
getExecutionMode
in interfaceTask
-
setExecutionMode
@NotNull public @NotNull TaskExecutionMode setExecutionMode(@NotNull @NotNull TaskExecutionMode mode) Description copied from interface:Task
Sets the execution mode of this task. Use with care - preferably only for new tasks. Returns the original value.- Specified by:
setExecutionMode
in interfaceTask
-
getExpectedTotal
Description copied from interface:Task
Returns expected total progress.- Specified by:
getExpectedTotal
in interfaceTask
-
setExpectedTotal
Description copied from interface:Task
Stores expected total progress of the task, storing it persistently if needed.- Specified by:
setExpectedTotal
in interfaceTask
-
recordStateMessage
Description copied from interface:StatisticsCollector
Records a state message.- Specified by:
recordStateMessage
in interfaceStatisticsCollector
-
recordNotificationOperation
- Specified by:
recordNotificationOperation
in interfaceNotificationStatisticsCollector
-
recordMappingOperation
public void recordMappingOperation(String objectOid, String objectName, String objectTypeName, String mappingName, long duration) - Specified by:
recordMappingOperation
in interfaceMappingStatisticsCollector
-
onSynchronizationStart
public void onSynchronizationStart(@Nullable @Nullable String processingIdentifier, @Nullable @Nullable String shadowOid, @Nullable @Nullable SynchronizationSituationType situation) Description copied from interface:TaskSynchronizationStatisticsCollector
Called when a situation was determined right before a synchronization takes place. We assume that we have a shadow with OID by that time. (If the OID is null we ignore further synchronization situation updates.)- Specified by:
onSynchronizationStart
in interfaceTaskSynchronizationStatisticsCollector
-
onSynchronizationExclusion
public void onSynchronizationExclusion(@Nullable @Nullable String processingIdentifier, @NotNull @NotNull SynchronizationExclusionReasonType exclusionReason) Description copied from interface:TaskSynchronizationStatisticsCollector
Informs the task that no synchronization will take place. Note that in theory it is possible thatTaskSynchronizationStatisticsCollector.onSynchronizationStart(String, String, SynchronizationSituationType)
is called first.- Specified by:
onSynchronizationExclusion
in interfaceTaskSynchronizationStatisticsCollector
-
onSynchronizationSituationChange
public void onSynchronizationSituationChange(@Nullable @Nullable String processingIdentifier, String shadowOid, @Nullable @Nullable SynchronizationSituationType situation) Description copied from interface:TaskSynchronizationStatisticsCollector
Informs the task that sync situation has changed for given shadow OID. There could be more such changes. But we are interested in the last one. If the shadow OID is null, we ignore such updates.- Specified by:
onSynchronizationSituationChange
in interfaceTaskSynchronizationStatisticsCollector
-
startCollectingSynchronizationStatistics
Description copied from interface:TaskSynchronizationStatisticsCollector
Starts collecting synchronization statistics within the task. Must be accompanied by correspondingTaskSynchronizationStatisticsCollector.stopCollectingSynchronizationStatistics(QualifiedItemProcessingOutcomeType)
call. (Related to the same item!)- Specified by:
startCollectingSynchronizationStatistics
in interfaceTaskSynchronizationStatisticsCollector
-
stopCollectingSynchronizationStatistics
public void stopCollectingSynchronizationStatistics(@NotNull @NotNull QualifiedItemProcessingOutcomeType outcome) - Specified by:
stopCollectingSynchronizationStatistics
in interfaceTaskSynchronizationStatisticsCollector
-
recordIterativeOperationStart
@NotNull public @NotNull Operation recordIterativeOperationStart(@NotNull @NotNull IterativeOperationStartInfo info) Description copied from interface:TaskIterativeOperationCollector
Records the start of iterative operation. The operation end is recorded by calling appropriate method on the returned object.- Specified by:
recordIterativeOperationStart
in interfaceTaskIterativeOperationCollector
-
recordObjectActionExecuted
public void recordObjectActionExecuted(String objectName, String objectDisplayName, QName objectType, String objectOid, ChangeType changeType, String channel, Throwable exception) - Specified by:
recordObjectActionExecuted
in interfaceTaskActionsExecutedCollector
-
recordObjectActionExecuted
public void recordObjectActionExecuted(PrismObject<? extends ObjectType> object, ChangeType changeType, Throwable exception) Description copied from interface:TaskActionsExecutedCollector
Logs under default channel known to the current task.- Specified by:
recordObjectActionExecuted
in interfaceTaskActionsExecutedCollector
-
recordObjectActionExecuted
public <T extends ObjectType> void recordObjectActionExecuted(PrismObject<T> objectOld, Class<T> objectTypeClass, String oid, ChangeType delete, String channel, Throwable o) - Specified by:
recordObjectActionExecuted
in interfaceTaskActionsExecutedCollector
-
getStoredOperationStatsOrClone
Description copied from interface:Task
Returns operation statistics from the task prism object (i.e. not the live ones). Clones if running task.- Specified by:
getStoredOperationStatsOrClone
in interfaceTask
-
modify
Description copied from interface:Task
Changes in-memory representation immediately and schedules a corresponding batched modification. -
getExecutionConstraints
Description copied from interface:Task
Returns task execution constraints- Specified by:
getExecutionConstraints
in interfaceTask
-
getGroup
Description copied from interface:Task
Gets the execution group name (i.e. executionConstraints/group). -
getGroups
Description copied from interface:Task
Returns names of all groups (primary plus all secondary ones). -
getGroupsWithLimits
Description copied from interface:Task
Returns all groups (primary plus all secondary ones) along with task count limits.- Specified by:
getGroupsWithLimits
in interfaceTask
-
getWorkState
Description copied from interface:Task
Gets task work state. NOT THREAD SAFE! TODO throw exception for RunningTask. (After revising of all uses.)- Specified by:
getWorkState
in interfaceTask
-
getActivitiesStateOrClone
Description copied from interface:Task
Gets task work state or its clone (for running tasks). TODO better name- Specified by:
getActivitiesStateOrClone
in interfaceTask
-
getContainerableOrClone
Description copied from interface:Task
TODO- Specified by:
getContainerableOrClone
in interfaceTask
-
doesItemExist
Description copied from interface:Task
TODO- Specified by:
doesItemExist
in interfaceTask
-
getActivityStateOrClone
Description copied from interface:Task
TODO- Specified by:
getActivityStateOrClone
in interfaceTask
-
getParentAndRoot
Description copied from interface:Task
Looks for OID of the parent and the root of the task tree for this task. PRE: task is either persistent or is aRunningTask
.- Specified by:
getParentAndRoot
in interfaceTask
-
getAggregatedLiveOperationStats
Description copied from interface:Task
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.- Specified by:
getAggregatedLiveOperationStats
in interfaceTask
-
getSelfReferenceFull
Description copied from interface:Task
Returns a full (object-bearing) reference to the task prism. Precondition: Task must be persistent.- Specified by:
getSelfReferenceFull
in interfaceTask
-
getSelfReference
Description copied from interface:Task
Returns a reference to the task prism. Precondition: Task must be persistent.- Specified by:
getSelfReference
in interfaceTask
-
getVersion
Description copied from interface:Task
Returns the version of underlying prism object.- Specified by:
getVersion
in interfaceTask
-
getPathToRootTask
Description copied from interface:Task
Returns the path from this task to the task tree root. (Starts with this task, ends with the root.)- Specified by:
getPathToRootTask
in interfaceTask
-
getOwnerRef
Description copied from interface:Task
Returns a reference to the task owner. (Cloned if the task is running.)- Specified by:
getOwnerRef
in interfaceTask
-
getCachingProfiles
Description copied from interface:Task
Returns an immutable collection of caching profiles. (From execution environment.)- Specified by:
getCachingProfiles
in interfaceTask
-
setExecutionConstraints
Description copied from interface:Task
Sets task execution constraints.- Specified by:
setExecutionConstraints
in interfaceTask
-
getExecutionEnvironment
Description copied from interface:Task
Gets the execution environment configuration. Cloned if running task.- Specified by:
getExecutionEnvironment
in interfaceTask
-
setExecutionEnvironment
Description copied from interface:Task
Sets the execution environment configuration.- Specified by:
setExecutionEnvironment
in interfaceTask
-
getTracingRequestedFor
Description copied from interface:Task
Get points for which the tracing is requested (within this task).- Specified by:
getTracingRequestedFor
in interfaceTask
-
addTracingRequest
Description copied from interface:Task
Requests (future) tracing for given tracing point - for this task.- Specified by:
addTracingRequest
in interfaceTask
-
removeTracingRequests
public void removeTracingRequests()Description copied from interface:Task
Removes all tracing requests for this task.- Specified by:
removeTracingRequests
in interfaceTask
-
getTracingProfile
Description copied from interface:Task
Returns (reference to tracing profile) that was defined for the tracing started by this task. NOT THREAD SAFE!- Specified by:
getTracingProfile
in interfaceTask
-
setTracingProfile
Description copied from interface:Task
Sets the profile to be used for future tracing within this task.- Specified by:
setTracingProfile
in interfaceTask
-
registerConnIdOperationsListener
Description copied from interface:Task
Registers aConnIdOperationsListener
.- Specified by:
registerConnIdOperationsListener
in interfaceTask
-
unregisterConnIdOperationsListener
Description copied from interface:Task
Unregisters aConnIdOperationsListener
.- Specified by:
unregisterConnIdOperationsListener
in interfaceTask
-
hasAssignments
public boolean hasAssignments()Description copied from interface:Task
Returns true if the task has any assignments.- Specified by:
hasAssignments
in interfaceTask
-
applyDeltasImmediate
- Specified by:
applyDeltasImmediate
in interfaceTask
-
applyModificationsTransient
- Specified by:
applyModificationsTransient
in interfaceTask
-
startCollectingActionsExecuted
- Specified by:
startCollectingActionsExecuted
in interfaceTaskActionsExecutedCollector
-
stopCollectingActionsExecuted
public void stopCollectingActionsExecuted()- Specified by:
stopCollectingActionsExecuted
in interfaceTaskActionsExecutedCollector
-
setSimulationTransaction
Description copied from interface:Task
Sets the current simulation transaction object.- Specified by:
setSimulationTransaction
in interfaceTask
-
getSimulationTransaction
Description copied from interface:Task
Returns the current simulation transaction, if there is any.- Specified by:
getSimulationTransaction
in interfaceTask
-
getCleanupAfterCompletion
- Specified by:
getCleanupAfterCompletion
in interfaceTask
-
setCleanupAfterCompletion
- Specified by:
setCleanupAfterCompletion
in interfaceTask
-