@Path(value="jobs") @Consumes(value={"application/json","application/xml"}) @Produces(value={"application/json","application/xml"}) public class JobResource extends Object
Constructor and Description |
---|
JobResource() |
Modifier and Type | Method and Description |
---|---|
JobEntity[] |
getJobs()
Gets all jobs known to the current batch runtime.
|
JobExecutionEntity |
restart(String jobXmlName,
javax.ws.rs.core.UriInfo uriInfo,
Properties jobParamsAsProps)
Restarts the most recent job execution of a job name/id, with optional restart
job parameters.
|
org.jberet.schedule.JobSchedule |
schedule(org.jberet.schedule.JobScheduleConfig scheduleConfig) |
javax.ws.rs.core.Response |
start(String jobXmlName,
javax.ws.rs.core.UriInfo uriInfo,
Properties jobParamsAsProps)
Starts a new job execution for the specified
jobXmlName . |
@Path(value="{jobXmlName}/start") @POST public javax.ws.rs.core.Response start(@PathParam(value="jobXmlName") String jobXmlName, @Context javax.ws.rs.core.UriInfo uriInfo, Properties jobParamsAsProps)
jobXmlName
.
Job parameters can be taken from query parameters, obtained from uriInfo
,
or jobParamsAsProps
as java.util.Properties
, or both.
When extracting query parameters from uriInfo
, only the first value of
each key is used. When a key exists in both query parameters and props
,
the latter takes precedence.jobXmlName
- job xml name, which usually is the same as job iduriInfo
- javax.ws.rs.core.UriInfo
that contains query parameters and other infojobParamsAsProps
- job parameters propertiesjavax.ws.rs.core.Response
, which includes response status and newly
started job execution of type JobExecutionEntity
@Path(value="{jobXmlName}/schedule") @POST public org.jberet.schedule.JobSchedule schedule(org.jberet.schedule.JobScheduleConfig scheduleConfig)
@Path(value="{jobXmlName}/restart") @POST public JobExecutionEntity restart(@PathParam(value="jobXmlName") String jobXmlName, @Context javax.ws.rs.core.UriInfo uriInfo, Properties jobParamsAsProps)
Job parameters can be taken from query parameters, obtained from uriInfo
,
or jobParamsAsProps
as java.util.Properties
, or both.
When extracting query parameters from uriInfo
, only the first value of
each key is used. When a key exists in both query parameters and props
,
the latter takes precedence.
Job parameters in the previous job execution that is to be restarted will continue
to be used in the restart job execution. Job parameters (as query parameters or
java.util.Properties
) in the current invocation will complement and
override any same-keyed job parameters.
jobXmlName
- job name/id, whose most recent job execution will be restarteduriInfo
- javax.ws.rs.core.UriInfo
that contains additional query parameters and other infojobParamsAsProps
- additional job parameters propertiesorg.jberet.rest.entity.JobExecutionEntity
for the new job executionstart(String, UriInfo, Properties)
,
JobExecutionResource.restart(long, UriInfo, Properties)
@GET public JobEntity[] getJobs()
org.jberet.rest.entity.JobEntity
known to the batch runtimeCopyright © 2016 JBoss by Red Hat. All rights reserved.