@Produces(MediaType.APPLICATION_JSON)
@Path("/jobs/{jobId}")
public JobResult removeJob( @PathParam("jobId") String jobId ) {
logger.info( "-----removeJob--- , jobId:" + jobId );
JobResult job = jobs.get( jobId );
if ( job == null ) {
//the job has gone probably because its done and has been removed.
logger.info( "-----removeJob--- , can not find jobId:" + jobId + ", the job has gone probably because its done and has been removed." );
job = new JobResult();
job.setStatus( JobStatus.GONE );
return job;
}
jobs.remove( jobId );
job.setStatus( JobStatus.GONE );
return job;
}