Class NullTaskImpl

java.lang.Object
com.evolveum.midpoint.task.api.test.NullTaskImpl
All Implemented Interfaces:
MappingStatisticsCollector, NotificationStatisticsCollector, StatisticsCollector, TaskActionsExecutedCollector, TaskIterativeOperationCollector, TaskSynchronizationStatisticsCollector, ConnIdOperationsListener, Task, DebugDumpable

public class NullTaskImpl extends Object implements Task
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 Details

    • INSTANCE

      public static final Task INSTANCE
  • Constructor Details

    • NullTaskImpl

      public NullTaskImpl()
  • Method Details

    • addDependent

      public void addDependent(String taskIdentifier)
      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 interface Task
    • 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 interface Task
      Returns:
      true if the task is asynchronous.
    • getExecutionState

      public TaskExecutionStateType getExecutionState()
      Description copied from interface: Task
      Returns high-level execution state.
      Specified by:
      getExecutionState in interface Task
    • getSchedulingState

      public TaskSchedulingStateType getSchedulingState()
      Description copied from interface: Task
      Returns low-level scheduling state.
      Specified by:
      getSchedulingState in interface Task
    • 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 interface Task
    • 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 interface Task
    • getPersistenceStatus

      @NotNull public @NotNull TaskPersistenceStatus getPersistenceStatus()
      Description copied from interface: Task
      Returns task persistence status.
      Specified by:
      getPersistenceStatus in interface Task
    • 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 interface Task
    • isPersistent

      public boolean isPersistent()
      Description copied from interface: Task
      Returns true if task is persistent (i.e. stored in repository).
      Specified by:
      isPersistent in interface Task
    • getRecurrence

      @NotNull public @NotNull TaskRecurrenceType getRecurrence()
      Description copied from interface: Task
      Returns task recurrence status.
      Specified by:
      getRecurrence in interface Task
    • setSchedule

      public void setSchedule(ScheduleType schedule)
      Description copied from interface: Task
      Sets the schedule for the task. Removes also the legacy recurrence flag.
      Specified by:
      setSchedule in interface Task
    • getSchedule

      public ScheduleType getSchedule()
      Description copied from interface: Task
      Returns the schedule.
      Specified by:
      getSchedule in interface Task
    • getScheduleInterval

      public Integer getScheduleInterval()
      Description copied from interface: Task
      Returns the schedule interval.
      Specified by:
      getScheduleInterval in interface Task
    • hasScheduleInterval

      public boolean hasScheduleInterval()
      Description copied from interface: Task
      Returns true if the schedule interval is set.
      Specified by:
      hasScheduleInterval in interface Task
    • getBinding

      public TaskBindingType getBinding()
      Description copied from interface: Task
      Returns task binding.
      Specified by:
      getBinding in interface Task
    • getHandlerUri

      public String 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 interface Task
    • setHandlerUri

      public void setHandlerUri(String value)
      Description copied from interface: Task
      Sets handler URI.
      Specified by:
      setHandlerUri in interface Task
    • getTaskIdentifier

      public String 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 interface Task
    • getOwner

      public PrismObject<? extends FocusType> getOwner(OperationResult result)
      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.
      Specified by:
      getOwner in interface Task
    • setOwner

      public void setOwner(PrismObject<? extends FocusType> owner)
      Description copied from interface: Task
      Sets the task owner. Precondition: Task is transient.
      Specified by:
      setOwner in interface Task
    • setOwnerRef

      public void setOwnerRef(ObjectReferenceType ownerRef)
      Description copied from interface: Task
      Sets the task owner reference. Precondition: Task is transient.
      Specified by:
      setOwnerRef in interface Task
    • getChannel

      public String getChannel()
      Description copied from interface: Task
      Returns channel URI associated with this task.
      Specified by:
      getChannel in interface Task
    • setChannel

      public void setChannel(String channelUri)
      Description copied from interface: Task
      Sets channel URI.
      Specified by:
      setChannel in interface Task
    • getRequestee

      public PrismObject<UserType> 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 interface Task
    • setRequesteeTransient

      public void setRequesteeTransient(PrismObject<UserType> user)
      Specified by:
      setRequesteeTransient in interface Task
    • getOid

      public String 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.
      Specified by:
      getOid in interface Task
    • getObject

      public <T extends ObjectType> PrismObject<T> getObject(Class<T> type, OperationResult result)
      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.)
      Specified by:
      getObject in interface Task
    • getObjectRefOrClone

      public ObjectReferenceType 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 interface Task
    • setObjectRef

      public void setObjectRef(ObjectReferenceType objectRef)
      Description copied from interface: Task
      Sets the object reference.
      Specified by:
      setObjectRef in interface Task
    • setObjectRef

      public void setObjectRef(String oid, QName type)
      Description copied from interface: Task
      Sets the object reference.
      Specified by:
      setObjectRef in interface Task
    • getObjectOid

      public String 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 interface Task
    • getResult

      public OperationResult getResult()
      Description copied from interface: Task
      Returns a top-level OperationResult stored in the task. Beware of thread safety. This is a live object!
      Specified by:
      getResult in interface Task
    • setResult

      public void setResult(OperationResult result)
      Description copied from interface: Task
      Sets the top-level OperationResult stored in the task. Use with care!
      Specified by:
      setResult in interface Task
    • getLastRunStartTimestamp

      public Long 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 interface Task
    • getLastRunFinishTimestamp

      public Long 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 interface Task
    • getNextRunStartTime

      public Long getNextRunStartTime(OperationResult result)
      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 interface Task
    • getName

      public PolyStringType getName()
      Description copied from interface: Task
      Returns human-readable name of the task.
      Specified by:
      getName in interface Task
    • setName

      public void setName(PolyStringType value)
      Description copied from interface: Task
      Sets the human-readable name of the task.
      Specified by:
      setName in interface Task
    • setName

      public void setName(String value)
      Description copied from interface: Task
      Sets the human-readable name of the task.
      Specified by:
      setName in interface Task
    • setNameImmediate

      public void setNameImmediate(PolyStringType value, OperationResult parentResult)
      Description copied from interface: Task
      Sets the human-readable name of the task, immediately into repository.
      Specified by:
      setNameImmediate in interface Task
    • 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 interface Task
    • setExtensionContainer

      public <C extends Containerable> void setExtensionContainer(PrismContainer<C> item)
      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 interface Task
      Parameters:
      item - Container with value(s) to be put into task extension.
    • setExtensionReference

      public void setExtensionReference(PrismReference reference)
      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 interface Task
    • setExtensionProperty

      public void setExtensionProperty(PrismProperty<?> property)
      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 interface Task
    • setExtensionPropertyImmediate

      public void setExtensionPropertyImmediate(PrismProperty<?> property, OperationResult result)
      Description copied from interface: Task
      "Immediate" version of the above method.
      Specified by:
      setExtensionPropertyImmediate in interface Task
    • addExtensionProperty

      public void addExtensionProperty(PrismProperty<?> property)
      Description copied from interface: Task
      Adds value(s) to a given extension property.
      Specified by:
      addExtensionProperty in interface Task
      Parameters:
      property - holder of the value(s) to be added into task extension property
    • setPropertyRealValue

      public <T> void setPropertyRealValue(ItemPath path, T value)
      Specified by:
      setPropertyRealValue in interface Task
    • setExtensionContainerValue

      public <T extends Containerable> void setExtensionContainerValue(QName containerName, T value)
      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 interface Task
      Parameters:
      containerName - name of the container
      value - value to be put into extension
    • setExtensionItem

      public void setExtensionItem(Item<?,?> item)
      Description copied from interface: Task
      Puts generic item into extension.
      Specified by:
      setExtensionItem in interface Task
    • getLegacyProgress

      public long getLegacyProgress()
      Description copied from interface: Task
      Returns task progress, as reported by task handler.
      Specified by:
      getLegacyProgress in interface Task
    • setLegacyProgress

      public void setLegacyProgress(Long value)
      Description copied from interface: Task
      Records _legacy_ progress of the task, storing it persistently if needed.
      Specified by:
      setLegacyProgress in interface Task
    • incrementLegacyProgressTransient

      public void incrementLegacyProgressTransient()
      Description copied from interface: Task
      Increments legacy progress without creating a pending modification.
      Specified by:
      incrementLegacyProgressTransient in interface Task
    • setLegacyProgressImmediate

      public void setLegacyProgressImmediate(Long progress, OperationResult parentResult)
      Description copied from interface: Task
      "Immediate" version of Task.setLegacyProgress(Long). BEWARE: this method can take quite a long time to execute, if invoked in a cycle.
      Specified by:
      setLegacyProgressImmediate in interface Task
    • getUpdatedTaskObject

      @NotNull public @NotNull PrismObject<TaskType> 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 interface Task
    • getRawTaskObjectClone

      @NotNull public @NotNull PrismObject<TaskType> getRawTaskObjectClone()
      Description copied from interface: Task
      Returns CLONE of backing task prism object without updating with current operation result.
      Specified by:
      getRawTaskObjectClone in interface Task
    • refresh

      public void refresh(OperationResult result)
      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.
      Specified by:
      refresh in interface Task
    • debugDump

      public String 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 interface DebugDumpable
      Returns:
      content of the object intended for diagnostics by system administrator.
    • debugDump

      public String debugDump(int indent)
      Specified by:
      debugDump in interface DebugDumpable
    • flushPendingModifications

      public void flushPendingModifications(OperationResult parentResult)
      Description copied from interface: Task
      Saves modifications done against the in-memory version of the task into the repository.
      Specified by:
      flushPendingModifications in interface Task
    • getNode

      public String 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.
      Specified by:
      getNode in interface Task
    • getNodeAsObserved

      public String 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 interface Task
    • getResultStatus

      public OperationResultStatusType 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 interface Task
    • getThreadStopAction

      public ThreadStopActionType 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 interface Task
    • addArchetypeInformation

      public void addArchetypeInformation(@NotNull @NotNull String archetypeOid)
      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 interface Task
    • addArchetypeInformationIfMissing

      public void addArchetypeInformationIfMissing(@NotNull @NotNull String archetypeOid)
      Description copied from interface: Task
      As Task.addArchetypeInformation(String) but executed only if there's no archetype currently set.
      Specified by:
      addArchetypeInformationIfMissing in interface Task
    • getExtensionOrClone

      public PrismContainer<? extends ExtensionType> 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 interface Task
    • getOrCreateExtension

      @NotNull public @NotNull PrismContainer<? extends ExtensionType> getOrCreateExtension()
      Description copied from interface: Task
      Gets or creates an extension. Just like PrismObject.getOrCreateExtension(). Cloned if the task is running.
      Specified by:
      getOrCreateExtension in interface Task
    • getExtensionClone

      public PrismContainer<? extends ExtensionType> getExtensionClone()
      Description copied from interface: Task
      Gets extension clone, or null if there is no extension.
      Specified by:
      getExtensionClone in interface Task
    • getExtensionPropertyOrClone

      public <T> PrismProperty<T> getExtensionPropertyOrClone(ItemName propertyName)
      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 interface Task
    • getPropertyRealValue

      public <T> T getPropertyRealValue(ItemPath path, Class<T> expectedType)
      Specified by:
      getPropertyRealValue in interface Task
    • getPropertyRealValueOrClone

      public <T> T getPropertyRealValueOrClone(ItemPath path, Class<T> expectedType)
      Specified by:
      getPropertyRealValueOrClone in interface Task
    • getItemRealValueOrClone

      public <T> T getItemRealValueOrClone(ItemPath path, Class<T> expectedType)
      Specified by:
      getItemRealValueOrClone in interface Task
    • getReferenceRealValue

      public ObjectReferenceType getReferenceRealValue(ItemPath path)
      Description copied from interface: Task
      TODO what about thread safety?
      Specified by:
      getReferenceRealValue in interface Task
    • getReferenceRealValues

      public Collection<ObjectReferenceType> getReferenceRealValues(ItemPath path)
      Description copied from interface: Task
      TODO what about thread safety?
      Specified by:
      getReferenceRealValues in interface Task
    • getExtensionContainerRealValueOrClone

      public <T extends Containerable> T getExtensionContainerRealValueOrClone(ItemName containerName)
      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 interface Task
    • getExtensionReferenceOrClone

      public PrismReference getExtensionReferenceOrClone(ItemName name)
      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 interface Task
    • setDescriptionImmediate

      public void setDescriptionImmediate(String value, OperationResult result)
      Description copied from interface: Task
      Sets task description, immediately storing it into the repo.
      Specified by:
      setDescriptionImmediate in interface Task
    • setDescription

      public void setDescription(String value)
      Description copied from interface: Task
      Sets task description.
      Specified by:
      setDescription in interface Task
    • getDescription

      public String getDescription()
      Description copied from interface: Task
      Returns task description.
      Specified by:
      getDescription in interface Task
    • deleteExtensionProperty

      public void deleteExtensionProperty(PrismProperty<?> property)
      Description copied from interface: Task
      Removes specified VALUES of this extension property (not all of its values).
      Specified by:
      deleteExtensionProperty in interface Task
    • setThreadStopAction

      public void setThreadStopAction(ThreadStopActionType value)
      Description copied from interface: Task
      Sets the thread stop action for this task.
      Specified by:
      setThreadStopAction in interface Task
    • createSubtask

      public Task createSubtask()
      Description copied from interface: Task
      Creates a transient subtask. Owner is inherited from parent task to subtask.
      Specified by:
      createSubtask in interface Task
    • getParent

      public String getParent()
      Description copied from interface: Task
      Returns the identifier of the task's parent (or null of there is no parent task).
      Specified by:
      getParent in interface Task
    • listSubtasks

      @NotNull public @NotNull List<Task> listSubtasks(boolean persistentOnly, OperationResult parentResult)
      Specified by:
      listSubtasks in interface Task
    • listSubtasksDeeply

      public List<? extends Task> listSubtasksDeeply(OperationResult result)
      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 interface Task
    • listPrerequisiteTasks

      public List<Task> listPrerequisiteTasks(OperationResult parentResult)
      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 interface Task
    • getRawTaskObjectClonedIfNecessary

      @NotNull public @NotNull PrismObject<TaskType> 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 interface Task
    • getDependents

      public List<String> getDependents()
      Description copied from interface: Task
      Lists all explicit dependents' identifiers.
      Specified by:
      getDependents in interface Task
    • listDependents

      public List<Task> listDependents(OperationResult result)
      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 interface Task
    • getParentTask

      public Task getParentTask(OperationResult result)
      Description copied from interface: Task
      Returns the parent task, if any.
      Specified by:
      getParentTask in interface Task
    • getWaitingReason

      public TaskWaitingReasonType getWaitingReason()
      Description copied from interface: Task
      Returns the task waiting reason for a WAITING task.
      Specified by:
      getWaitingReason in interface Task
    • getCompletionTimestamp

      public Long 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 interface Task
    • addExtensionReference

      public void addExtensionReference(PrismReference reference)
      Description copied from interface: Task
      Adds value(s) to a given extension reference.
      Specified by:
      addExtensionReference in interface Task
      Parameters:
      reference - holder of the value(s) to be added into task extension reference
    • listSubtasksDeeply

      public List<Task> listSubtasksDeeply(boolean persistentOnly, OperationResult result)
      Description copied from interface: Task
      Lists all tasks in subtasks tree.
      Specified by:
      listSubtasksDeeply in interface Task
      Parameters:
      persistentOnly - If true, transient subtasks (i.e. lightweight asynchronous tasks) are ignored.
    • getExecutionMode

      @NotNull public @NotNull TaskExecutionMode getExecutionMode()
      Description copied from interface: Task
      Returns the execution mode of this task.
      Specified by:
      getExecutionMode in interface Task
    • 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 interface Task
    • getExpectedTotal

      public Long getExpectedTotal()
      Description copied from interface: Task
      Returns expected total progress.
      Specified by:
      getExpectedTotal in interface Task
    • setExpectedTotal

      public void setExpectedTotal(Long value)
      Description copied from interface: Task
      Stores expected total progress of the task, storing it persistently if needed.
      Specified by:
      setExpectedTotal in interface Task
    • recordStateMessage

      public void recordStateMessage(String message)
      Description copied from interface: StatisticsCollector
      Records a state message.
      Specified by:
      recordStateMessage in interface StatisticsCollector
    • recordNotificationOperation

      public void recordNotificationOperation(String transportName, boolean success, long duration)
      Specified by:
      recordNotificationOperation in interface NotificationStatisticsCollector
    • recordMappingOperation

      public void recordMappingOperation(String objectOid, String objectName, String objectTypeName, String mappingName, long duration)
      Specified by:
      recordMappingOperation in interface MappingStatisticsCollector
    • 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 interface TaskSynchronizationStatisticsCollector
    • 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 that TaskSynchronizationStatisticsCollector.onSynchronizationStart(String, String, SynchronizationSituationType) is called first.
      Specified by:
      onSynchronizationExclusion in interface TaskSynchronizationStatisticsCollector
    • 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 interface TaskSynchronizationStatisticsCollector
    • startCollectingSynchronizationStatistics

      public void startCollectingSynchronizationStatistics(SynchronizationStatisticsCollector collector)
      Description copied from interface: TaskSynchronizationStatisticsCollector
      Starts collecting synchronization statistics within the task. Must be accompanied by corresponding TaskSynchronizationStatisticsCollector.stopCollectingSynchronizationStatistics(QualifiedItemProcessingOutcomeType) call. (Related to the same item!)
      Specified by:
      startCollectingSynchronizationStatistics in interface TaskSynchronizationStatisticsCollector
    • stopCollectingSynchronizationStatistics

      public void stopCollectingSynchronizationStatistics(@NotNull @NotNull QualifiedItemProcessingOutcomeType outcome)
      Specified by:
      stopCollectingSynchronizationStatistics in interface TaskSynchronizationStatisticsCollector
    • 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 interface TaskIterativeOperationCollector
    • recordObjectActionExecuted

      public void recordObjectActionExecuted(String objectName, String objectDisplayName, QName objectType, String objectOid, ChangeType changeType, String channel, Throwable exception)
      Specified by:
      recordObjectActionExecuted in interface TaskActionsExecutedCollector
    • 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 interface TaskActionsExecutedCollector
    • 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 interface TaskActionsExecutedCollector
    • getStoredOperationStatsOrClone

      public OperationStatsType 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 interface Task
    • modify

      public void modify(@NotNull @NotNull ItemDelta<?,?> delta)
      Description copied from interface: Task
      Changes in-memory representation immediately and schedules a corresponding batched modification.
      Specified by:
      modify in interface Task
    • getExecutionConstraints

      public TaskExecutionConstraintsType getExecutionConstraints()
      Description copied from interface: Task
      Returns task execution constraints
      Specified by:
      getExecutionConstraints in interface Task
    • getGroup

      public String getGroup()
      Description copied from interface: Task
      Gets the execution group name (i.e. executionConstraints/group).
      Specified by:
      getGroup in interface Task
    • getGroups

      @NotNull public @NotNull Collection<String> getGroups()
      Description copied from interface: Task
      Returns names of all groups (primary plus all secondary ones).
      Specified by:
      getGroups in interface Task
    • getGroupsWithLimits

      @NotNull public @NotNull Map<String,Integer> getGroupsWithLimits()
      Description copied from interface: Task
      Returns all groups (primary plus all secondary ones) along with task count limits.
      Specified by:
      getGroupsWithLimits in interface Task
    • getWorkState

      public TaskActivityStateType 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 interface Task
    • getActivitiesStateOrClone

      public TaskActivityStateType getActivitiesStateOrClone()
      Description copied from interface: Task
      Gets task work state or its clone (for running tasks). TODO better name
      Specified by:
      getActivitiesStateOrClone in interface Task
    • getContainerableOrClone

      public <C extends Containerable> C getContainerableOrClone(ItemPath path, Class<C> type)
      Description copied from interface: Task
      TODO
      Specified by:
      getContainerableOrClone in interface Task
    • doesItemExist

      public boolean doesItemExist(ItemPath path)
      Description copied from interface: Task
      TODO
      Specified by:
      doesItemExist in interface Task
    • getActivityStateOrClone

      public ActivityStateType getActivityStateOrClone(ItemPath path)
      Description copied from interface: Task
      TODO
      Specified by:
      getActivityStateOrClone in interface Task
    • getParentAndRoot

      @NotNull public @NotNull ParentAndRoot getParentAndRoot(OperationResult result)
      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 a RunningTask.
      Specified by:
      getParentAndRoot in interface Task
    • getAggregatedLiveOperationStats

      public OperationStatsType 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 interface Task
    • getSelfReferenceFull

      @NotNull public @NotNull ObjectReferenceType 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 interface Task
    • getSelfReference

      @NotNull public @NotNull ObjectReferenceType getSelfReference()
      Description copied from interface: Task
      Returns a reference to the task prism. Precondition: Task must be persistent.
      Specified by:
      getSelfReference in interface Task
    • getVersion

      public String getVersion()
      Description copied from interface: Task
      Returns the version of underlying prism object.
      Specified by:
      getVersion in interface Task
    • getPathToRootTask

      public List<Task> getPathToRootTask(OperationResult result)
      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 interface Task
    • getOwnerRef

      public ObjectReferenceType getOwnerRef()
      Description copied from interface: Task
      Returns a reference to the task owner. (Cloned if the task is running.)
      Specified by:
      getOwnerRef in interface Task
    • getCachingProfiles

      @NotNull public @NotNull Collection<String> getCachingProfiles()
      Description copied from interface: Task
      Returns an immutable collection of caching profiles. (From execution environment.)
      Specified by:
      getCachingProfiles in interface Task
    • setExecutionConstraints

      public void setExecutionConstraints(TaskExecutionConstraintsType value)
      Description copied from interface: Task
      Sets task execution constraints.
      Specified by:
      setExecutionConstraints in interface Task
    • getExecutionEnvironment

      public TaskExecutionEnvironmentType getExecutionEnvironment()
      Description copied from interface: Task
      Gets the execution environment configuration. Cloned if running task.
      Specified by:
      getExecutionEnvironment in interface Task
    • setExecutionEnvironment

      public void setExecutionEnvironment(TaskExecutionEnvironmentType value)
      Description copied from interface: Task
      Sets the execution environment configuration.
      Specified by:
      setExecutionEnvironment in interface Task
    • getTracingRequestedFor

      @NotNull public @NotNull Collection<TracingRootType> getTracingRequestedFor()
      Description copied from interface: Task
      Get points for which the tracing is requested (within this task).
      Specified by:
      getTracingRequestedFor in interface Task
    • addTracingRequest

      public void addTracingRequest(TracingRootType point)
      Description copied from interface: Task
      Requests (future) tracing for given tracing point - for this task.
      Specified by:
      addTracingRequest in interface Task
    • removeTracingRequests

      public void removeTracingRequests()
      Description copied from interface: Task
      Removes all tracing requests for this task.
      Specified by:
      removeTracingRequests in interface Task
    • getTracingProfile

      public TracingProfileType 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 interface Task
    • setTracingProfile

      public void setTracingProfile(TracingProfileType tracingProfile)
      Description copied from interface: Task
      Sets the profile to be used for future tracing within this task.
      Specified by:
      setTracingProfile in interface Task
    • registerConnIdOperationsListener

      public void registerConnIdOperationsListener(@NotNull @NotNull ConnIdOperationsListener listener)
      Description copied from interface: Task
      Specified by:
      registerConnIdOperationsListener in interface Task
    • unregisterConnIdOperationsListener

      public void unregisterConnIdOperationsListener(@NotNull @NotNull ConnIdOperationsListener listener)
      Description copied from interface: Task
      Specified by:
      unregisterConnIdOperationsListener in interface Task
    • hasAssignments

      public boolean hasAssignments()
      Description copied from interface: Task
      Returns true if the task has any assignments.
      Specified by:
      hasAssignments in interface Task
    • applyDeltasImmediate

      public void applyDeltasImmediate(Collection<ItemDelta<?,?>> itemDeltas, OperationResult result)
      Specified by:
      applyDeltasImmediate in interface Task
    • applyModificationsTransient

      public void applyModificationsTransient(Collection<ItemDelta<?,?>> modifications)
      Specified by:
      applyModificationsTransient in interface Task
    • startCollectingActionsExecuted

      public void startCollectingActionsExecuted(ActionsExecutedCollector collector)
      Specified by:
      startCollectingActionsExecuted in interface TaskActionsExecutedCollector
    • stopCollectingActionsExecuted

      public void stopCollectingActionsExecuted()
      Specified by:
      stopCollectingActionsExecuted in interface TaskActionsExecutedCollector
    • setSimulationTransaction

      public SimulationTransaction setSimulationTransaction(SimulationTransaction context)
      Description copied from interface: Task
      Sets the current simulation transaction object.
      Specified by:
      setSimulationTransaction in interface Task
    • getSimulationTransaction

      @Nullable public @Nullable SimulationTransaction getSimulationTransaction()
      Description copied from interface: Task
      Returns the current simulation transaction, if there is any.
      Specified by:
      getSimulationTransaction in interface Task
    • getCleanupAfterCompletion

      public Duration getCleanupAfterCompletion()
      Specified by:
      getCleanupAfterCompletion in interface Task
    • setCleanupAfterCompletion

      public void setCleanupAfterCompletion(Duration duration)
      Specified by:
      setCleanupAfterCompletion in interface Task