|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TaskManager
Task Manager Interface.
Status: public Stability: DRAFT
Task manager provides controls task execution, coordination, distribution and failover between nodes, etc.
This interface is just a basic framework for task management now. Although we hope that this is roughly almost final shape of the interface, the implementation is not complete and some changes may happen.
This definition specifies interface of Task Manager - a component that controls (asynchronous) task execution.
The task manager can store the task for later execution, switch them to background resume execution of a task from a different node, etc. Generally speaking, task manager provides operation to manage tasks in the whole midPoint cluster of IDM nodes.
This interface partially adheres to [Common Interface Concepts], but the goals are slightly different. This interface should be conveniently used also for tasks that are not persistent (synchronous short tasks). Therefore some methods are made much more user-friendly while tolerating some redundancy in the interface.
Method Summary | |
---|---|
java.lang.String |
addTask(TaskType taskType,
OperationResult parentResult)
Add new task. |
void |
claimTask(Task task,
OperationResult parentResult)
Claim task exclusively for this node. |
Task |
createTaskInstance()
Creates new transient, running, claimed task instance. |
Task |
createTaskInstance(java.lang.String operationName)
Creates new transient, running, claimed task instance. |
Task |
createTaskInstance(TaskType taskType)
Creates task instance from the XML task representation. |
Task |
createTaskInstance(TaskType taskType,
java.lang.String operationName)
Creates task instance from the XML task representation. |
void |
deactivateServiceThreads()
Deactivate service threads (temporarily). |
void |
deleteTask(java.lang.String oid,
OperationResult parentResult)
Deletes task with provided OID. |
java.util.Set<Task> |
getRunningTasks()
Returns tasks that currently run on this node. |
boolean |
getServiceThreadsActivationState()
Returns true if the service threads are running. |
Task |
getTask(java.lang.String taskOid,
OperationResult parentResult)
Returns a task with specified OID. |
java.util.Set<Task> |
listTasks()
Lists all tasks. |
void |
modifyTask(ObjectModificationType objectChange,
OperationResult parentResult)
Modifies task using relative change description. |
void |
reactivateServiceThreads()
Re-activate the service threads after they have been deactivated. |
void |
registerHandler(java.lang.String uri,
TaskHandler handler)
Register a handler for a specified handler URI. |
void |
releaseTask(Task task,
OperationResult parentResult)
Release a claimed task. |
void |
shutdown()
Make sure all processes are stopped properly. |
void |
switchToBackground(Task task,
OperationResult parentResult)
Switches the provided task to background, making it asynchronous. |
Method Detail |
---|
Task createTaskInstance()
Task createTaskInstance(TaskType taskType)
taskType
- JAXB (XML) representation of the task
Task createTaskInstance(java.lang.String operationName)
operationName
- operation name to use as a root for new result in task
Task createTaskInstance(TaskType taskType, java.lang.String operationName)
taskType
- JAXB (XML) representation of the taskoperationName
- operation name to use as a root for new result in task
Task getTask(java.lang.String taskOid, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
taskOid
- OID of the persistent task.
SchemaException
- error dealing with resource schema
ObjectNotFoundException
- wrong OID format, etc.java.lang.String addTask(TaskType taskType, OperationResult parentResult) throws ObjectAlreadyExistsException, SchemaException
object
- object to createscripts
- scripts to execute before/after the operationparentResult
- parent OperationResult (in/out)
ObjectAlreadyExistsException
- object with specified identifiers already exists, cannot add
SchemaException
- error dealing with storage schema, e.g. schema violation
java.lang.IllegalArgumentException
- wrong OID format, etc.void modifyTask(ObjectModificationType objectChange, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
objectChange
- specification of object changesscripts
- scripts that should be executed before of after operationparentResult
- parent OperationResult (in/out)
ObjectNotFoundException
- specified object does not exist
SchemaException
- resulting object would violate the schema
java.lang.IllegalArgumentException
- wrong OID format, described change is not applicablevoid deleteTask(java.lang.String oid, OperationResult parentResult) throws ObjectNotFoundException
oid
- OID of object to deleteparentResult
- parent OperationResult (in/out)
ObjectNotFoundException
- specified object does not exist
java.lang.IllegalArgumentException
- wrong OID format, described change is not applicablevoid claimTask(Task task, OperationResult parentResult) throws ObjectNotFoundException, ConcurrencyException, SchemaException
task
- task instance to claim
SchemaException
ConcurrencyException
ObjectNotFoundException
void releaseTask(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
task
- task instance to release
ObjectNotFoundException
SchemaException
java.lang.IllegalArgumentException
- attempt to release a task that is not claimed.void switchToBackground(Task task, OperationResult parentResult)
task
- task to switch to background.java.util.Set<Task> listTasks()
void registerHandler(java.lang.String uri, TaskHandler handler)
void shutdown()
java.util.Set<Task> getRunningTasks()
void deactivateServiceThreads()
void reactivateServiceThreads()
boolean getServiceThreadsActivationState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |