Class NullTaskImpl
java.lang.Object
com.evolveum.midpoint.task.api.test.NullTaskImpl
- All Implemented Interfaces:
ExecutionModeProvider,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
FieldsFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRINGFields inherited from interface com.evolveum.midpoint.task.api.Task
DOT_INTERFACE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArchetypeInformation(@NotNull String archetypeOid) Adds an archetype for the task.voidaddArchetypeInformationIfMissing(@NotNull String archetypeOid) AsTask.addArchetypeInformation(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) Creates a transient subtask.Show the content of the object intended for diagnostics by system administrator.debugDump(int indent) 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).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 TaskExecutionModeReturns 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. 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.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.booleanReturns true if task is persistent (i.e. stored in repository).booleanReturns true if task is transient (i.e. not stored in repository).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) 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.voidChanges in-memory representation immediately and schedules a corresponding batched modification.voidonSynchronizationExclusion(@Nullable String processingIdentifier, @NotNull SynchronizationExclusionReasonType exclusionReason) Informs the task that no synchronization will take place.voidonSynchronizationSituationChange(@Nullable String processingIdentifier, String shadowOid, @Nullable SynchronizationSituationType situation) Informs the task that sync situation has changed for given shadow OID.voidonSynchronizationStart(@Nullable String processingIdentifier, @Nullable String shadowOid, @Nullable SynchronizationSituationType situation) Called when a situation was determined right before a synchronization takes place.@NotNull OperationrecordIterativeOperationStart(@NotNull IterativeOperationStartInfo info) Records the start of iterative operation.voidrecordMappingOperation(String objectOid, String objectName, String objectTypeName, String mappingName, long duration) voidrecordNotificationOperation(String transportName, boolean success, long duration) voidrecordObjectActionExecuted(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) voidrecordObjectActionExecuted(String objectName, String objectDisplayName, QName objectType, String objectOid, ChangeType changeType, String channel, Throwable exception) voidrecordStateMessage(String message) Records a state message.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.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.voidSets the initial task execution and scheduling state to make task waiting (for prerequisite tasks).voidsetLegacyProgress(Long value) Records _legacy_ progress of the task, storing it persistently if needed.voidsetLegacyProgressImmediate(Long progress, OperationResult parentResult) "Immediate" version ofTask.setLegacyProgress(Long).voidsetName(PolyStringType value) Sets the human-readable name of the task.voidSets the human-readable name of the task.voidsetNameImmediate(PolyStringType value, OperationResult parentResult) 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.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.voidvoidStarts collecting synchronization statistics within the task.voidvoidstopCollectingSynchronizationStatistics(@NotNull QualifiedItemProcessingOutcomeType outcome) voidunregisterConnIdOperationsListener(@NotNull ConnIdOperationsListener listener) Unregisters aConnIdOperationsListener.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.task.api.ConnIdOperationsListener
onConnIdOperationEnd, onConnIdOperationResume, onConnIdOperationStart, onConnIdOperationSuspendMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.schema.simulation.ExecutionModeProvider
areShadowChangesSimulated, canSee, canSee, canSee, isExecutionFullyPersistent, isPersistentAtShadowLevelButNotFully, isProductionConfigurationMethods inherited from interface com.evolveum.midpoint.task.api.Task
assertPersistentExecution, getActivityStateOrClone, getActivityTreeStateOverviewOrClone, getExecutionSupport, getExtensionPropertyRealValue, getRoot, getRootActivityCompletionTimestamp, getRootActivityDefinitionOrClone, isClosed, isIndestructible, isLooselyBound, isReady, isRecurring, isRoot, isRunnable, isRunning, isSingle, isSuspended, isTightlyBound, isWaiting, listSubtasks, makeSingle, modify, setExtensionPropertyValue, setInitiallyRunnable, setInitiallySuspended, setItemRealValues, setItemRealValuesCollection, setRootActivityDefinitionMethods 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:TaskAdd a task as this task's dependent, i.e. the task denoted by taskIdentifier DEPENDS ON (waits for completion of) this task.- Specified by:
addDependentin interfaceTask
-
isAsynchronous
public boolean isAsynchronous()Description copied from interface:TaskReturns 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:
isAsynchronousin interfaceTask- Returns:
- true if the task is asynchronous.
-
getExecutionState
Description copied from interface:TaskReturns high-level execution state.- Specified by:
getExecutionStatein interfaceTask
-
getSchedulingState
Description copied from interface:TaskReturns low-level scheduling state.- Specified by:
getSchedulingStatein interfaceTask
-
setInitialExecutionAndScheduledState
public void setInitialExecutionAndScheduledState(TaskExecutionStateType executionState, TaskSchedulingStateType schedulingState) Description copied from interface:TaskSets initial task execution and scheduled state. It will be used when the task is made persistent. Precondition: Task is transient.- Specified by:
setInitialExecutionAndScheduledStatein interfaceTask
-
setInitiallyWaitingForPrerequisites
public void setInitiallyWaitingForPrerequisites()Description copied from interface:TaskSets the initial task execution and scheduling state to make task waiting (for prerequisite tasks).- Specified by:
setInitiallyWaitingForPrerequisitesin interfaceTask
-
getPersistenceStatus
Description copied from interface:TaskReturns task persistence status.- Specified by:
getPersistenceStatusin interfaceTask
-
isTransient
public boolean isTransient()Description copied from interface:TaskReturns true if task is transient (i.e. not stored in repository).- Specified by:
isTransientin interfaceTask
-
isPersistent
public boolean isPersistent()Description copied from interface:TaskReturns true if task is persistent (i.e. stored in repository).- Specified by:
isPersistentin interfaceTask
-
getRecurrence
Description copied from interface:TaskReturns task recurrence status.- Specified by:
getRecurrencein interfaceTask
-
setSchedule
Description copied from interface:TaskSets the schedule for the task. Removes also the legacy recurrence flag.- Specified by:
setSchedulein interfaceTask
-
getSchedule
Description copied from interface:TaskReturns the schedule.- Specified by:
getSchedulein interfaceTask
-
getScheduleInterval
Description copied from interface:TaskReturns the schedule interval.- Specified by:
getScheduleIntervalin interfaceTask
-
hasScheduleInterval
public boolean hasScheduleInterval()Description copied from interface:TaskReturns true if the schedule interval is set.- Specified by:
hasScheduleIntervalin interfaceTask
-
getBinding
Description copied from interface:TaskReturns task binding.- Specified by:
getBindingin interfaceTask
-
getHandlerUri
Description copied from interface:TaskReturns 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:
getHandlerUriin interfaceTask
-
setHandlerUri
Description copied from interface:TaskSets handler URI.- Specified by:
setHandlerUriin interfaceTask
-
getTaskIdentifier
Description copied from interface:TaskReturns 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:
getTaskIdentifierin interfaceTask
-
getOwner
Description copied from interface:TaskReturns 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:TaskSets the task owner. Precondition: Task is transient. -
setOwnerRef
Description copied from interface:TaskSets the task owner reference. Precondition: Task is transient.- Specified by:
setOwnerRefin interfaceTask
-
getChannel
Description copied from interface:TaskReturns channel URI associated with this task.- Specified by:
getChannelin interfaceTask
-
setChannel
Description copied from interface:TaskSets channel URI.- Specified by:
setChannelin interfaceTask
-
getRequestee
Description copied from interface:TaskGets 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:
getRequesteein interfaceTask
-
setRequesteeTransient
- Specified by:
setRequesteeTransientin interfaceTask
-
getOid
Description copied from interface:TaskReturns task OID. Only persistent tasks have OID. So this method returns null if the task is not persistent. -
getObject
Description copied from interface:TaskReturns 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:TaskReturns 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:
getObjectRefOrClonein interfaceTask
-
setObjectRef
Description copied from interface:TaskSets the object reference.- Specified by:
setObjectRefin interfaceTask
-
setObjectRef
Description copied from interface:TaskSets the object reference.- Specified by:
setObjectRefin interfaceTask
-
getObjectOid
Description copied from interface:TaskReturns OID of the object that the task is associated with. Convenience method. This will get the OID from the objectRef.- Specified by:
getObjectOidin interfaceTask
-
getResult
Description copied from interface:TaskReturns a top-level OperationResult stored in the task. Beware of thread safety. This is a live object! -
setResult
Description copied from interface:TaskSets the top-level OperationResult stored in the task. Use with care! -
getLastRunStartTimestamp
Description copied from interface:TaskReturns 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:
getLastRunStartTimestampin interfaceTask
-
getLastRunFinishTimestamp
Description copied from interface:TaskReturns 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:
getLastRunFinishTimestampin interfaceTask
-
getNextRunStartTime
Description copied from interface:TaskReturns the time when the task should start again. This is transient property, present only if explicitly requested.- Specified by:
getNextRunStartTimein interfaceTask
-
getName
Description copied from interface:TaskReturns human-readable name of the task. -
setName
Description copied from interface:TaskSets the human-readable name of the task. -
setName
Description copied from interface:TaskSets the human-readable name of the task. -
setNameImmediate
Description copied from interface:TaskSets the human-readable name of the task, immediately into repository.- Specified by:
setNameImmediatein interfaceTask
-
getExtensionItemOrClone
public <IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> getExtensionItemOrClone(ItemName propertyName) Description copied from interface:TaskReturns specified item (property, reference or container) from the extension. Cloned if running task. Null if extension or item does not exist.- Specified by:
getExtensionItemOrClonein interfaceTask
-
setExtensionContainer
Description copied from interface:TaskSets a container in the extension - replaces existing value(s), if any, by the one(s) provided.- Specified by:
setExtensionContainerin interfaceTask- Parameters:
item- Container with value(s) to be put into task extension.
-
setExtensionReference
Description copied from interface:TaskSets a reference in the extension - replaces existing value(s), if any, by the one(s) provided.- Specified by:
setExtensionReferencein interfaceTask
-
setExtensionProperty
Description copied from interface:TaskSets a property in the extension - replaces existing value(s), if any, by the one(s) provided.- Specified by:
setExtensionPropertyin interfaceTask
-
setExtensionPropertyImmediate
Description copied from interface:Task"Immediate" version of the above method.- Specified by:
setExtensionPropertyImmediatein interfaceTask
-
addExtensionProperty
Description copied from interface:TaskAdds value(s) to a given extension property.- Specified by:
addExtensionPropertyin interfaceTask- Parameters:
property- holder of the value(s) to be added into task extension property
-
setPropertyRealValue
- Specified by:
setPropertyRealValuein interfaceTask
-
setExtensionContainerValue
Description copied from interface:TaskSets a container value in the extension - replaces existing value(s), if any, by the one provided.- Specified by:
setExtensionContainerValuein interfaceTask- Parameters:
containerName- name of the containervalue- value to be put into extension
-
setExtensionItem
Description copied from interface:TaskPuts generic item into extension.- Specified by:
setExtensionItemin interfaceTask
-
getLegacyProgress
public long getLegacyProgress()Description copied from interface:TaskReturns task progress, as reported by task handler.- Specified by:
getLegacyProgressin interfaceTask
-
setLegacyProgress
Description copied from interface:TaskRecords _legacy_ progress of the task, storing it persistently if needed.- Specified by:
setLegacyProgressin interfaceTask
-
incrementLegacyProgressTransient
public void incrementLegacyProgressTransient()Description copied from interface:TaskIncrements legacy progress without creating a pending modification.- Specified by:
incrementLegacyProgressTransientin 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:
setLegacyProgressImmediatein interfaceTask
-
getUpdatedTaskObject
Description copied from interface:TaskReturns backing task prism object UPDATED with current operation result. Assumes that task is not running. (Otherwise IllegalStateException is thrown.)- Specified by:
getUpdatedTaskObjectin interfaceTask
-
getRawTaskObjectClone
Description copied from interface:TaskReturns CLONE of backing task prism object without updating with current operation result.- Specified by:
getRawTaskObjectClonein interfaceTask
-
refresh
Description copied from interface:TaskRe-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:DebugDumpableShow 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:
debugDumpin interfaceDebugDumpable- Returns:
- content of the object intended for diagnostics by system administrator.
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable
-
flushPendingModifications
Description copied from interface:TaskSaves modifications done against the in-memory version of the task into the repository.- Specified by:
flushPendingModificationsin interfaceTask
-
getNode
Description copied from interface:TaskReturns 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:TaskReturns the node as really observed. This is a transient information that has to be requested explicitly.- Specified by:
getNodeAsObservedin interfaceTask
-
getResultStatus
Description copied from interface:TaskReturns 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:
getResultStatusin interfaceTask
-
getThreadStopAction
Description copied from interface:TaskReturns thread stop action (what happens when the task thread is stopped e.g. because of node going down).- Specified by:
getThreadStopActionin interfaceTask
-
addArchetypeInformation
Description copied from interface:TaskAdds 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:
addArchetypeInformationin interfaceTask
-
addArchetypeInformationIfMissing
Description copied from interface:TaskAsTask.addArchetypeInformation(String)but executed only if there's no archetype currently set.- Specified by:
addArchetypeInformationIfMissingin interfaceTask
-
getExtensionOrClone
Description copied from interface:TaskReturns 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:
getExtensionOrClonein interfaceTask
-
getOrCreateExtension
Description copied from interface:TaskGets or creates an extension. Just likePrismObject.getOrCreateExtension(). Cloned if the task is running.- Specified by:
getOrCreateExtensionin interfaceTask
-
getExtensionClone
Description copied from interface:TaskGets extension clone, or null if there is no extension.- Specified by:
getExtensionClonein interfaceTask
-
getExtensionPropertyOrClone
Description copied from interface:TaskReturns specified property from the extension; or null if extension or property does not exist. Cloned if task is running.- Specified by:
getExtensionPropertyOrClonein interfaceTask
-
getPropertyRealValue
- Specified by:
getPropertyRealValuein interfaceTask
-
getPropertyRealValueOrClone
- Specified by:
getPropertyRealValueOrClonein interfaceTask
-
getItemRealValueOrClone
- Specified by:
getItemRealValueOrClonein interfaceTask
-
getReferenceRealValue
Description copied from interface:TaskTODO what about thread safety?- Specified by:
getReferenceRealValuein interfaceTask
-
getReferenceRealValues
Description copied from interface:TaskTODO what about thread safety?- Specified by:
getReferenceRealValuesin interfaceTask
-
getExtensionContainerRealValueOrClone
Description copied from interface:TaskReturns 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:
getExtensionContainerRealValueOrClonein interfaceTask
-
getExtensionReferenceOrClone
Description copied from interface:TaskReturns specified reference from the extension. Cloned if running task. Null if extension or reference does not exist.- Specified by:
getExtensionReferenceOrClonein interfaceTask
-
setDescriptionImmediate
Description copied from interface:TaskSets task description, immediately storing it into the repo.- Specified by:
setDescriptionImmediatein interfaceTask
-
setDescription
Description copied from interface:TaskSets task description.- Specified by:
setDescriptionin interfaceTask
-
getDescription
Description copied from interface:TaskReturns task description.- Specified by:
getDescriptionin interfaceTask
-
deleteExtensionProperty
Description copied from interface:TaskRemoves specified VALUES of this extension property (not all of its values).- Specified by:
deleteExtensionPropertyin interfaceTask
-
setThreadStopAction
Description copied from interface:TaskSets the thread stop action for this task.- Specified by:
setThreadStopActionin interfaceTask
-
createSubtask
Description copied from interface:TaskCreates a transient subtask. Owner is inherited from parent task to subtask.- Specified by:
createSubtaskin interfaceTask
-
getParent
Description copied from interface:TaskReturns 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:
listSubtasksin interfaceTask
-
listSubtasksDeeply
Description copied from interface:TaskList 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:
listSubtasksDeeplyin interfaceTask
-
listPrerequisiteTasks
Description copied from interface:TaskList 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:
listPrerequisiteTasksin interfaceTask
-
getRawTaskObjectClonedIfNecessary
Description copied from interface:TaskReturns backing task prism object without updating with current operation result. If the task is running, a clone is returned.- Specified by:
getRawTaskObjectClonedIfNecessaryin interfaceTask
-
getDependents
Description copied from interface:TaskLists all explicit dependents' identifiers.- Specified by:
getDependentsin interfaceTask
-
listDependents
Description copied from interface:TaskLists 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:
listDependentsin interfaceTask
-
getParentTask
Description copied from interface:TaskReturns the parent task, if any.- Specified by:
getParentTaskin interfaceTask
-
getWaitingReason
Description copied from interface:TaskReturns the task waiting reason for a WAITING task.- Specified by:
getWaitingReasonin interfaceTask
-
getCompletionTimestamp
Description copied from interface:TaskReturns the completion timestamp - time when the task was closed (or null if it is not closed).- Specified by:
getCompletionTimestampin interfaceTask
-
addExtensionReference
Description copied from interface:TaskAdds value(s) to a given extension reference.- Specified by:
addExtensionReferencein interfaceTask- Parameters:
reference- holder of the value(s) to be added into task extension reference
-
listSubtasksDeeply
Description copied from interface:TaskLists all tasks in subtasks tree.- Specified by:
listSubtasksDeeplyin interfaceTask- Parameters:
persistentOnly- If true, transient subtasks (i.e. lightweight asynchronous tasks) are ignored.
-
getExecutionMode
Description copied from interface:ExecutionModeProviderReturns the execution mode of this task.- Specified by:
getExecutionModein interfaceExecutionModeProvider
-
setExecutionMode
@NotNull public @NotNull TaskExecutionMode setExecutionMode(@NotNull @NotNull TaskExecutionMode mode) Description copied from interface:TaskSets the execution mode of this task. Use with care - preferably only for new tasks. Returns the original value.- Specified by:
setExecutionModein interfaceTask
-
getExpectedTotal
Description copied from interface:TaskReturns expected total progress.- Specified by:
getExpectedTotalin interfaceTask
-
setExpectedTotal
Description copied from interface:TaskStores expected total progress of the task, storing it persistently if needed.- Specified by:
setExpectedTotalin interfaceTask
-
recordStateMessage
Description copied from interface:StatisticsCollectorRecords a state message.- Specified by:
recordStateMessagein interfaceStatisticsCollector
-
recordNotificationOperation
- Specified by:
recordNotificationOperationin interfaceNotificationStatisticsCollector
-
recordMappingOperation
public void recordMappingOperation(String objectOid, String objectName, String objectTypeName, String mappingName, long duration) - Specified by:
recordMappingOperationin interfaceMappingStatisticsCollector
-
onSynchronizationStart
public void onSynchronizationStart(@Nullable @Nullable String processingIdentifier, @Nullable @Nullable String shadowOid, @Nullable @Nullable SynchronizationSituationType situation) Description copied from interface:TaskSynchronizationStatisticsCollectorCalled 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:
onSynchronizationStartin interfaceTaskSynchronizationStatisticsCollector
-
onSynchronizationExclusion
public void onSynchronizationExclusion(@Nullable @Nullable String processingIdentifier, @NotNull @NotNull SynchronizationExclusionReasonType exclusionReason) Description copied from interface:TaskSynchronizationStatisticsCollectorInforms 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:
onSynchronizationExclusionin interfaceTaskSynchronizationStatisticsCollector
-
onSynchronizationSituationChange
public void onSynchronizationSituationChange(@Nullable @Nullable String processingIdentifier, String shadowOid, @Nullable @Nullable SynchronizationSituationType situation) Description copied from interface:TaskSynchronizationStatisticsCollectorInforms 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:
onSynchronizationSituationChangein interfaceTaskSynchronizationStatisticsCollector
-
startCollectingSynchronizationStatistics
Description copied from interface:TaskSynchronizationStatisticsCollectorStarts collecting synchronization statistics within the task. Must be accompanied by correspondingTaskSynchronizationStatisticsCollector.stopCollectingSynchronizationStatistics(QualifiedItemProcessingOutcomeType)call. (Related to the same item!)- Specified by:
startCollectingSynchronizationStatisticsin interfaceTaskSynchronizationStatisticsCollector
-
stopCollectingSynchronizationStatistics
public void stopCollectingSynchronizationStatistics(@NotNull @NotNull QualifiedItemProcessingOutcomeType outcome) - Specified by:
stopCollectingSynchronizationStatisticsin interfaceTaskSynchronizationStatisticsCollector
-
recordIterativeOperationStart
@NotNull public @NotNull Operation recordIterativeOperationStart(@NotNull @NotNull IterativeOperationStartInfo info) Description copied from interface:TaskIterativeOperationCollectorRecords the start of iterative operation. The operation end is recorded by calling appropriate method on the returned object.- Specified by:
recordIterativeOperationStartin interfaceTaskIterativeOperationCollector
-
recordObjectActionExecuted
public void recordObjectActionExecuted(String objectName, String objectDisplayName, QName objectType, String objectOid, ChangeType changeType, String channel, Throwable exception) - Specified by:
recordObjectActionExecutedin interfaceTaskActionsExecutedCollector
-
recordObjectActionExecuted
public void recordObjectActionExecuted(PrismObject<? extends ObjectType> object, ChangeType changeType, Throwable exception) Description copied from interface:TaskActionsExecutedCollectorLogs under default channel known to the current task.- Specified by:
recordObjectActionExecutedin interfaceTaskActionsExecutedCollector
-
recordObjectActionExecuted
public <T extends ObjectType> void recordObjectActionExecuted(PrismObject<T> objectOld, Class<T> objectTypeClass, String oid, ChangeType delete, String channel, Throwable o) - Specified by:
recordObjectActionExecutedin interfaceTaskActionsExecutedCollector
-
getStoredOperationStatsOrClone
Description copied from interface:TaskReturns operation statistics from the task prism object (i.e. not the live ones). Clones if running task.- Specified by:
getStoredOperationStatsOrClonein interfaceTask
-
modify
Description copied from interface:TaskChanges in-memory representation immediately and schedules a corresponding batched modification. -
getExecutionConstraints
Description copied from interface:TaskReturns task execution constraints- Specified by:
getExecutionConstraintsin interfaceTask
-
getGroup
Description copied from interface:TaskGets the execution group name (i.e. executionConstraints/group). -
getGroups
Description copied from interface:TaskReturns names of all groups (primary plus all secondary ones). -
getGroupsWithLimits
Description copied from interface:TaskReturns all groups (primary plus all secondary ones) along with task count limits.- Specified by:
getGroupsWithLimitsin interfaceTask
-
getWorkState
Description copied from interface:TaskGets task work state. NOT THREAD SAFE! TODO throw exception for RunningTask. (After revising of all uses.)- Specified by:
getWorkStatein interfaceTask
-
getActivitiesStateOrClone
Description copied from interface:TaskGets task work state or its clone (for running tasks). TODO better name- Specified by:
getActivitiesStateOrClonein interfaceTask
-
getContainerableOrClone
Description copied from interface:TaskTODO- Specified by:
getContainerableOrClonein interfaceTask
-
doesItemExist
Description copied from interface:TaskTODO- Specified by:
doesItemExistin interfaceTask
-
getActivityStateOrClone
Description copied from interface:TaskTODO- Specified by:
getActivityStateOrClonein interfaceTask
-
getParentAndRoot
Description copied from interface:TaskLooks 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:
getParentAndRootin interfaceTask
-
getAggregatedLiveOperationStats
Description copied from interface:TaskGets 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:
getAggregatedLiveOperationStatsin interfaceTask
-
getSelfReferenceFull
Description copied from interface:TaskReturns a full (object-bearing) reference to the task prism. Precondition: Task must be persistent.- Specified by:
getSelfReferenceFullin interfaceTask
-
getSelfReference
Description copied from interface:TaskReturns a reference to the task prism. Precondition: Task must be persistent.- Specified by:
getSelfReferencein interfaceTask
-
getVersion
Description copied from interface:TaskReturns the version of underlying prism object.- Specified by:
getVersionin interfaceTask
-
getPathToRootTask
Description copied from interface:TaskReturns the path from this task to the task tree root. (Starts with this task, ends with the root.)- Specified by:
getPathToRootTaskin interfaceTask
-
getOwnerRef
Description copied from interface:TaskReturns a reference to the task owner. (Cloned if the task is running.)- Specified by:
getOwnerRefin interfaceTask
-
getCachingProfiles
Description copied from interface:TaskReturns an immutable collection of caching profiles. (From execution environment.)- Specified by:
getCachingProfilesin interfaceTask
-
setExecutionConstraints
Description copied from interface:TaskSets task execution constraints.- Specified by:
setExecutionConstraintsin interfaceTask
-
getExecutionEnvironment
Description copied from interface:TaskGets the execution environment configuration. Cloned if running task.- Specified by:
getExecutionEnvironmentin interfaceTask
-
setExecutionEnvironment
Description copied from interface:TaskSets the execution environment configuration.- Specified by:
setExecutionEnvironmentin interfaceTask
-
getTracingRequestedFor
Description copied from interface:TaskGet points for which the tracing is requested (within this task).- Specified by:
getTracingRequestedForin interfaceTask
-
addTracingRequest
Description copied from interface:TaskRequests (future) tracing for given tracing point - for this task.- Specified by:
addTracingRequestin interfaceTask
-
removeTracingRequests
public void removeTracingRequests()Description copied from interface:TaskRemoves all tracing requests for this task.- Specified by:
removeTracingRequestsin interfaceTask
-
getTracingProfile
Description copied from interface:TaskReturns (reference to tracing profile) that was defined for the tracing started by this task. NOT THREAD SAFE!- Specified by:
getTracingProfilein interfaceTask
-
setTracingProfile
Description copied from interface:TaskSets the profile to be used for future tracing within this task.- Specified by:
setTracingProfilein interfaceTask
-
registerConnIdOperationsListener
Description copied from interface:TaskRegisters aConnIdOperationsListener.- Specified by:
registerConnIdOperationsListenerin interfaceTask
-
unregisterConnIdOperationsListener
Description copied from interface:TaskUnregisters aConnIdOperationsListener.- Specified by:
unregisterConnIdOperationsListenerin interfaceTask
-
hasAssignments
public boolean hasAssignments()Description copied from interface:TaskReturns true if the task has any assignments.- Specified by:
hasAssignmentsin interfaceTask
-
applyDeltasImmediate
- Specified by:
applyDeltasImmediatein interfaceTask
-
applyModificationsTransient
- Specified by:
applyModificationsTransientin interfaceTask
-
startCollectingActionsExecuted
- Specified by:
startCollectingActionsExecutedin interfaceTaskActionsExecutedCollector
-
stopCollectingActionsExecuted
public void stopCollectingActionsExecuted()- Specified by:
stopCollectingActionsExecutedin interfaceTaskActionsExecutedCollector
-
setSimulationTransaction
Description copied from interface:TaskSets the current simulation transaction object.- Specified by:
setSimulationTransactionin interfaceTask
-
getSimulationTransaction
Description copied from interface:TaskReturns the current simulation transaction, if there is any.- Specified by:
getSimulationTransactionin interfaceTask
-
getCleanupAfterCompletion
- Specified by:
getCleanupAfterCompletionin interfaceTask
-
setCleanupAfterCompletion
- Specified by:
setCleanupAfterCompletionin interfaceTask
-