|
||||||||||
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(PrismObject<TaskType> taskPrism,
OperationResult parentResult)
Add new task. |
int |
countNodes(ObjectQuery query,
OperationResult result)
|
int |
countTasks(ObjectQuery query,
OperationResult result)
|
Task |
createTaskInstance()
Creates new transient, running, claimed task instance. |
Task |
createTaskInstance(PrismObject<TaskType> taskPrism,
OperationResult parentResult)
Creates task instance from the XML task representation. |
Task |
createTaskInstance(PrismObject<TaskType> taskPrism,
java.lang.String operationName,
OperationResult parentResult)
Creates task instance from the XML task representation. |
Task |
createTaskInstance(java.lang.String operationName)
Creates new transient, running, claimed task instance. |
boolean |
deactivateServiceThreads(long timeToWait,
OperationResult parentResult)
Deactivate service threads (temporarily). |
void |
deleteNode(java.lang.String nodeIdentifier,
OperationResult result)
|
void |
deleteTask(java.lang.String oid,
OperationResult parentResult)
Deletes task with provided OID. |
java.util.List<java.lang.String> |
getAllTaskCategories()
|
java.lang.String |
getHandlerUriForCategory(java.lang.String category)
|
java.lang.Long |
getNextRunStartTime(java.lang.String oid,
OperationResult result)
|
java.lang.String |
getNodeId()
|
java.util.Set<Task> |
getRunningTasks()
Deprecated. |
ClusterStatusInformation |
getRunningTasksClusterwide(long allowedAge,
OperationResult parentResult)
Returns running tasks; fetches new information only if after last query elapsed at least 'allowedAge' milliseconds. |
ClusterStatusInformation |
getRunningTasksClusterwide(OperationResult result)
|
boolean |
getServiceThreadsActivationState()
Returns true if the service threads are running. |
Task |
getTask(java.lang.String taskOid,
OperationResult parentResult)
Returns a task with specified OID. |
boolean |
isCurrentNode(PrismObject<NodeType> node)
|
void |
modifyTask(java.lang.String oid,
java.util.Collection<? extends ItemDelta> modifications,
OperationResult parentResult)
Deprecated. |
void |
onTaskCreate(java.lang.String oid,
OperationResult parentResult)
This is a signal to task manager that a new task was created in the repository. |
void |
onTaskDelete(java.lang.String oid,
OperationResult parentResult)
This is a signal to task manager that a task was removed from the repository. |
void |
postInit(OperationResult result)
Post initialization, e.g. |
void |
reactivateServiceThreads(OperationResult parentResult)
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 |
resumeTask(Task task,
OperationResult parentResult)
Resume suspended task. |
void |
scheduleTaskNow(Task task,
OperationResult parentResult)
|
java.util.List<Node> |
searchNodes(ObjectQuery query,
ClusterStatusInformation clusterStatusInformation,
OperationResult result)
Returns relevant nodes (w.r.t query and paging specification). |
java.util.List<Task> |
searchTasks(ObjectQuery query,
ClusterStatusInformation clusterStatusInformation,
OperationResult result)
Returns relevant tasks (w.r.t. |
void |
shutdown()
Make sure all processes are stopped properly. |
void |
startScheduler(java.lang.String nodeIdentifier,
OperationResult parentResult)
Starts the scheduler on a given node. |
void |
stopScheduler(java.lang.String nodeIdentifier,
OperationResult parentResult)
Stops the scheduler on a given node. |
boolean |
stopSchedulersAndTasks(java.util.List<java.lang.String> nodeList,
long waitTime,
OperationResult parentResult)
|
boolean |
suspendTask(Task task,
long waitTime,
OperationResult parentResult)
Suspend task. |
boolean |
suspendTasks(java.util.Collection<Task> tasks,
long waitTime,
boolean doNotStop,
OperationResult parentResult)
|
boolean |
suspendTasks(java.util.Collection<Task> tasks,
long waitTime,
OperationResult parentResult)
|
void |
switchToBackground(Task task,
OperationResult parentResult)
Switches the provided task to background, making it asynchronous. |
void |
synchronizeTasks(OperationResult parentResult)
|
void |
unpauseTask(Task task,
OperationResult parentResult)
|
java.text.ParseException |
validateCronExpression(java.lang.String cron)
|
Method Detail |
---|
Task createTaskInstance()
Task createTaskInstance(PrismObject<TaskType> taskPrism, OperationResult parentResult) throws SchemaException
taskPrism
- JAXB (XML) representation of the task
SchemaException
- The provided taskType is not compliant to schemaTask createTaskInstance(java.lang.String operationName)
operationName
- operation name to use as a root for new result in task
Task createTaskInstance(PrismObject<TaskType> taskPrism, java.lang.String operationName, OperationResult parentResult) throws SchemaException
taskPrism
- Prism representation of the taskoperationName
- operation name to use as a root for new result in task
SchemaException
- The provided taskType is not compliant to schemaTask 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(PrismObject<TaskType> taskPrism, OperationResult parentResult) throws ObjectAlreadyExistsException, SchemaException
taskPrism
- object to createparentResult
- 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.@Deprecated void modifyTask(java.lang.String oid, java.util.Collection<? extends ItemDelta> modifications, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
oid
- OID of the task to be changedmodifications
- specification of object changesparentResult
- 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, SchemaException
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 applicable
SchemaException
boolean suspendTask(Task task, long waitTime, OperationResult parentResult)
task
- task instance to claimvoid resumeTask(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
task
- task instance to claim
SchemaException
ConcurrencyException
ObjectNotFoundException
void switchToBackground(Task task, OperationResult parentResult)
task
- task to switch to background.java.util.List<Task> searchTasks(ObjectQuery query, ClusterStatusInformation clusterStatusInformation, OperationResult result) throws SchemaException
query
- Search querypaging
- Paging specificationclusterStatusInformation
- If null, the method will query cluster nodes to get up-to-date runtime information.
If non-null, the method will use the provided information. Used to optimize
network traffic in case of repeating calls to searchTasks/searchNodes (e.g. when
displaying them on one page).result
-
SchemaException
int countTasks(ObjectQuery query, OperationResult result) throws SchemaException
SchemaException
java.util.List<Node> searchNodes(ObjectQuery query, ClusterStatusInformation clusterStatusInformation, OperationResult result) throws SchemaException
query
- paging
- clusterStatusInformation
- The same as in searchTasks.result
-
SchemaException
int countNodes(ObjectQuery query, OperationResult result) throws SchemaException
SchemaException
void registerHandler(java.lang.String uri, TaskHandler handler)
void shutdown()
@Deprecated java.util.Set<Task> getRunningTasks() throws TaskManagerException
TaskManagerException
boolean deactivateServiceThreads(long timeToWait, OperationResult parentResult)
void reactivateServiceThreads(OperationResult parentResult)
boolean getServiceThreadsActivationState()
void stopScheduler(java.lang.String nodeIdentifier, OperationResult parentResult)
nodeIdentifier
- Node on which the scheduler should be stopped. Null means current node.void startScheduler(java.lang.String nodeIdentifier, OperationResult parentResult)
nodeIdentifier
- Node on which the scheduler should be started. Null means current node.void onTaskCreate(java.lang.String oid, OperationResult parentResult)
oid
- void onTaskDelete(java.lang.String oid, OperationResult parentResult)
oid
- java.lang.Long getNextRunStartTime(java.lang.String oid, OperationResult result)
ClusterStatusInformation getRunningTasksClusterwide(OperationResult result)
java.lang.String getNodeId()
boolean isCurrentNode(PrismObject<NodeType> node)
java.util.List<java.lang.String> getAllTaskCategories()
void postInit(OperationResult result)
boolean suspendTasks(java.util.Collection<Task> tasks, long waitTime, OperationResult parentResult)
boolean suspendTasks(java.util.Collection<Task> tasks, long waitTime, boolean doNotStop, OperationResult parentResult)
ClusterStatusInformation getRunningTasksClusterwide(long allowedAge, OperationResult parentResult)
allowedAge
-
boolean stopSchedulersAndTasks(java.util.List<java.lang.String> nodeList, long waitTime, OperationResult parentResult)
void synchronizeTasks(OperationResult parentResult)
void deleteNode(java.lang.String nodeIdentifier, OperationResult result)
void scheduleTaskNow(Task task, OperationResult parentResult)
java.lang.String getHandlerUriForCategory(java.lang.String category)
java.text.ParseException validateCronExpression(java.lang.String cron)
void unpauseTask(Task task, OperationResult parentResult) throws ObjectNotFoundException, SchemaException
ObjectNotFoundException
SchemaException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |