com.evolveum.midpoint.task.quartzimpl
Class TaskQuartzImpl

java.lang.Object
  extended by com.evolveum.midpoint.task.quartzimpl.TaskQuartzImpl
All Implemented Interfaces:
Task, Dumpable

public class TaskQuartzImpl
extends java.lang.Object
implements Task

Implementation of a Task. This is very simplistic now. It does not even serialize itself.

Author:
Radovan Semancik
See Also:
TaskManagerQuartzImpl

Method Summary
 void addExtensionProperty(PrismProperty<?> property)
           
 void addPendingModification(ItemDelta<?> delta)
           
 boolean canRun()
          Returns true if the task can run (was not interrupted).
 ItemDelta<?> createExtensionDelta(PrismPropertyDefinition definition, java.lang.Object realValue)
           
 Task createSubtask()
          Creates a subtask
 Node currentlyExecutesAt()
          Returns the node the task is currently executing at, based on real run-time information.
 void deleteExtensionProperty(PrismProperty<?> property)
          Removes specified VALUES of this extension property (not all of its values).
 java.lang.String dump()
          Return human-readable representation of the task content.
 boolean equals(java.lang.Object obj)
           
 void finishHandler(OperationResult parentResult)
           
 TaskBinding getBinding()
           
 java.lang.String getCategory()
          Categories are treated in a special way.
 java.lang.String getCategoryFromHandler()
           
 java.lang.String getChannel()
          Returns change channel URI.
 java.lang.String getDescription()
           
 TaskExecutionStatus getExecutionStatus()
          Returns execution status.
 PrismContainer<?> getExtension()
          Returns task extension.
 PrismProperty<?> getExtension(javax.xml.namespace.QName propertyName)
           
 TaskHandler getHandler()
           
 int getHandlersCount()
           
 java.lang.String getHandlerUri()
          Returns handler URI.
 java.lang.Long getLastRunFinishTimestamp()
          Returns the time when the task last run was finished (or null if the task was not finished yet).
 java.lang.Long getLastRunStartTimestamp()
          Returns the time when the task last run was started (or null if the task was never started).
 ModelOperationStateType getModelOperationState()
           
 PolyStringType getName()
          Returns human-readable name of the task.
 java.lang.Long getNextRunStartTime(OperationResult parentResult)
          Returns the time when the task should start again.
 java.lang.String getNode()
           
