com.atlassian.mywork.service
Interface TaskService

All Known Subinterfaces:
LocalTaskService

public interface TaskService

Provides services related to tasks.


Method Summary
 java.util.concurrent.Future<java.util.List<Task>> createOrUpdate(java.lang.String username, java.util.List<Task> tasks)
          Create or update tasks for the user.
 java.util.concurrent.Future<Task> createOrUpdate(java.lang.String username, Task task)
          Create or update a task for the user.
 void delete(java.lang.String username, java.lang.String globalId)
          Delete a task by username and globalId.
 Task find(java.lang.String username, java.lang.String globalId)
          Find a task by username and globalId.
 java.util.concurrent.Future<Task> markComplete(java.lang.String username, java.lang.String globalId)
          Changes the status of the given task to Status.DONE.
 java.util.concurrent.Future<Task> markIncomplete(java.lang.String username, java.lang.String globalId)
          Changes the status of the given task to Status.TODO.
 java.util.concurrent.Future<Task> setTitle(java.lang.String username, java.lang.String globalId, java.lang.String title)
          Changes the title of the given task.
 

Method Detail

createOrUpdate

java.util.concurrent.Future<Task> createOrUpdate(java.lang.String username,
                                                 Task task)
Create or update a task for the user.

If another task already exists with the same globalId the existing task will be updated. Otherwise a new task will be created.

Parameters:
username - username of the user to create the task for
task - task to create
Returns:
Future containing the created task

createOrUpdate

java.util.concurrent.Future<java.util.List<Task>> createOrUpdate(java.lang.String username,
                                                                 java.util.List<Task> tasks)
Create or update tasks for the user.

If another task already exists with the same globalId the existing task will be updated. Otherwise a new task will be created.

Parameters:
username - username of the user to create the tasks for
tasks - tasks to create
Returns:
Future containing the created tasks

delete

void delete(java.lang.String username,
            java.lang.String globalId)
Delete a task by username and globalId.

Parameters:
username - username of the user that owns the task
globalId - globalId of the task to delete

find

Task find(java.lang.String username,
          java.lang.String globalId)
Find a task by username and globalId.

Parameters:
username - username of the user that owns the task
globalId - globalId of the task to find
Returns:
task with the given globalId and owned by the user or null if not found

markComplete

java.util.concurrent.Future<Task> markComplete(java.lang.String username,
                                               java.lang.String globalId)
Changes the status of the given task to Status.DONE.

Parameters:
username - username of the user that owns the task
globalId - globalId of the task to mark completed
Returns:
Future containing the completed task

markIncomplete

java.util.concurrent.Future<Task> markIncomplete(java.lang.String username,
                                                 java.lang.String globalId)
Changes the status of the given task to Status.TODO.

Parameters:
username - username of the user that owns the task
globalId - globalId of the task to mark as incomplete
Returns:
Future containing the incomplete task

setTitle

java.util.concurrent.Future<Task> setTitle(java.lang.String username,
                                           java.lang.String globalId,
                                           java.lang.String title)
Changes the title of the given task.

Parameters:
username - username of the user that owns the task
globalId - globalId of the task
title - title to use
Returns:
Future containing the updated task


Copyright © 2012 Atlassian. All Rights Reserved.