Class TaskOperations

    • Method Detail

      • 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 - The task 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.
      • listTasks

        public com.microsoft.azure.PagedList<CloudTask> listTasks​(String jobId)
                                                           throws BatchErrorException,
                                                                  IOException
        Lists the tasks 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 the tasks 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 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 the tasks 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 there is an error in serialization/deserialization of data sent to/received from the Batch service.