<T extends ObjectType>
PrismObject<T>
getObject(java.lang.Class<T> type, OperationResult parentResult)
          Returns object that the task is associated with.
 java.lang.String getObjectOid()
          Returns OID of the object that the task is associated with.
 ObjectReferenceType getObjectRef()
          Returns reference to the object that the task is associated with.
 java.lang.String getOid()
          Returns task OID.
 UriStack getOtherHandlersUriStack()
          Returns the stack of other handlers URIs.
 PrismObject<UserType> getOwner()
          Returns user that owns this task.
 java.lang.String getParent()
           
 TaskPersistenceStatus getPersistenceStatus()
          Returns task persistence status.
 long getProgress()
           
 TaskRecurrence getRecurrenceStatus()
          Returns task recurrence status.
 OperationResult getResult()
          Returns a top-level OperationResult stored in the task.
 OperationResultStatusType getResultStatus()
           
 ScheduleType getSchedule()
          Returns the schedule.
 java.lang.String getTaskIdentifier()
          Returns task (lightweight) identifier.
 PrismObject<TaskType> getTaskPrismObject()
           
 ThreadStopActionType getThreadStopAction()
           
 int hashCode()
           
 boolean isAsynchronous()
          Returns true if the task is asynchronous.
 boolean isCycle()
          Checks whether the task is a cyclic (recurrent) one.
 boolean isLooselyBound()
           
 boolean isPersistent()
           
 boolean isRecreateQuartzTrigger()
           
 boolean isResilient()
          Resilient tasks are those that survive node shutdown.
 boolean isSingle()
          Checks whether the task is single-run.
 boolean isTightlyBound()
           
 boolean isTransient()
           
 void makeRecurrent(ScheduleType schedule)
           
 void makeRecurrentCron(java.lang.String cronLikeSpecification)
           
 void makeRecurrentSimple(int interval)
           
 void makeRunnable()
          Status-changing method.
 void makeSingle()
           
 void makeSingle(ScheduleType schedule)
           
 void makeWaiting()
          Status-changing method.
 void modifyExtension(ItemDelta itemDelta)
           
 void pushHandlerUri(java.lang.String uri, ScheduleType schedule, TaskBinding binding)
           
 void pushHandlerUri(java.lang.String uri, ScheduleType schedule, TaskBinding binding, java.util.Collection<ItemDelta<?>> extensionDeltas)
          Makes (uri, schedule, binding) the current task properties, and pushes current (uri, schedule, binding, extensionChange) onto the stack.
 void pushHandlerUri(java.lang.String uri, ScheduleType schedule, TaskBinding binding, ItemDelta<?> delta)
           
 void refresh(OperationResult parentResult)
          Re-reads the task state from the persistent storage.
 void savePendingModifications(OperationResult parentResult)
          Marks current handler as finished, and removes it from the handler stack.
 void setBinding(TaskBinding value)
           
 void setBindingImmediate(TaskBinding value, OperationResult parentResult)
           
 void setBindingTransient(TaskBinding value)
           
 void setCategory(java.lang.String value)
           
 void setCategoryImmediate(java.lang.String value, OperationResult parentResult)
           
 void setCategoryTransient(java.lang.String value)
           
 void setChannel(java.lang.String value)
          Sets change channel URI.
 void setChannelTransient(java.lang.String name)
           
 void setDescription(java.lang.String value)
           
 void setDescriptionImmediate(java.lang.String value, OperationResult parentResult)
           
 void setDescriptionTransient(java.lang.String name)
           
 void setExecutionStatus(TaskExecutionStatus value)
           
 void setExecutionStatusImmediate(TaskExecutionStatus value, OperationResult parentResult)
           
 void setExecutionStatusTransient(TaskExecutionStatus executionStatus)
           
 void setExtensionProperty(PrismProperty<?> property)
           
 void setExtensionPropertyImmediate(PrismProperty<?> property, OperationResult parentResult)
           
 void setExtensionPropertyTransient(PrismProperty<?> property)
           
 void setHandlerUri(java.lang.String value)
          Sets handler URI.
 void setHandlerUriImmediate(java.lang.String value, OperationResult parentResult)
           
 void setHandlerUriTransient(java.lang.String handlerUri)
           
 void setInitialExecutionStatus(TaskExecutionStatus value)
          Sets task execution status.
 void setLastRunFinishTimestamp(java.lang.Long value)
           
 void setLastRunFinishTimestampImmediate(java.lang.Long value, OperationResult parentResult)
           
 void setLastRunFinishTimestampTransient(java.lang.Long value)
           
 void setLastRunStartTimestamp(java.lang.Long value)
           
 void setLastRunStartTimestampImmediate(java.lang.Long value, OperationResult parentResult)
           
 void setLastRunStartTimestampTransient(java.lang.Long value)
           
 void setModelOperationState(ModelOperationStateType value)
           
 void setModelOperationStateImmediate(ModelOperationStateType value, OperationResult parentResult)
           
 void setModelOperationStateTransient(ModelOperationStateType value)
           
 void setName(PolyStringType value)
          Sets the human-readable name of the task.
 void setNameImmediate(PolyStringType value, OperationResult parentResult)
           
 void setNameTransient(PolyStringType name)
           
 void setNode(java.lang.String value)
           
 void setNodeImmediate(java.lang.String value, OperationResult parentResult)
           
 void setNodeTransient(java.lang.String value)
           
 void setObjectRef(ObjectReferenceType objectRefType)
           
 void setOid(java.lang.String oid)
           
 void setOtherHandlersUriStack(UriStack value)
           
 void setOtherHandlersUriStackImmediate(UriStack value, OperationResult parentResult)
           
 void setOtherHandlersUriStackTransient(UriStack value)
           
 void setOwner(PrismObject<UserType> owner)
           
 void setParent(java.lang.String value)
           
 void setParentImmediate(java.lang.String value, OperationResult parentResult)
           
 void setParentTransient(java.lang.String name)
           
 void setProgress(long value)
          Record progress of the task, storing it persistently if needed.
 void setProgressImmediate(long value, OperationResult parentResult)
           
 void setProgressTransient(long value)
           
 void setRecreateQuartzTrigger(boolean recreateQuartzTrigger)
           
 void setRecurrenceStatus(TaskRecurrence value)
           
 void setRecurrenceStatusImmediate(TaskRecurrence value, OperationResult parentResult)
           
 void setRecurrenceStatusTransient(TaskRecurrence value)
           
 void setResult(OperationResult result)
           
 void setResultImmediate(OperationResult result, OperationResult parentResult)
           
 void setResultStatusType(OperationResultStatusType value)
           
 void setResultStatusTypeImmediate(OperationResultStatusType value, OperationResult parentResult)
           
 void setResultStatusTypeTransient(OperationResultStatusType value)
           
 void setResultTransient(OperationResult result)
           
 void setSchedule(ScheduleType value)
           
 void setScheduleImmediate(ScheduleType value, OperationResult parentResult)
           
 void setThreadStopAction(ThreadStopActionType value)
           
 void setThreadStopActionImmediate(ThreadStopActionType value, OperationResult parentResult)
           
 void signalShutdown()
          Signal the task to shut down.
 boolean stillCanStart()
           
 void synchronizeWithQuartz(OperationResult parentResult)
           
 java.lang.String toString()
           
 TaskRunResult waitForSubtasks(java.lang.Integer interval, java.util.Collection<ItemDelta<?>> extensionDeltas, OperationResult parentResult)
           
 TaskRunResult waitForSubtasks(java.lang.Integer interval, OperationResult parentResult)
          Waits for subtasks to finish.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getTaskPrismObject

