com.atlassian.mywork.host.rest
Class TaskResource

java.lang.Object
  extended by com.atlassian.mywork.host.rest.TaskResource

public class TaskResource
extends java.lang.Object

This resource provides all the relevant endpoints for anything task-related.


Constructor Summary
TaskResource(LocalTaskService taskService, UserService userManager)
           
 
Method Summary
 javax.ws.rs.core.Response createOrUpdate(javax.servlet.http.HttpServletRequest request, java.io.InputStream requestBody, java.lang.String bypass)
          Create or update an individual task or a list of tasks.
 javax.ws.rs.core.Response delete(javax.servlet.http.HttpServletRequest request, long id, java.lang.String bypass)
          Deletes a single task.
 javax.ws.rs.core.Response delete(javax.servlet.http.HttpServletRequest request, java.lang.String bypass, java.lang.String globalId)
          Deletes a task with the matching globalId.
 javax.ws.rs.core.Response findByUser(javax.servlet.http.HttpServletRequest request, java.lang.String bypass)
          Retrieve all the tasks for the current user.
 javax.ws.rs.core.Response getByGlobalId(javax.servlet.http.HttpServletRequest request, java.lang.String globalId)
          Retrieve a task by a specified globalId.
 javax.ws.rs.core.Response getCount(javax.servlet.http.HttpServletRequest request, java.lang.Boolean completed)
          Retrieve the number of currently assigned tasks.
 javax.ws.rs.core.Response insertBefore(javax.servlet.http.HttpServletRequest request, long id, Position position)
          Re-order a task, inserting it just before another specified one, or at the end of the list if the other specified task id is null.
 javax.ws.rs.core.Response update(javax.servlet.http.HttpServletRequest request, long id, Task task)
          Update a single task.
 javax.ws.rs.core.Response updateNotes(javax.servlet.http.HttpServletRequest request, long id, org.codehaus.jackson.node.TextNode jsonNotes)
          Update notes for a single task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskResource

public TaskResource(LocalTaskService taskService,
                    UserService userManager)
Method Detail

findByUser

public javax.ws.rs.core.Response findByUser(@Context
                                            javax.servlet.http.HttpServletRequest request,
                                            java.lang.String bypass)
Retrieve all the tasks for the current user.

Parameters:
bypass - Optional username for allowing administrators to find tasks on behalf of other users.

getCount

public javax.ws.rs.core.Response getCount(@Context
                                          javax.servlet.http.HttpServletRequest request,
                                          java.lang.Boolean completed)
Retrieve the number of currently assigned tasks.

Parameters:
completed - A flag to indicate whether to include completed tasks or incompleted tasks, defaulting to including all tasks.

createOrUpdate

public javax.ws.rs.core.Response createOrUpdate(@Context
                                                javax.servlet.http.HttpServletRequest request,
                                                java.io.InputStream requestBody,
                                                java.lang.String bypass)
                                         throws java.lang.Exception
Create or update an individual task or a list of tasks.

If there exists a task with the same globalId, the existing task will be updated. Otherwise a new task is created.

Parameters:
bypass - Optional username for allowing administrators to create tasks on behalf of other users.
Throws:
java.lang.Exception

update

public javax.ws.rs.core.Response update(@Context
                                        javax.servlet.http.HttpServletRequest request,
                                        long id,
                                        Task task)
Update a single task.

Parameters:
id - Task id

updateNotes

public javax.ws.rs.core.Response updateNotes(@Context
                                             javax.servlet.http.HttpServletRequest request,
                                             long id,
                                             org.codehaus.jackson.node.TextNode jsonNotes)
Update notes for a single task.

Parameters:
id - Task id

delete

public javax.ws.rs.core.Response delete(@Context
                                        javax.servlet.http.HttpServletRequest request,
                                        long id,
                                        java.lang.String bypass)
Deletes a single task.

Parameters:
bypass - Optional username for allowing administrators to delete tasks on behalf of other users.
id - Task id

delete

public javax.ws.rs.core.Response delete(@Context
                                        javax.servlet.http.HttpServletRequest request,
                                        java.lang.String bypass,
                                        java.lang.String globalId)
Deletes a task with the matching globalId.

Parameters:
bypass - Optional username for allowing administrators to delete tasks on behalf of other users.
globalId - of task to delete.

insertBefore

public javax.ws.rs.core.Response insertBefore(@Context
                                              javax.servlet.http.HttpServletRequest request,
                                              long id,
                                              Position position)
Re-order a task, inserting it just before another specified one, or at the end of the list if the other specified task id is null.

Parameters:
id - Task id

getByGlobalId

public javax.ws.rs.core.Response getByGlobalId(@Context
                                               javax.servlet.http.HttpServletRequest request,
                                               java.lang.String globalId)
                                        throws java.lang.Exception
Retrieve a task by a specified globalId.

Parameters:
globalId - of task
Throws:
java.lang.Exception


Copyright © 2012 Atlassian. All Rights Reserved.