org.springframework.cloud.dataflow.server.controller

## Class JobExecutionController

- java.lang.Object
- - org.springframework.cloud.dataflow.server.controller.JobExecutionController

-     @RestController
       @RequestMapping(value="/jobs/executions")
       @ExposesResourceFor(value=JobExecutionResource.class)
      public class JobExecutionController
      extends Object

  Controller for operations on `JobExecution`. This includes obtaining Job execution information from the job explorer.
  Author:
    Glenn Renfro, Gunnar Hillert

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobExecutionController(TaskJobService taskJobService)` Creates a `JobExecutionController` that retrieves Job Execution information from a the `JobService`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `restartJobExecution(long jobExecutionId)` Restart the Job Execution with the given jobExecutionId.
    `org.springframework.hateoas.PagedModel<JobExecutionResource>` | `retrieveJobsByParameters(String jobName, org.springframework.batch.core.BatchStatus status, org.springframework.data.domain.Pageable pageable, org.springframework.data.web.PagedResourcesAssembler<TaskJobExecution> assembler)` Retrieve all task job executions with the task name specified
    `void` | `stopJobExecution(long jobExecutionId)` Stop a Job Execution with the given jobExecutionId.
    `JobExecutionResource` | `view(long id)` View the details of a single task execution, specified by id.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JobExecutionController

          public JobExecutionController(TaskJobService taskJobService)

      Creates a `JobExecutionController` that retrieves Job Execution information from a the `JobService`
      Parameters:
        `taskJobService` - the service this controller will use for retrieving job execution information. Must not be null.

  - ### Method Detail

    - #### retrieveJobsByParameters

          @RequestMapping(value="",
                          method=GET,
                          produces="application/json")
           @ResponseStatus(value=OK)
          public org.springframework.hateoas.PagedModel<JobExecutionResource> retrieveJobsByParameters(@RequestParam(value="name",required=false)
                                                                                                                                                                                                                                     String jobName,
                                                                                                                                                                                                                                     @RequestParam(value="status",required=false)
                                                                                                                                                                                                                                     org.springframework.batch.core.BatchStatus status,
                                                                                                                                                                                                                                     org.springframework.data.domain.Pageable pageable,
                                                                                                                                                                                                                                     org.springframework.data.web.PagedResourcesAssembler<TaskJobExecution> assembler)
                                                                                                                                                                                                                              throws org.springframework.batch.core.launch.NoSuchJobException,
                                                                                                                                                                                                                                     org.springframework.batch.core.launch.NoSuchJobExecutionException

      Retrieve all task job executions with the task name specified
      Parameters:
        `jobName` - name of the job. SQL server specific wildcards are enabled (eg.: myJob%, m_Job, ...)
        `pageable` - page-able collection of `TaskJobExecution`s.
        `assembler` - for the `TaskJobExecution`s
      Returns:
        list task/job executions with the specified jobName.
      Throws:
        `org.springframework.batch.core.launch.NoSuchJobException` - if the job with the given name does not exist.
        `org.springframework.batch.core.launch.NoSuchJobExecutionException`

    - #### view

          @RequestMapping(value="/{id}",
                          method=GET,
                          produces="application/json")
           @ResponseStatus(value=OK)
          public JobExecutionResource view(@PathVariable(value="id")
                                                                                                                                                                              long id)
                                                                                                                                                                       throws org.springframework.batch.core.launch.NoSuchJobExecutionException

      View the details of a single task execution, specified by id.
      Parameters:
        `id` - the id of the requested `JobExecution`
      Returns:
        the `JobExecution`
      Throws:
        `org.springframework.batch.core.launch.NoSuchJobExecutionException` - if the specified job execution for the id does not exist.

    - #### stopJobExecution

          @RequestMapping(value="/{executionId}",
                          method=PUT,
                          params="stop=true")
           @ResponseStatus(value=OK)
          public void stopJobExecution(@PathVariable(value="executionId")
                                                                                                                                                                          long jobExecutionId)
                                                                                                                                                                   throws org.springframework.batch.core.launch.NoSuchJobExecutionException,
                                                                                                                                                                          org.springframework.batch.core.launch.JobExecutionNotRunningException

      Stop a Job Execution with the given jobExecutionId. Please be aware that you must provide the request parameter `stop=true` in order to invoke this endpoint.
      Parameters:
        `jobExecutionId` - the executionId of the job execution to stop.
      Throws:
        `org.springframework.batch.core.launch.JobExecutionNotRunningException` - if a stop is requested on a job that is not running.
        `org.springframework.batch.core.launch.NoSuchJobExecutionException` - if the job execution id specified does not exist.

    - #### restartJobExecution

          @RequestMapping(value="/{executionId}",
                          method=PUT,
                          params="restart=true")
           @ResponseStatus(value=OK)
          public void restartJobExecution(@PathVariable(value="executionId")
                                                                                                                                                                                long jobExecutionId)
                                                                                                                                                                         throws org.springframework.batch.core.launch.NoSuchJobExecutionException

      Restart the Job Execution with the given jobExecutionId. Please be aware that you must provide the request parameter `restart=true` in order to invoke this endpoint.
      Parameters:
        `jobExecutionId` - the executionId of the job execution to restart
      Throws:
        `org.springframework.batch.core.launch.NoSuchJobExecutionException` - if the job execution for the jobExecutionId specified does not exist.

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.