public PrismObject<TaskType> getTaskPrismObject()
Specified by:
getTaskPrismObject 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.

Specified by:
isAsynchronous in interface Task
Returns:
true if the task is asynchronous.

isRecreateQuartzTrigger

public boolean isRecreateQuartzTrigger()

setRecreateQuartzTrigger

public void setRecreateQuartzTrigger(boolean recreateQuartzTrigger)

addPendingModification

public void addPendingModification(ItemDelta<?> delta)

savePendingModifications

public void savePendingModifications(OperationResult parentResult)
                              throws ObjectNotFoundException,
                                     SchemaException,
                                     ObjectAlreadyExistsException
Description copied from interface: Task
Marks current handler as finished, and removes it from the handler stack. This method *probably* should be called either implicitly by SingleRunner (after a handler returns from run() method) or explicitly by task handler, in case of CycleRunner. TODO this has to be thought out a bit.

Specified by:
savePendingModifications in interface Task
Throws:
ObjectNotFoundException
SchemaException
ObjectAlreadyExistsException

synchronizeWithQuartz

public void synchronizeWithQuartz(OperationResult parentResult)

getProgress

public long getProgress()
Specified by:
getProgress in interface Task

setProgress

public void setProgress(long value)
Description copied from interface: Task
Record progress of the task, storing it persistently if needed.

Specified by:
setProgress in interface Task

setProgressImmediate

public void setProgressImmediate(long value,
                                 OperationResult parentResult)
                          throws ObjectNotFoundException,
                                 SchemaException
Specified by:
setProgressImmediate in interface Task
Throws:
ObjectNotFoundException
SchemaException

setProgressTransient

public void setProgressTransient(long value)

getResult

public OperationResult getResult()
Description copied from interface: Task
Returns a top-level OperationResult stored in the task.

Specified by:
getResult in interface Task
Returns:
task operation result.

setResult

public void setResult(OperationResult result)
Specified by:
setResult in interface Task

setResultImmediate

public void setResultImmediate(OperationResult result,
                               OperationResult parentResult)
                        throws ObjectNotFoundException,
                               SchemaException
