com.xebialabs.deployit.engine.api
Interface TaskService


public interface TaskService

Manages tasks on the Deployit Server.


Method Summary
 void abort(java.lang.String taskId)
          Aborts an active task.
 TaskWithSteps addPause(java.lang.String taskId, int stepId)
          Add a pause step at the specified position.
 void archive(java.lang.String taskId)
          Archive an executed task.
 TaskState assign(java.lang.String taskId, java.lang.String owner)
          Assigns a task to a different user.
 void cancel(java.lang.String taskId)
          Cancels a stopped task.
 java.util.List<TaskWithSteps> export(org.joda.time.LocalDate begin, org.joda.time.LocalDate end)
          Searches for tasks with detailed step information.
 java.util.List<TaskState> getAllCurrentTasks()
          Returns all active tasks for all users.
 java.util.List<TaskState> getMyCurrentTasks()
          Returns the active tasks of the logged in user.
 StepState getStep(java.lang.String taskId, int stepId, org.joda.time.DateTime ifModifiedSince)
          Retrieves information about a step.
 TaskWithSteps getSteps(java.lang.String taskId)
          Returns a task containing step information.
 TaskState getTask(java.lang.String taskId)
          Returns a task by ID.
 TaskWithSteps moveStep(java.lang.String taskId, int stepId, int newPosition)
          Moves a step.
 java.util.List<TaskState> query(org.joda.time.LocalDate begin, org.joda.time.LocalDate end)
          Searches for tasks without step information.
 TaskWithSteps skip(java.lang.String taskId, java.util.List<java.lang.Integer> stepIds)
          Indicates that one or more steps should be skipped.
 void start(java.lang.String taskId)
          Starts a task.
 void stop(java.lang.String taskId)
          Gracefully stops an active task.
 TaskWithSteps unskip(java.lang.String taskId, java.util.List<java.lang.Integer> stepIds)
          Indicates that one or more steps should no longer be skipped, but executed.
 

Method Detail

getMyCurrentTasks

java.util.List<TaskState> getMyCurrentTasks()
Returns the active tasks of the logged in user.

Returns:
a list of tasks.

getAllCurrentTasks

java.util.List<TaskState> getAllCurrentTasks()
Returns all active tasks for all users. Only allowed for admin.

Returns:
a list of tasks.

getTask

TaskState getTask(java.lang.String taskId)
Returns a task by ID.

Parameters:
taskId - the ID of the task
Returns:
the task.

getSteps

TaskWithSteps getSteps(java.lang.String taskId)
Returns a task containing step information.

Parameters:
taskId - the ID of the task
Returns:
a task with full step information.

getStep

StepState getStep(java.lang.String taskId,
                  int stepId,
                  @HeaderParam(value="If-Modified-Since")
                  org.joda.time.DateTime ifModifiedSince)
Retrieves information about a step.

Parameters:
taskId - the ID of the task
stepId - the ordinal number of the step, starting from 1
ifModifiedSince - the if-modified-since date in RFC 1123 (RFC 822 with 4-digit years) date format.
Returns:
if the step has not been modified since ifModifiedSince, a response with status code of 304 (Not Modified), otherwise a response with a status code of 200 (OK) and XML containing a StepState.

start

void start(java.lang.String taskId)
Starts a task.

Parameters:
taskId - the ID of the task

stop

void stop(java.lang.String taskId)
Gracefully stops an active task.

Parameters:
taskId - the ID of the task

abort

void abort(java.lang.String taskId)
Aborts an active task.

Parameters:
taskId - the ID of the task

cancel

void cancel(java.lang.String taskId)
Cancels a stopped task.

Parameters:
taskId - the ID of the task

archive

void archive(java.lang.String taskId)
Archive an executed task.

Parameters:
taskId - the ID of the task

skip

TaskWithSteps skip(java.lang.String taskId,
                   java.util.List<java.lang.Integer> stepIds)
Indicates that one or more steps should be skipped.

Parameters:
taskId - the ID of the task
stepIds - the IDs of the steps to skip
Returns:
a task with full step information.

unskip

TaskWithSteps unskip(java.lang.String taskId,
                     java.util.List<java.lang.Integer> stepIds)
Indicates that one or more steps should no longer be skipped, but executed.

Parameters:
taskId - the ID of the task
stepIds - the IDs of the steps to unskip
Returns:
a task with full step information.

moveStep

TaskWithSteps moveStep(java.lang.String taskId,
                       int stepId,
                       int newPosition)
Moves a step.

Parameters:
taskId - the ID of the task
stepId - the current position of the step in the step list.
newPosition - the new position of the step in the step list.
Returns:
a task with full step information.

addPause

TaskWithSteps addPause(java.lang.String taskId,
                       int stepId)
Add a pause step at the specified position.

Parameters:
taskId - the ID of the task
stepId - the position of the step in the step list.
Returns:
a task with full step information.

assign

TaskState assign(java.lang.String taskId,
                 java.lang.String owner)
Assigns a task to a different user.

Parameters:
taskId - the ID of the task
owner - the name of the user that will be the new owner of the task.
Returns:
the task.

query

java.util.List<TaskState> query(org.joda.time.LocalDate begin,
                                org.joda.time.LocalDate end)
Searches for tasks without step information.

Parameters:
begin - The first day we want to see tasks from, or null for no such limit.
end - The last day we want to see tasks from, or null for no such limit.
Returns:
a list of tasks.

export

java.util.List<TaskWithSteps> export(org.joda.time.LocalDate begin,
                                     org.joda.time.LocalDate end)
Searches for tasks with detailed step information.

Parameters:
begin - The first day we want to see tasks from, or null for no such limit.
end - The last day we want to see tasks from, or null for no such limit.
Returns:
a list of tasks with step information.