TaskOperations Class

  • java.lang.Object
    • com.microsoft.azure.batch.TaskOperations

Implements

public class TaskOperations
implements IInheritedBehaviors

Performs task-related operations on an Azure Batch account.

Method Summary

Modifier and Type Method and Description
void createTask(String jobId, TaskAddParameter taskToAdd)

Adds a single task to a job.

void createTask(String jobId, TaskAddParameter taskToAdd, Iterable<BatchClientBehavior> additionalBehaviors)

Adds a single task to a job.

void createTasks(String jobId, List<TaskAddParameter> taskList)

Adds multiple tasks to a job.

void createTasks(String jobId, List<TaskAddParameter> taskList, Iterable<BatchClientBehavior> additionalBehaviors)

Adds multiple tasks to a job.

Collection<BatchClientBehavior> customBehaviors()

Gets a collection of behaviors that modify or customize requests to the Batch service.

void deleteTask(String jobId, String taskId)

Deletes the specified task.

void deleteTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors)

Deletes the specified task.

CloudTask getTask(String jobId, String taskId)

Gets the specified CloudTask.

CloudTask getTask(String jobId, String taskId, DetailLevel detailLevel)

Gets the specified CloudTask.

CloudTask getTask(String jobId, String taskId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)

Gets the specified CloudTask.

List<SubtaskInformation> listSubtasks(String jobId, String taskId)

Lists the SubtaskInformation of the specified task.

List<SubtaskInformation> listSubtasks(String jobId, String taskId, DetailLevel detailLevel)

Lists the SubtaskInformation of the specified task.

List<SubtaskInformation> listSubtasks(String jobId, String taskId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)

Lists the SubtaskInformation of the specified task.

com.microsoft.azure.PagedList<CloudTask> listTasks(String jobId)

Lists the CloudTask of the specified job.

com.microsoft.azure.PagedList<CloudTask> listTasks(String jobId, DetailLevel detailLevel)

Lists the CloudTask of the specified job.

com.microsoft.azure.PagedList<CloudTask> listTasks(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)

Lists the CloudTask of the specified job.

void reactivateTask(String jobId, String taskId)

Reactivates a task, allowing it to run again even if its retry count has been exhausted.

void reactivateTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors)

Reactivates a task, allowing it to run again even if its retry count has been exhausted.

void terminateTask(String jobId, String taskId)

Terminates the specified task.

void terminateTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors)

Terminates the specified task.

void updateTask(String jobId, String taskId, TaskConstraints constraints)

Updates the specified task.

void updateTask(String jobId, String taskId, TaskConstraints constraints, Iterable<BatchClientBehavior> additionalBehaviors)

Updates the specified task.

IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)

Sets a collection of behaviors that modify or customize requests to the Batch service.

Methods inherited from java.lang.Object

Method Details

createTask

public void createTask(String jobId, TaskAddParameter taskToAdd)

Adds a single task to a job.

Parameters:

jobId - The ID of the job to which to add the task.
taskToAdd - The TaskAddParameter to add.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

createTask

public void createTask(String jobId, TaskAddParameter taskToAdd, Iterable additionalBehaviors)

Adds a single task to a job.

Parameters:

jobId - The ID of the job to which to add the task.
taskToAdd - The TaskAddParameter to add.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

createTasks

public void createTasks(String jobId, List taskList)

Adds multiple tasks to a job.

Parameters:

jobId - The ID of the job to which to add the task.
taskList - A list of TaskAddParameter to add.

Throws:

RuntimeException

- Exception thrown when an error response is received from the Batch service or any network exception.

InterruptedException

- Exception thrown when an error response is received from the Batch service or any network exception.

createTasks

public void createTasks(String jobId, List taskList, Iterable additionalBehaviors)

Adds multiple tasks to a job.

Parameters:

jobId - The ID of the job to which to add the task.
taskList - A list of TaskAddParameter to add.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

RuntimeException

- Exception thrown when an error response is received from the Batch service or any network exception.

InterruptedException