Specified by:
setResultImmediate in interface Task
Throws:
ObjectNotFoundException
SchemaException

setResultTransient

public void setResultTransient(OperationResult result)

getResultStatus

public OperationResultStatusType getResultStatus()
Specified by:
getResultStatus in interface Task

setResultStatusType

public void setResultStatusType(OperationResultStatusType value)

setResultStatusTypeImmediate

public void setResultStatusTypeImmediate(OperationResultStatusType value,
                                         OperationResult parentResult)
                                  throws ObjectNotFoundException,
                                         SchemaException,
                                         ObjectAlreadyExistsException
Throws:
ObjectNotFoundException
SchemaException
ObjectAlreadyExistsException

setResultStatusTypeTransient

public void setResultStatusTypeTransient(OperationResultStatusType value)

getHandlerUri

public java.lang.String getHandlerUri()
Description copied from interface: Task
Returns handler URI. Handler URI 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
Returns:
handler URI

setHandlerUriTransient

public void setHandlerUriTransient(java.lang.String handlerUri)

setHandlerUriImmediate

public void setHandlerUriImmediate(java.lang.String value,
                                   OperationResult parentResult)
                            throws ObjectNotFoundException,
                                   SchemaException
Specified by:
setHandlerUriImmediate in interface Task
Throws:
ObjectNotFoundException
SchemaException

setHandlerUri

public void setHandlerUri(java.lang.String value)
Description copied from interface: Task
Sets handler URI. Handler URI 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:
setHandlerUri in interface Task
Parameters:
value - new handler URI

getOtherHandlersUriStack

public UriStack getOtherHandlersUriStack()
Description copied from interface: Task
Returns the stack of other handlers URIs. The idea is that a task may have a chain of handlers, forming a stack. After a handler at the top of the stack finishes its processing, TaskManager will remove it from the stack and invoke the then-current handler. After that finishes, the next handler will be called, and so on, until the stack is empty.

Specified by:
getOtherHandlersUriStack in interface Task
Returns:

setOtherHandlersUriStackTransient

public void setOtherHandlersUriStackTransient(UriStack value)

setOtherHandlersUriStackImmediate

public void setOtherHandlersUriStackImmediate(UriStack value,
                                              OperationResult parentResult)
                                       throws ObjectNotFoundException,
                                              SchemaException
Throws:
ObjectNotFoundException
SchemaException

setOtherHandlersUriStack

public void setOtherHandlersUriStack(UriStack value)

pushHandlerUri

public void pushHandlerUri(java.lang.String uri,
                           ScheduleType schedule,
                           TaskBinding binding)
Specified by:
pushHandlerUri in interface Task

pushHandlerUri

public void pushHandlerUri(java.lang.String uri,
                           ScheduleType schedule,
                           TaskBinding binding,
                           ItemDelta<?> delta)
Specified by:
pushHandlerUri in interface Task

pushHandlerUri

public void pushHandlerUri(java.lang.String uri,
                           ScheduleType schedule,
                           TaskBinding binding,
                           java.util.Collection<ItemDelta<?>> extensionDeltas)
Makes (uri, schedule, binding) the current task properties, and pushes current (uri, schedule, binding, extensionChange) onto the stack.

Specified by:
pushHandlerUri in interface Task
Parameters:
uri - New Handler URI
schedule - New schedule
binding - New binding

createExtensionDelta

public ItemDelta<?> createExtensionDelta(PrismPropertyDefinition definition,
                                         java.lang.Object realValue)
Specified by:
createExtensionDelta in interface Task

finishHandler

public void finishHandler(OperationResult parentResult)
                   throws ObjectNotFoundException,
                          SchemaException
Specified by:
finishHandler in interface Task
Throws:
ObjectNotFoundException
SchemaException

getHandlersCount

public int getHandlersCount()

getPersistenceStatus

public TaskPersistenceStatus getPersistenceStatus()
Description copied from interface: Task
Returns task persistence status.

