|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Task
Task instance - a logical unit of work that is either done synchronously, asynchronously, it is deferred, scheduled, etc. The classes that implement this interface hold a "java" task state. They represent the in-memory task data structure. The instances must be able to serialize the state to the repository object (TaskType) when needed. This usually happens on task "release". The task implementation should be simple Java objects (POJOs). They are created also for a synchronous tasks, which means they are created frequently. We want a low overhead for task management until the task is made asynchronous. TODO: change model. How to propagate task changes down to the repository. attached or detached?
Method Summary | |
---|---|
boolean |
canRun()
Returns true if the task can run (was not interrupted). |
void |
close(OperationResult parentResult)
Close the task. |
java.lang.String |
dump()
Return human-readable representation of the task content. |
OperationResult |
getCurrentResult()
Returns an OperationResult that was marked as the "current". |
TaskExclusivityStatus |
getExclusivityStatus()
Returns task exclusivity status. |
TaskExecutionStatus |
getExecutionStatus()
Returns execution status. |
PropertyContainer |
getExtension()
Returns task extension. |
Property |
getExtension(javax.xml.namespace.QName propertyName)
|
java.lang.String |
getHandlerUri()
Returns handler URI. |
java.lang.Long |
getLastRunFinishTimestamp()
|
java.lang.Long |
getLastRunStartTimestamp()
|
java.lang.String |
getName()
Returns human-readable name of the task. |
ObjectType |
getObject(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. |
TaskPersistenceStatus |
getPersistenceStatus()
Returns task persistence status. |
long |
getProgress()
|
OperationResult |
getResult()
Returns a top-level OperationResult stored in the task. |
ScheduleType |
getSchedule()
|
TaskType |
getTaskTypeObject()
|
boolean |
isAsynchronous()
Returns true if the task is asynchronous. |
boolean |
isCycle()
|
boolean |
isSingle()
|
void |
modifyExtension(java.util.List<PropertyModification> modifications,
OperationResult parentResult)
TODO The modification path is relative to the extension, therefore it will almost always be "." (or null). |
void |
recordRunFinish(TaskRunResult runResult,
OperationResult parentResult)
Record finish of the last "run" of the task TODO: better documentation |
void |
recordRunStart(OperationResult parentResult)
|
void |
refresh(OperationResult parentResult)
Re-reads the task state from the persistent storage. |
void |
setExclusivityStatus(TaskExclusivityStatus exclusivityStatus)
Sets task exclusivity status. |
void |
setExecutionStatus(TaskExecutionStatus executionStatus)
Sets task execution status. |
void |
setHandlerUri(java.lang.String handlerUri)
Sets handler URI. |
void |
setName(java.lang.String name)
Sets the human-readable name of the task. |
void |
setObjectRef(ObjectReferenceType objectRef)
|
void |
setOid(java.lang.String oid)
Sets task OID. |
void |
setPersistenceStatus(TaskPersistenceStatus persistenceStatus)
Sets task persistence status. |
void |
shutdown()
Signal the task to shut down. |
Method Detail |
---|
TaskExecutionStatus getExecutionStatus()
TaskExecutionStatus
void setExecutionStatus(TaskExecutionStatus executionStatus)
executionStatus
- new task execution status.TaskExecutionStatus
TaskPersistenceStatus getPersistenceStatus()
TaskPersistenceStatus
void setPersistenceStatus(TaskPersistenceStatus persistenceStatus)
persistenceStatus
- new task persistence status.TaskPersistenceStatus
TaskExclusivityStatus getExclusivityStatus()
TaskExclusivityStatus
void setExclusivityStatus(TaskExclusivityStatus exclusivityStatus)
exclusivityStatus
- new task exclusivity status.TaskExclusivityStatus
java.lang.String getHandlerUri()
void setHandlerUri(java.lang.String handlerUri)
handlerUri
- new handler URIboolean isAsynchronous()
TaskType getTaskTypeObject()
java.lang.String getOid()
void setOid(java.lang.String oid)
oid
- new task OID.ObjectType getObject(OperationResult parentResult) throws ObjectNotFoundException, SchemaException
SchemaException
ObjectNotFoundException
ObjectReferenceType getObjectRef()
void setObjectRef(ObjectReferenceType objectRef)
java.lang.String getObjectOid()
OperationResult getResult()
OperationResult getCurrentResult()
java.lang.Long getLastRunStartTimestamp()
java.lang.Long getLastRunFinishTimestamp()
java.lang.String getName()
void setName(java.lang.String name)
name
- new human-readable name of the task.long getProgress()
void refresh(OperationResult parentResult) throws ObjectNotFoundException, SchemaException
result
-
SchemaException
ObjectNotFoundException
PropertyContainer getExtension()
Property getExtension(javax.xml.namespace.QName propertyName)
void modifyExtension(java.util.List<PropertyModification> modifications, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
modification
-
SchemaException
ObjectNotFoundException
void recordRunFinish(TaskRunResult runResult, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
runResult
- result of the run to record
SchemaException
ObjectNotFoundException
void recordRunStart(OperationResult parentResult) throws ObjectNotFoundException, SchemaException
ObjectNotFoundException
SchemaException
java.lang.String dump()
void close(OperationResult parentResult) throws ObjectNotFoundException, SchemaException
runnerRunOpResult
-
ObjectNotFoundException
SchemaException
boolean isSingle()
boolean isCycle()
ScheduleType getSchedule()
void shutdown()
boolean canRun()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |