Package com.adobe.granite.taskmanagement
Interface TaskManager
-
@ProviderType public interface TaskManager
TaskManager defines the task management API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
completeTask(java.lang.String taskId, java.lang.String actionId)
Completes the task with the given id and action.Task
createTask(Task task)
Creates a task.Task
createTask(java.lang.String parentTaskId, Task task)
Creates a subtask under the specified parentTaskidvoid
deleteTask(java.lang.String taskId)
Deletes the task with the given task ID.Task
getTask(java.lang.String taskId)
Retrieves a fully populated task instance for the given task id.Task
getTask(java.lang.String taskId, boolean retrieveSubTasks)
Retrieves the task identified by taskId and opotionally retrieves the task's subtasks.Task
getTaskByUUID(java.lang.String taskUUID)
Retrieves a fully populated task instance for the given task id.TaskManagerFactory
getTaskManagerFactory()
Returns a task manager factory to instantiate various objects of the taskmanager interface like Task and TaskAction.java.util.Iterator<Task>
getTasks(Filter filter)
Same as callinggetTasks(Filter, int, int)
with startIndex of 0, and length of -1 Used as a convenience for calls that do not need to limit the number of tasks being returnedjava.util.Iterator<Task>
getTasks(Filter filter, int startIndex, int length)
returns all tasks for the specified task type, or all tasks if no tasktype specified.Task
saveTask(Task task)
Saves the given task instance.void
terminateTask(java.lang.String taskId)
Terminates the task
-
-
-
Method Detail
-
createTask
Task createTask(Task task) throws TaskManagerException
Creates a task. note that if no task id is provided one will be created and assigned to the resulting task. Optionally if a task id is provided then the task id will be used for the new task unless that task id exists already in the system in which case an exception will be thrown for the duplicate task id.- Parameters:
task
- Task to create- Returns:
- newly created task instance
- Throws:
TaskManagerException
- An error occurred creating the task.
-
createTask
Task createTask(java.lang.String parentTaskId, Task task) throws TaskNotFoundException, TaskManagerException
Creates a subtask under the specified parentTaskid- Parameters:
parentTaskId
- the id of the parent tasktask
- the task to create- Returns:
- the newly created task instance
- Throws:
TaskNotFoundException
- if the parent task specified is not foundTaskManagerException
- an error occurred creating the task.
-
getTasks
java.util.Iterator<Task> getTasks(Filter filter, int startIndex, int length) throws TaskManagerException
returns all tasks for the specified task type, or all tasks if no tasktype specified.
Tasks assigned to the currently logged in user are returned. Note that a task's subtasks are not populated by this method.- Parameters:
filter
- Only tasks matching the conditions in this filter are returned in the resulting iterator.startIndex
- The index of the first task returned. This value must be > 0length
- The maximum number of tasks returned. This value must be non-zero. A negative value indicates all results are to be returned- Returns:
- tasks matching the filter and paging information.
- Throws:
TaskManagerException
- An error occurred retrieving the tasks.
-
getTasks
java.util.Iterator<Task> getTasks(Filter filter) throws TaskManagerException
Same as callinggetTasks(Filter, int, int)
with startIndex of 0, and length of -1 Used as a convenience for calls that do not need to limit the number of tasks being returned- Parameters:
filter
- Only tasks matching the conditions in this filter are returned in the resulting iterator.- Returns:
- tasks matching the filter
- Throws:
TaskManagerException
- An error occurred retrieving the tasks
-
getTask
Task getTask(java.lang.String taskId) throws TaskManagerException
Retrieves a fully populated task instance for the given task id.- Parameters:
taskId
- String containing a task id.- Returns:
- Task instance retrieved for the given task id.
- Throws:
TaskManagerException
- An error occurred retrieving the task instance.
-
getTaskByUUID
Task getTaskByUUID(java.lang.String taskUUID) throws TaskManagerException
Retrieves a fully populated task instance for the given task id.- Parameters:
taskUUID
- String containing a task UUID- Returns:
- Task instance retrieved for the given task id.
- Throws:
TaskManagerException
- An error occurred retrieving the task instance.
-
getTask
Task getTask(java.lang.String taskId, boolean retrieveSubTasks) throws TaskManagerException
Retrieves the task identified by taskId and opotionally retrieves the task's subtasks.- Parameters:
taskId
- String containing a task id.retrieveSubTasks
- true to retrieve this task's subtasks, false otherwise.- Returns:
- Task instance for the given taskId
- Throws:
TaskManagerException
- an error occurred retrieving the task instance.
-
saveTask
Task saveTask(Task task) throws TaskNotFoundException, TaskManagerException
Saves the given task instance. Note that subtasks will not be updated by this call. Note: you cannot complete a task with this method; to complete a task callcompleteTask(String, String)
- Parameters:
task
- Task instance to save.- Returns:
- Saved copy of the given Task instance.
- Throws:
TaskNotFoundException
- The task being saved could not be foundTaskManagerException
- An error occurred saving the task instance.
-
deleteTask
void deleteTask(java.lang.String taskId) throws TaskNotFoundException, TaskManagerException
Deletes the task with the given task ID.- Parameters:
taskId
- String containing the ID of the task to delete.- Throws:
TaskNotFoundException
- The task being saved could not be foundTaskManagerException
- An error occurred deleting the task instance.
-
completeTask
void completeTask(java.lang.String taskId, java.lang.String actionId) throws TaskNotFoundException, TaskManagerException
Completes the task with the given id and action.- Parameters:
taskId
- String containing the ID of the task to complete.actionId
- the Id of the action to complete the task with, or null.- Throws:
TaskNotFoundException
- The task being completed could not be foundTaskManagerException
- An error occurred completing the task instance.
-
terminateTask
void terminateTask(java.lang.String taskId) throws TaskNotFoundException, TaskManagerException
Terminates the task- Parameters:
taskId
- String containing the ID of the task to complete.- Throws:
TaskNotFoundException
- The task being completed could not be foundTaskManagerException
- An error occurred completing the task instance.
-
getTaskManagerFactory
TaskManagerFactory getTaskManagerFactory()
Returns a task manager factory to instantiate various objects of the taskmanager interface like Task and TaskAction.- Returns:
- instance of TaskManagerFactory
- See Also:
TaskManagerFactory
-
-