Specified by:
getPersistenceStatus in interface Task
Returns:
task persistence status.
See Also:
TaskPersistenceStatus

isPersistent

public boolean isPersistent()
Specified by:
isPersistent in interface Task

isTransient

public boolean isTransient()
Specified by:
isTransient in interface Task

getOid

public java.lang.String getOid()
Description copied from interface: Task
Returns task OID. Only persistent tasks have OID. This returns null if the task is not persistent.

Specified by:
getOid in interface Task
Returns:
task OID

setOid

public void setOid(java.lang.String oid)

getTaskIdentifier

public java.lang.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
Returns:
task (lightweight) identifier

getExecutionStatus

public TaskExecutionStatus getExecutionStatus()
Description copied from interface: Task
Returns execution status.

Specified by:
getExecutionStatus in interface Task
Returns:
execution status.
See Also:
TaskExecutionStatus

setExecutionStatusTransient

public void setExecutionStatusTransient(TaskExecutionStatus executionStatus)

setInitialExecutionStatus

public void setInitialExecutionStatus(TaskExecutionStatus value)
Description copied from interface: Task
Sets task execution status. Can be used only for transient tasks (for safety reasons).

Specified by:
setInitialExecutionStatus in interface Task
Parameters:
value - new task execution status.
See Also:
TaskExecutionStatus

setExecutionStatusImmediate

public void setExecutionStatusImmediate(TaskExecutionStatus value,
                                        OperationResult parentResult)
                                 throws ObjectNotFoundException,
                                        SchemaException
Throws:
ObjectNotFoundException
SchemaException

setExecutionStatus

public void setExecutionStatus(TaskExecutionStatus value)

makeRunnable

public void makeRunnable()
Description copied from interface: Task
Status-changing method. It changes task's execution status to RUNNABLE. Use with care, currently only on transient tasks.

Specified by:
makeRunnable in interface Task

makeWaiting

public void makeWaiting()
Description copied from interface: Task
Status-changing method. It changes task's execution status to WAITING. Use with care, currently only on transient tasks.

Specified by:
makeWaiting in interface Task

getRecurrenceStatus

public TaskRecurrence getRecurrenceStatus()
Description copied from interface: Task
Returns task recurrence status.

Specified by:
getRecurrenceStatus in interface Task
Returns:
task recurrence status

isSingle

public boolean isSingle()
Description copied from interface: Task
Checks whether the task is single-run.

Specified by:
isSingle in interface Task

isCycle

public boolean isCycle()
Description copied from interface: Task
Checks whether the task is a cyclic (recurrent) one.

Specified by:
isCycle in interface Task

setRecurrenceStatus

public void setRecurrenceStatus(TaskRecurrence value)

setRecurrenceStatusImmediate

public void setRecurrenceStatusImmediate(TaskRecurrence value,
                                         OperationResult parentResult)
                                  throws ObjectNotFoundException,
                                         SchemaException
Throws:
ObjectNotFoundException
SchemaException

setRecurrenceStatusTransient

public void setRecurrenceStatusTransient(TaskRecurrence value)

makeSingle

public void makeSingle()
Specified by:
makeSingle in interface Task

makeSingle

public void makeSingle(ScheduleType schedule)
Specified by:
makeSingle in interface Task

makeRecurrent

public void makeRecurrent(ScheduleType schedule)
Specified by:
makeRecurrent in interface Task

makeRecurrentSimple

public void makeRecurrentSimple(int interval)
Specified by:
makeRecurrentSimple in interface Task

makeRecurrentCron

public void makeRecurrentCron(java.lang.String cronLikeSpecification)
Specified by:
makeRecurrentCron in interface Task

getSchedule

public ScheduleType getSchedule()
Description copied from interface: Task
Returns the schedule. Note that if the task is 'single-run' (not recurrent), the schedule is ignored. And the other way around, if the task is recurrent, the schedule must be present (otherwise the results are unpredictable).

Specified by:
getSchedule in interface Task

setSchedule

public void setSchedule(ScheduleType value)

setScheduleImmediate

