@ApplicationScoped public class TaskApi extends Object
| Constructor and Description |
|---|
TaskApi()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
assertCurrentUser(javax.servlet.http.HttpServletRequest httpRequest)
Asserts that a user is logged in and then returns the user's id.
|
TaskType |
claimTask(javax.servlet.http.HttpServletRequest httpRequest,
long taskId)
Called to claim a task.
|
TaskType |
completeTask(TaskDataType taskData,
javax.servlet.http.HttpServletRequest httpRequest,
long taskId)
Called to complete a task.
|
void |
configure() |
TaskType |
failTask(TaskDataType taskData,
javax.servlet.http.HttpServletRequest httpRequest,
long taskId)
Called to fail a task.
|
FindTasksResponse |
findTasks(FindTasksRequest findTasksRequest,
javax.servlet.http.HttpServletRequest httpRequest)
Gets a list of all tasks for the authenticated user.
|
TaskType |
getTask(javax.servlet.http.HttpServletRequest httpRequest,
long taskId)
Fetches a single task by its unique ID.
|
protected void |
handleException(Exception error)
Handles an exception that comes out of one of the task operations.
|
FindTasksResponse |
listTasks(javax.servlet.http.HttpServletRequest httpRequest,
Integer startIndex,
Integer endIndex,
String orderBy,
Boolean orderAscending,
String status,
Integer priority)
Gets a list of all tasks for the authenticated user.
|
TaskType |
releaseTask(javax.servlet.http.HttpServletRequest httpRequest,
long taskId)
Called to release a task.
|
TaskType |
startTask(javax.servlet.http.HttpServletRequest httpRequest,
long taskId)
Called to start a task.
|
TaskType |
stopTask(javax.servlet.http.HttpServletRequest httpRequest,
long taskId)
Called to stop a task.
|
@PostConstruct public void configure()
public FindTasksResponse listTasks(@Context javax.servlet.http.HttpServletRequest httpRequest, Integer startIndex, Integer endIndex, String orderBy, Boolean orderAscending, String status, Integer priority) throws Exception
uri - Exceptionpublic FindTasksResponse findTasks(FindTasksRequest findTasksRequest, @Context javax.servlet.http.HttpServletRequest httpRequest) throws Exception
FindTasksRequest.findTasksRequest - httpRequest - Exceptionpublic TaskType getTask(@Context javax.servlet.http.HttpServletRequest httpRequest, long taskId) throws Exception
httpRequest - taskId - Exceptionpublic TaskType claimTask(@Context javax.servlet.http.HttpServletRequest httpRequest, long taskId) throws Exception
httpRequest - taskId - Exceptionpublic TaskType releaseTask(@Context javax.servlet.http.HttpServletRequest httpRequest, long taskId) throws Exception
httpRequest - taskId - Exceptionpublic TaskType startTask(@Context javax.servlet.http.HttpServletRequest httpRequest, long taskId) throws Exception
httpRequest - taskId - Exceptionpublic TaskType stopTask(@Context javax.servlet.http.HttpServletRequest httpRequest, long taskId) throws Exception
httpRequest - taskId - Exceptionpublic TaskType completeTask(TaskDataType taskData, @Context javax.servlet.http.HttpServletRequest httpRequest, long taskId) throws Exception
taskData - httpRequest - taskId - Exceptionpublic TaskType failTask(TaskDataType taskData, @Context javax.servlet.http.HttpServletRequest httpRequest, long taskId) throws Exception
httpRequest - taskId - Exceptionprotected void handleException(Exception error) throws Exception
error - ExceptionCopyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.