- Exception thrown when an error response is received from the Batch service or any network exception.

customBehaviors

public Collection customBehaviors()

Gets a collection of behaviors that modify or customize requests to the Batch service.

Returns:

A collection of BatchClientBehavior instances.

deleteTask

public void deleteTask(String jobId, String taskId)

Deletes the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

deleteTask

public void deleteTask(String jobId, String taskId, Iterable additionalBehaviors)

Deletes the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

getTask

public CloudTask getTask(String jobId, String taskId)

Gets the specified CloudTask.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.

Returns:

A CloudTask containing information about the specified Azure Batch task.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

getTask

public CloudTask getTask(String jobId, String taskId, DetailLevel detailLevel)

Gets the specified CloudTask.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.

Returns:

A CloudTask containing information about the specified Azure Batch task.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

getTask

public CloudTask getTask(String jobId, String taskId, DetailLevel detailLevel, Iterable additionalBehaviors)

Gets the specified CloudTask.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Returns:

A CloudTask containing information about the specified Azure Batch task.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listSubtasks

public List listSubtasks(String jobId, String taskId)

Lists the SubtaskInformation of the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.

Returns:

A list of SubtaskInformation objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listSubtasks

public List listSubtasks(String jobId, String taskId, DetailLevel detailLevel)

Lists the SubtaskInformation of the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.

Returns:

A list of SubtaskInformation objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listSubtasks

public List listSubtasks(String jobId, String taskId, DetailLevel detailLevel, Iterable additionalBehaviors)

Lists the SubtaskInformation of the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
detailLevel - A DetailLevel used for controlling which properties are retrieved from the service.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Returns:

A list of SubtaskInformation objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listTasks

public PagedList listTasks(String jobId)

Lists the CloudTask of the specified job.

Parameters:

jobId - The ID of the job.

Returns:

A list of CloudTask objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listTasks

public PagedList listTasks(String jobId, DetailLevel detailLevel)

Lists the CloudTask of the specified job.

Parameters:

jobId - The ID of the job.
detailLevel - A DetailLevel used for filtering the list and for controlling which properties are retrieved from the service.

Returns:

A list of CloudTask objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

listTasks

public PagedList listTasks(String jobId, DetailLevel detailLevel, Iterable additionalBehaviors)

Lists the CloudTask of the specified job.

Parameters:

jobId - The ID of the job.
detailLevel - A DetailLevel used for filtering the list and for controlling which properties are retrieved from the service.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Returns:

A list of CloudTask objects.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

reactivateTask

public void reactivateTask(String jobId, String taskId)

Reactivates a task, allowing it to run again even if its retry count has been exhausted.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

reactivateTask

public void reactivateTask(String jobId, String taskId, Iterable additionalBehaviors)

Reactivates a task, allowing it to run again even if its retry count has been exhausted.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

terminateTask

public void terminateTask(String jobId, String taskId)

Terminates the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

terminateTask

public void terminateTask(String jobId, String taskId, Iterable additionalBehaviors)

Terminates the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

updateTask

public void updateTask(String jobId, String taskId, TaskConstraints constraints)

Updates the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
constraints - Constraints that apply to this task. If null, the task is given the default constraints.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

updateTask

public void updateTask(String jobId, String taskId, TaskConstraints constraints, Iterable additionalBehaviors)

Updates the specified task.

Parameters:

jobId - The ID of the job containing the task.
taskId - The ID of the task.
constraints - Constraints that apply to this task. If null, the task is given the default constraints.
additionalBehaviors - A collection of BatchClientBehavior instances that are applied to the Batch service request.

Throws:

BatchErrorException - Exception thrown when an error response is received from the Batch service.

IOException

- Exception thrown when an error response is received from the Batch service.

withCustomBehaviors

public IInheritedBehaviors withCustomBehaviors(Collection behaviors)

Sets a collection of behaviors that modify or customize requests to the Batch service.

Parameters:

behaviors - The collection of BatchClientBehavior instances.

Returns:

The current instance.

Applies to