public void setScheduleImmediate(ScheduleType value,
                                 OperationResult parentResult)
                          throws ObjectNotFoundException,
                                 SchemaException
Throws:
ObjectNotFoundException
SchemaException

getThreadStopAction

public ThreadStopActionType getThreadStopAction()
Specified by:
getThreadStopAction in interface Task

setThreadStopAction

public void setThreadStopAction(ThreadStopActionType value)
Specified by:
setThreadStopAction in interface Task

setThreadStopActionImmediate

public void setThreadStopActionImmediate(ThreadStopActionType value,
                                         OperationResult parentResult)
                                  throws ObjectNotFoundException,
                                         SchemaException
Throws:
ObjectNotFoundException
SchemaException

isResilient

public boolean isResilient()
Description copied from interface: Task
Resilient tasks are those that survive node shutdown. I.e. their ThreadStopAction is either 'restart' or 'reschedule'.

Specified by:
isResilient in interface Task
Returns:

getBinding

public TaskBinding getBinding()
Specified by:
getBinding in interface Task

isTightlyBound

public boolean isTightlyBound()
Specified by:
isTightlyBound in interface Task

isLooselyBound

public boolean isLooselyBound()
Specified by:
isLooselyBound in interface Task

setBinding

public void setBinding(TaskBinding value)
Specified by:
setBinding in interface Task

setBindingImmediate

public void setBindingImmediate(TaskBinding value,
                                OperationResult parentResult)
                         throws ObjectNotFoundException,
                                SchemaException
Specified by:
setBindingImmediate in interface Task
Throws:
ObjectNotFoundException
SchemaException

setBindingTransient

public void setBindingTransient(TaskBinding value)

getOwner

public PrismObject<UserType> getOwner()
Description copied from interface: Task
Returns user 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.

Specified by:
getOwner in interface Task
Returns:
task owner

setOwner

public void setOwner(PrismObject<UserType> owner)
Specified by:
setOwner in interface Task

getChannel

public java.lang.String getChannel()
Description copied from interface: Task
Returns change channel URI.

Specified by:
getChannel in interface Task

setChannel

public void setChannel(java.lang.String value)
Description copied from interface: Task
Sets change channel URI.

Specified by:
setChannel in interface Task

setChannelTransient

public void setChannelTransient(java.lang.String name)

getObjectRef

public ObjectReferenceType getObjectRef()
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:
getObjectRef in interface Task
Returns:

setObjectRef

public void setObjectRef(ObjectReferenceType objectRefType)
Specified by:
setObjectRef in interface Task

getObjectOid

public java.lang.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

getObject

public <T extends ObjectType> PrismObject<T> getObject(java.lang.Class<T> type,
                                                       OperationResult parentResult)
                                            throws ObjectNotFoundException,
                                                   SchemaException
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). This is an optional property. The object will only be returned if the task really contains an object without OID (e.g. unfinished account shadow). In all other cases this method may return null. Use getObjectRef instead. Optional. May return null.

Specified by:
getObject in interface Task
Throws:
ObjectNotFoundException
SchemaException

getName

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

Specified by:
getName in interface Task
Returns:
human-readable name of the 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
Parameters:
value - new human-readable name of the task.

setNameImmediate

public void setNameImmediate(PolyStringType value,
                             OperationResult parentResult)
                      throws ObjectNotFoundException,
                             SchemaException,
                             ObjectAlreadyExistsException
Specified by:
setNameImmediate in interface Task
Throws:
ObjectNotFoundException
SchemaException
ObjectAlreadyExistsException

setNameTransient

public void setNameTransient(PolyStringType name)

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface Task

setDescription

public void setDescription(java.lang.String value)
Specified by:
setDescription in interface Task

setDescriptionImmediate

public void setDescriptionImmediate(java.lang.String value,
                                    OperationResult parentResult)
                             throws ObjectNotFoundException,
                                    SchemaException
Specified by:
setDescriptionImmediate in interface Task
Throws:
ObjectNotFoundException
SchemaException

setDescriptionTransient

public void setDescriptionTransient(java.lang.String name)

