Package com.microsoft.azure.batch
Class TaskOperations
- java.lang.Object
-
- com.microsoft.azure.batch.TaskOperations
-
- All Implemented Interfaces:
IInheritedBehaviors
public class TaskOperations extends Object implements IInheritedBehaviors
Performs task-related operations on an Azure Batch account.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 specifiedCloudTask
.CloudTask
getTask(String jobId, String taskId, DetailLevel detailLevel)
Gets the specifiedCloudTask
.CloudTask
getTask(String jobId, String taskId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Gets the specifiedCloudTask
.List<SubtaskInformation>
listSubtasks(String jobId, String taskId)
Lists thesubtasks
of the specified task.List<SubtaskInformation>
listSubtasks(String jobId, String taskId, DetailLevel detailLevel)
Lists thesubtasks
of the specified task.List<SubtaskInformation>
listSubtasks(String jobId, String taskId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Lists thesubtasks
of the specified task.com.microsoft.azure.PagedList<CloudTask>
listTasks(String jobId)
Lists thetasks
of the specified job.com.microsoft.azure.PagedList<CloudTask>
listTasks(String jobId, DetailLevel detailLevel)
Lists thetasks
of the specified job.com.microsoft.azure.PagedList<CloudTask>
listTasks(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Lists thetasks
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.
-
-
-
Method Detail
-
customBehaviors
public Collection<BatchClientBehavior> customBehaviors()
Gets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
customBehaviors
in interfaceIInheritedBehaviors
- Returns:
- A collection of
BatchClientBehavior
instances.
-
withCustomBehaviors
public IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
Sets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
withCustomBehaviors
in interfaceIInheritedBehaviors
- Parameters:
behaviors
- The collection ofBatchClientBehavior
instances.- Returns:
- The current instance.
-
createTask
public void createTask(String jobId, TaskAddParameter taskToAdd) throws BatchErrorException, IOException
Adds a single task to a job.- Parameters:
jobId
- The ID of the job to which to add the task.taskToAdd
- Thetask
to add.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
createTask
public void createTask(String jobId, TaskAddParameter taskToAdd, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Adds a single task to a job.- Parameters:
jobId
- The ID of the job to which to add the task.taskToAdd
- Thetask
to add.additionalBehaviors
- A collection ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
createTasks
public void createTasks(String jobId, List<TaskAddParameter> taskList) throws RuntimeException, InterruptedException
Adds multiple tasks to a job.- Parameters:
jobId
- The ID of the job to which to add the task.taskList
- A list oftasks
to add.- Throws:
RuntimeException
- Exception thrown when an error response is received from the Batch service or any network exception.InterruptedException
- Exception thrown if any thread has interrupted the current thread.
-
createTasks
public void createTasks(String jobId, List<TaskAddParameter> taskList, Iterable<BatchClientBehavior> additionalBehaviors) throws RuntimeException, InterruptedException
Adds multiple tasks to a job.- Parameters:
jobId
- The ID of the job to which to add the task.taskList
- A list oftasks
to add.additionalBehaviors
- A collection ofBatchClientBehavior
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 if any thread has interrupted the current thread.
-
listTasks
public com.microsoft.azure.PagedList<CloudTask> listTasks(String jobId) throws BatchErrorException, IOException
Lists thetasks
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listTasks
public com.microsoft.azure.PagedList<CloudTask> listTasks(String jobId, DetailLevel detailLevel) throws BatchErrorException, IOException
Lists thetasks
of the specified job.- Parameters:
jobId
- The ID of the job.detailLevel
- ADetailLevel
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listTasks
public com.microsoft.azure.PagedList<CloudTask> listTasks(String jobId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists thetasks
of the specified job.- Parameters:
jobId
- The ID of the job.detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listSubtasks
public List<SubtaskInformation> listSubtasks(String jobId, String taskId) throws BatchErrorException, IOException
Lists thesubtasks
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listSubtasks
public List<SubtaskInformation> listSubtasks(String jobId, String taskId, DetailLevel detailLevel) throws BatchErrorException, IOException
Lists thesubtasks
of the specified task.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.detailLevel
- ADetailLevel
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listSubtasks
public List<SubtaskInformation> listSubtasks(String jobId, String taskId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists thesubtasks
of the specified task.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.detailLevel
- ADetailLevel
used for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteTask
public void deleteTask(String jobId, String taskId) throws BatchErrorException, IOException
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteTask
public void deleteTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Deletes the specified task.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.additionalBehaviors
- A collection ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTask
public CloudTask getTask(String jobId, String taskId) throws BatchErrorException, IOException
Gets the specifiedCloudTask
.- 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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTask
public CloudTask getTask(String jobId, String taskId, DetailLevel detailLevel) throws BatchErrorException, IOException
Gets the specifiedCloudTask
.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.detailLevel
- ADetailLevel
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getTask
public CloudTask getTask(String jobId, String taskId, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Gets the specifiedCloudTask
.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.detailLevel
- ADetailLevel
used for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
updateTask
public void updateTask(String jobId, String taskId, TaskConstraints constraints) throws BatchErrorException, IOException
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
updateTask
public void updateTask(String jobId, String taskId, TaskConstraints constraints, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
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 ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
terminateTask
public void terminateTask(String jobId, String taskId) throws BatchErrorException, IOException
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
terminateTask
public void terminateTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Terminates the specified task.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.additionalBehaviors
- A collection ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
reactivateTask
public void reactivateTask(String jobId, String taskId) throws BatchErrorException, IOException
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
reactivateTask
public void reactivateTask(String jobId, String taskId, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
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 ofBatchClientBehavior
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 there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
-