Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.project
Interface TaskManager

All Superinterfaces:
JiveManager

public interface TaskManager
extends JiveManager

This manager provides methods to load tasks by ID and to retrieve lists of tasks. Once a handle on a task is obtained one can use the methods in this interface to update or delete a task or otherwise modify the task.

See Also:
Task

Method Summary
 void cleanupUserTasks(User user)
          Deletes or disassociates tasks for the given user.
 com.jivesoftware.community.project.Task create(Project project, User creator, User owner, String subject, String body, Date dueDate)
          Creates a new task within the provided project.
 void create(User user, Project project, List<com.jivesoftware.community.project.Task> tasks)
          Creates new tasks in a batch.
 com.jivesoftware.community.project.Task create(User user, String subject, String body, Date dueDate)
          Creates a new personal task.
 void delete(com.jivesoftware.community.project.Task task)
          Delete a task.
 com.jivesoftware.community.project.Task getTask(long taskID)
          Retrieves the task with the given id
 int getTaskCount()
          Returns a count of all the incomplete tasks in the system.
 int getTaskCount(com.jivesoftware.community.project.TaskResultFilter taskResultFilter)
          Returns a count of all the incomplete tasks in the system that match the provided result filter.
 JiveIterator<com.jivesoftware.community.project.Task> getTasks()
          Returns a system wide iterator of incomplete tasks.
 JiveIterator<com.jivesoftware.community.project.Task> getTasks(com.jivesoftware.community.project.TaskResultFilter taskResultFilter)
          Returns an iterator of tasks that match the provided result filter.
 void update(com.jivesoftware.community.project.Task task)
          Persist updates to a task to storage
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy
 

Method Detail

create

com.jivesoftware.community.project.Task create(Project project,
                                               User creator,
                                               User owner,
                                               String subject,
                                               String body,
                                               Date dueDate)
                                               throws UnauthorizedException
Creates a new task within the provided project. A task has a subject, both a creator and owner (the task's assignee) and a dueDate.

Parameters:
project - the project that the task is to be created within
creator - the user who is creating the task
owner - the user assigned to complete the task
subject - the subject describing the task
body - the body describing the task
dueDate - the date that the task is due to be completed
Returns:
a new task
Throws:
UnauthorizedException - if not allowed to create tasks within the project

create

com.jivesoftware.community.project.Task create(User user,
                                               String subject,
                                               String body,
                                               Date dueDate)
                                               throws UnauthorizedException
Creates a new personal task. A task has a subject, both a creator and owner (the task's assignee) and a dueDate. In this case the owner of the task is automatically set to be the user the task is being created for.

Parameters:
user - the user the task is being created for
subject - the subject describing the task
body - the body describing the task
dueDate - the date that the task is due to be completed
Returns:
a new task
Throws:
UnauthorizedException - if not allowed to create a personal task for the user

create

void create(User user,
            Project project,
            List<com.jivesoftware.community.project.Task> tasks)
            throws UnauthorizedException
Creates new tasks in a batch.

Parameters:
user - the user creating the tasks
tasks - the tasks to persist
Throws:
UnauthorizedException - if not allowed to create tasks within the project.

getTask

com.jivesoftware.community.project.Task getTask(long taskID)
                                                throws NotFoundException,
                                                       UnauthorizedException
Retrieves the task with the given id

Parameters:
taskID - the id of the task to retrieve
Returns:
the task with the given id
Throws:
NotFoundException - if no task can be found with the given id
UnauthorizedException - if not allowed to retrieve the task

getTaskCount

int getTaskCount()
Returns a count of all the incomplete tasks in the system. To retrieve a count of all the tasks in the system that include completed tasks use the getTaskCount(TaskResultFilter) method with a filter that has TaskResultFilter#setOnlyIncomplete(boolean) set to false.

Returns:
a count of all the incomplete tasks in the system

getTaskCount

int getTaskCount(com.jivesoftware.community.project.TaskResultFilter taskResultFilter)
Returns a count of all the incomplete tasks in the system that match the provided result filter.

Parameters:
taskResultFilter - the result filter to filter task results with
Returns:
a count of all the tasks in the system that match the provided result filter

getTasks

JiveIterator<com.jivesoftware.community.project.Task> getTasks()
Returns a system wide iterator of incomplete tasks. To retrieve all the tasks in the system that include completed tasks use the getTasks(TaskResultFilter) method with a filter that has TaskResultFilter#setOnlyIncomplete(boolean) set to false.

Returns:
a system wide iterator of incomplete tasks

getTasks

JiveIterator<com.jivesoftware.community.project.Task> getTasks(com.jivesoftware.community.project.TaskResultFilter taskResultFilter)
Returns an iterator of tasks that match the provided result filter.

Parameters:
taskResultFilter - the result filter to filter task results with
Returns:
an iterator of tasks that match the provided result filter

update

void update(com.jivesoftware.community.project.Task task)
            throws UnauthorizedException
Persist updates to a task to storage

Parameters:
task - the task to persist updates for
Throws:
UnauthorizedException - if not allowed to update the task

delete

void delete(com.jivesoftware.community.project.Task task)
            throws UnauthorizedException
Delete a task.

Parameters:
task - the task to delete
Throws:
UnauthorizedException - if not allowed to delete the task

cleanupUserTasks

void cleanupUserTasks(User user)
Deletes or disassociates tasks for the given user.

The user is removed from any tasks in which given user is the designated assignor

All of the personal tasks owned by the user are deleted.

All of the project tasks owned by the user are unassigned.

All tasks created by the user are deleted.

All projects owned by the user will be reassigned to another task creator.

Parameters:
user - the user associated with the tasks being modifed or deleted
Throws:
UnauthorizedException - if not a system admin

Clearspace Project Page

Copyright © 1999-2007 Jive Software.