getParent

public java.lang.String getParent()
Specified by:
getParent in interface Task

setParent

public void setParent(java.lang.String value)

setParentImmediate

public void setParentImmediate(java.lang.String value,
                               OperationResult parentResult)
                        throws ObjectNotFoundException,
                               SchemaException
Throws:
ObjectNotFoundException
SchemaException

setParentTransient

public void setParentTransient(java.lang.String name)

getExtension

public PrismContainer<?> getExtension()
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. Although this methods returns list, it should be rather regarded as set. The list is used to avoid unnecessary reordering of properties in the storage (in case store is ordering-sensitive).

Specified by:
getExtension in interface Task
Returns:
task extension

getExtension

public PrismProperty<?> getExtension(javax.xml.namespace.QName propertyName)
Specified by:
getExtension in interface Task

setExtensionProperty

public void setExtensionProperty(PrismProperty<?> property)
                          throws SchemaException
Specified by:
setExtensionProperty in interface Task
Throws:
SchemaException

addExtensionProperty

public void addExtensionProperty(PrismProperty<?> property)
                          throws SchemaException
Specified by:
addExtensionProperty in interface Task
Throws:
SchemaException

deleteExtensionProperty

public void deleteExtensionProperty(PrismProperty<?> property)
                             throws SchemaException
Description copied from interface: Task
Removes specified VALUES of this extension property (not all of its values).

Specified by:
deleteExtensionProperty in interface Task
Throws:
SchemaException

modifyExtension

public void modifyExtension(ItemDelta itemDelta)
                     throws SchemaException
Specified by:
modifyExtension in interface Task
Throws:
SchemaException

setExtensionPropertyImmediate

public void setExtensionPropertyImmediate(PrismProperty<?> property,
                                          OperationResult parentResult)
                                   throws ObjectNotFoundException,
                                          SchemaException
Specified by:
setExtensionPropertyImmediate in interface Task
Throws:
ObjectNotFoundException
SchemaException

setExtensionPropertyTransient

public void setExtensionPropertyTransient(PrismProperty<?> property)
                                   throws SchemaException
Throws:
SchemaException

getNode

public java.lang.String getNode()
Specified by:
getNode in interface Task

setNode

public void setNode(java.lang.String value)

setNodeImmediate

public void setNodeImmediate(java.lang.String value,
                             OperationResult parentResult)
                      throws ObjectNotFoundException,
                             SchemaException
Throws:
ObjectNotFoundException
SchemaException

setNodeTransient

public void setNodeTransient(java.lang.String value)

getLastRunStartTimestamp

public java.lang.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).

Specified by:
getLastRunStartTimestamp in interface Task

setLastRunStartTimestamp

public void setLastRunStartTimestamp(java.lang.Long value)

setLastRunStartTimestampImmediate

public void setLastRunStartTimestampImmediate(java.lang.Long value,
                                              OperationResult parentResult)
                                       throws ObjectNotFoundException,
                                              SchemaException
Throws:
ObjectNotFoundException
SchemaException

setLastRunStartTimestampTransient

public void setLastRunStartTimestampTransient(java.lang.Long value)

getLastRunFinishTimestamp

public java.lang.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).

Specified by:
getLastRunFinishTimestamp in interface Task

setLastRunFinishTimestamp

public void setLastRunFinishTimestamp(java.lang.Long value)

setLastRunFinishTimestampImmediate

public void setLastRunFinishTimestampImmediate(java.lang.Long value,
                                               OperationResult parentResult)
                                        throws ObjectNotFoundException,
                                               SchemaException
Throws:
ObjectNotFoundException
SchemaException

setLastRunFinishTimestampTransient

public void setLastRunFinishTimestampTransient(java.lang.Long value)

getNextRunStartTime

public java.lang.Long getNextRunStartTime(OperationResult parentResult)
Description copied from interface: Task
Returns the time when the task should start again. (For non-recurrent tasks it is ignored. For recurrent tasks, null value means 'start immediately', if missed schedule tolerance does not prevent it.)

