Package com.levigo.jadice.server.rest
Class JobService
- java.lang.Object
-
- com.levigo.jadice.server.rest.JobService
-
- All Implemented Interfaces:
org.springframework.context.Lifecycle
@Path("/jobs/") @Service public class JobService extends Object implements org.springframework.context.Lifecycle
This bean provides the REST service to submit aJob
to jadice server, retrieve its state afterwards.Please consult the swagger documentation for further details about the methods exposed via REST.
- Since:
- jadice server 5.6.0.0
-
-
Constructor Summary
Constructors Constructor Description JobService(JobFactory jobFactory, TemplateRepository templateRepo, ContentStore contentStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
createJob(JobDefinitionDTO jobDefinition, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Submits a new job which will be submitted for execution immediately.ContentStore
getContentStore()
JobFactory
getJobFactory()
JobInformationDTO
getJobInformation(String jobId)
Retrieve the currentJobInformationDTO
about a given Job.TemplateRepository
getTemplateRepository()
TheTemplateRepository
in order to retrieve the available job templatesboolean
isRunning()
void
removeJob(String jobId, javax.servlet.http.HttpServletResponse response)
Remove the information about a job from the REST service.void
setContentStore(ContentStore contentStore)
Configure theContentStore
that contains the files that shall be converted and stores the files that were generated.void
setJobFactory(JobFactory jobFactory)
Configure theJobFactory
which is used to sumbit theJob
to the converting instance of jadice servervoid
setTemplateRepository(TemplateRepository templateRepo)
Configure theTemplateRepository
that contains all avaible job templatesvoid
start()
void
stop()
-
-
-
Constructor Detail
-
JobService
public JobService(JobFactory jobFactory, TemplateRepository templateRepo, ContentStore contentStore)
-
-
Method Detail
-
createJob
@POST @Consumes({"application/xml","application/json"}) @Produces("text/plain") public String createJob(JobDefinitionDTO jobDefinition, @Context javax.servlet.http.HttpServletRequest request, @Context javax.servlet.http.HttpServletResponse response) throws JobException, IOException
Submits a new job which will be submitted for execution immediately.- Throws:
JobException
IOException
-
getJobInformation
@GET @Path("{jobId}") @Produces({"application/xml","application/json"}) public JobInformationDTO getJobInformation(@PathParam("jobId") String jobId)
Retrieve the currentJobInformationDTO
about a given Job. This contains its state as well as the information about the resulting files.
-
removeJob
@DELETE @Path("{jobId}") public void removeJob(@PathParam("jobId") String jobId, @Context javax.servlet.http.HttpServletResponse response) throws JobException
Remove the information about a job from the REST service. It is essential to perform this action after you don't need theJobInformationDTO
anymore.- Throws:
JobException
-
getJobFactory
public JobFactory getJobFactory()
- Returns:
- The
JobFactory
which is used to submit theJob
to the converting instance of jadice server
-
setJobFactory
public void setJobFactory(JobFactory jobFactory)
Configure theJobFactory
which is used to sumbit theJob
to the converting instance of jadice server
-
getContentStore
public ContentStore getContentStore()
- Returns:
- The
ContentStore
that stores the used files
-
setContentStore
public void setContentStore(ContentStore contentStore)
Configure theContentStore
that contains the files that shall be converted and stores the files that were generated.
-
getTemplateRepository
public TemplateRepository getTemplateRepository()
TheTemplateRepository
in order to retrieve the available job templates
-
setTemplateRepository
public void setTemplateRepository(TemplateRepository templateRepo)
Configure theTemplateRepository
that contains all avaible job templates
-
start
public void start()
- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
-