@RestController @RequestMapping(value="/batch/executions") @ExposesResourceFor(value=org.springframework.batch.admin.domain.JobExecutionInfoResource.class) public class BatchJobExecutionsController extends AbstractBatchJobsController
jobExecutionInfoResourceAssembler, jobInfoResourceAssembler, jobInstanceInfoResourceAssembler, jobService, progressInfoResourceAssembler, stepExecutionInfoResourceAssembler, timeZone| Constructor and Description |
|---|
BatchJobExecutionsController() |
| Modifier and Type | Method and Description |
|---|---|
Collection<org.springframework.batch.admin.domain.JobExecutionInfoResource> |
executionsForJob(String jobName,
int startJobExecution,
int pageSize)
Return a paged collection of job executions for a given job.
|
org.springframework.batch.admin.domain.JobExecutionInfoResource |
getJobExecutionInfo(long executionId) |
void |
launchJob(String name,
String jobParameters)
Send the request to launch Job.
|
org.springframework.hateoas.PagedResources<org.springframework.batch.admin.domain.JobExecutionInfoResource> |
list(org.springframework.data.domain.Pageable pageable)
List all job executions in a given range.
|
void |
restartJobExecution(long jobExecutionId)
Restart the Job Execution with the given executionId.
|
void |
stopAll()
Stop all job executions.
|
void |
stopJobExecution(long jobExecutionId)
Stop Job Execution by the given executionId.
|
setTimeZone@RequestMapping(value="",
method=GET,
produces="application/json")
@ResponseStatus(value=OK)
public org.springframework.hateoas.PagedResources<org.springframework.batch.admin.domain.JobExecutionInfoResource> list(org.springframework.data.domain.Pageable pageable)
throws org.springframework.batch.core.launch.NoSuchJobException
PageRequest(0, 20) is passed in. See PageableHandlerMethodArgumentResolver
for details.pageable - If not provided will default to page 0 and a page size of 20org.springframework.batch.core.launch.NoSuchJobException@RequestMapping(value="",
method=GET,
params="jobname",
produces="application/json")
@ResponseStatus(value=OK)
public Collection<org.springframework.batch.admin.domain.JobExecutionInfoResource> executionsForJob(@RequestParam(value="jobname")
String jobName,
@RequestParam(defaultValue="0")
int startJobExecution,
@RequestParam(defaultValue="20")
int pageSize)
jobName - name of the jobstartJobExecution - start index for the job execution listpageSize - page size for the list@RequestMapping(value="",
method=POST,
params="jobname")
@ResponseStatus(value=CREATED)
public void launchJob(@RequestParam(value="jobname")
String name,
@RequestParam(required=false)
String jobParameters)
throws org.springframework.batch.core.JobParametersInvalidException,
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException,
org.springframework.batch.core.repository.JobRestartException,
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException,
org.springframework.batch.core.launch.NoSuchJobException
name - the name of the jobjobParameters - the job parameters in comma delimited formorg.springframework.batch.core.JobParametersInvalidExceptionorg.springframework.batch.core.repository.JobExecutionAlreadyRunningExceptionorg.springframework.batch.core.repository.JobRestartExceptionorg.springframework.batch.core.repository.JobInstanceAlreadyCompleteExceptionorg.springframework.batch.core.launch.NoSuchJobException@RequestMapping(value="/{executionId}",
method=GET)
@ResponseStatus(value=OK)
public org.springframework.batch.admin.domain.JobExecutionInfoResource getJobExecutionInfo(@PathVariable
long executionId)
throws org.springframework.batch.core.launch.NoSuchJobExecutionException
executionId - Id of the JobExecutionorg.springframework.batch.core.launch.NoSuchJobExecutionException - Thrown if the JobExecution does not exist@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.JobExecutionNotRunningException,
org.springframework.batch.core.launch.NoSuchJobExecutionException
jobExecutionId - the executionId of the job execution to stoporg.springframework.batch.core.launch.JobExecutionNotRunningExceptionorg.springframework.batch.core.launch.NoSuchJobExecutionException@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,
org.springframework.batch.core.repository.JobExecutionAlreadyRunningException,
org.springframework.batch.core.JobParametersInvalidException,
org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException,
org.springframework.batch.core.repository.JobRestartException,
org.springframework.batch.core.launch.NoSuchJobException
jobExecutionId - the executionId of the job execution to restartorg.springframework.batch.core.launch.NoSuchJobExecutionExceptionorg.springframework.batch.core.repository.JobExecutionAlreadyRunningExceptionorg.springframework.batch.core.JobParametersInvalidExceptionorg.springframework.batch.core.repository.JobInstanceAlreadyCompleteExceptionorg.springframework.batch.core.repository.JobRestartExceptionorg.springframework.batch.core.launch.NoSuchJobException@RequestMapping(value="",
method=PUT,
params="stop=true")
@ResponseStatus(value=OK)
public void stopAll()
Copyright © 2015. All rights reserved.