Specified by:
getNextRunStartTime in interface Task

dump

public java.lang.String dump()
Description copied from interface: Task
Return human-readable representation of the task content. Useful for diagnostics. May return multi-line string.

Specified by:
dump in interface Task
Specified by:
dump in interface Dumpable
Returns:
human-readable representation of the task content

getHandler

public TaskHandler getHandler()

setCategory

public void setCategory(java.lang.String value)
Specified by:
setCategory in interface Task

setCategoryImmediate

public void setCategoryImmediate(java.lang.String value,
                                 OperationResult parentResult)
                          throws ObjectNotFoundException,
                                 SchemaException
Throws:
ObjectNotFoundException
SchemaException

setCategoryTransient

public void setCategoryTransient(java.lang.String value)

getCategory

public java.lang.String getCategory()
Description copied from interface: Task
Categories are treated in a special way. They can be set directly. But if not set directly, they are set on first task execution - determined based on task handler URI. List of categories is in the

Specified by:
getCategory in interface Task
Returns:
See Also:

getCategoryFromHandler

public java.lang.String getCategoryFromHandler()

getModelOperationState

public ModelOperationStateType getModelOperationState()
Specified by:
getModelOperationState in interface Task

setModelOperationState

public void setModelOperationState(ModelOperationStateType value)
Specified by:
setModelOperationState in interface Task

setModelOperationStateImmediate

public void setModelOperationStateImmediate(ModelOperationStateType value,
                                            OperationResult parentResult)
                                     throws ObjectNotFoundException,
                                            SchemaException
Throws:
ObjectNotFoundException
SchemaException

setModelOperationStateTransient

public void setModelOperationStateTransient(ModelOperationStateType value)

refresh

public void refresh(OperationResult parentResult)
             throws ObjectNotFoundException,
                    SchemaException
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
Throws:
ObjectNotFoundException
SchemaException

signalShutdown

public void signalShutdown()
Signal the task to shut down. It may not stop immediately, but it should stop eventually. BEWARE, this method has to be invoked on the same Task instance that is executing. If called e.g. on a Task just retrieved from the repository, it will have no effect whatsoever.


canRun

public boolean canRun()
Description copied from interface: Task
Returns true if the task can run (was not interrupted). Will return false e.g. if shutdown was signaled.

Specified by:
canRun in interface Task
Returns:
true if the task can run

stillCanStart

public boolean stillCanStart()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

currentlyExecutesAt

public Node currentlyExecutesAt()
Description copied from interface: Task
Returns the node the task is currently executing at, based on real run-time information. BEWARE, this information is valid only when returned from searchTasks (not e.g. when got via getTask).

Specified by:
currentlyExecutesAt in interface Task
Returns:

createSubtask

public Task createSubtask()
Description copied from interface: Task
Creates a subtask

Specified by:
createSubtask in interface Task
Returns:

waitForSubtasks

public TaskRunResult waitForSubtasks(java.lang.Integer interval,
                                     OperationResult parentResult)
                              throws ObjectNotFoundException,
                                     SchemaException,
                                     ObjectAlreadyExistsException
Description copied from interface: Task
Waits for subtasks to finish. Executes a special task handler which periodically tests for the completion of this tasks' children. SHOULD BE USED ONLY FROM A TASK HANDLER. Returns a TaskRunResult that should the task handler immediately return (in order to activate newly created 'waiting' task handler).

Specified by:
waitForSubtasks in interface Task
Throws:
ObjectNotFoundException
SchemaException
ObjectAlreadyExistsException

waitForSubtasks

public TaskRunResult waitForSubtasks(java.lang.Integer interval,
                                     java.util.Collection<ItemDelta<?>> extensionDeltas,
                                     OperationResult parentResult)
                              throws ObjectNotFoundException,
                                     SchemaException,
                                     ObjectAlreadyExistsException
Specified by:
waitForSubtasks in interface Task
Throws:
ObjectNotFoundException
SchemaException
ObjectAlreadyExistsException


Copyright © 2012 evolveum. All Rights Reserved.