masterModel.removeJob(jobId, job.getToken()); } catch (JobDoesNotExistException e) { log.debug("job {} was already removed when it hit deadline", jobId, e);
/** * Deletes the job specified by the given id. * * @param id The id of the job to delete. * @param token The optional authorization token. * * @return The response. */ @Path("{id}") @DELETE @Produces(APPLICATION_JSON) @Timed @ExceptionMetered public JobDeleteResponse delete(@PathParam("id") @Valid final JobId id, @QueryParam("token") @DefaultValue("") final String token) { if (!id.isFullyQualified()) { throw badRequest("Invalid id"); } try { model.removeJob(id, token); return new JobDeleteResponse(JobDeleteResponse.Status.OK); } catch (JobDoesNotExistException e) { throw notFound(new JobDeleteResponse(JobDeleteResponse.Status.JOB_NOT_FOUND)); } catch (JobStillDeployedException e) { throw badRequest(new JobDeleteResponse(JobDeleteResponse.Status.STILL_IN_USE)); } catch (TokenVerificationException e) { throw forbidden(new JobDeleteResponse(JobDeleteResponse.Status.FORBIDDEN)); } }
try { log.info("reaping old job '{}'", job.getId()); masterModel.removeJob(jobId, job.getToken()); } catch (Exception e) { log.warn("Failed to reap old job '{}'", jobId, e);
masterModel.removeJob(jobId, job.getToken()); } catch (JobDoesNotExistException e) { log.debug("job {} was already removed when it hit deadline", jobId, e);
/** * Deletes the job specified by the given id. * * @param id The id of the job to delete. * @param token The optional authorization token. * @return The response. */ @Path("{id}") @DELETE @Produces(APPLICATION_JSON) @Timed @ExceptionMetered public JobDeleteResponse delete(@PathParam("id") @Valid final JobId id, @QueryParam("token") @DefaultValue("") final String token) { if (!id.isFullyQualified()) { throw badRequest("Invalid id"); } try { model.removeJob(id, token); return new JobDeleteResponse(JobDeleteResponse.Status.OK); } catch (JobDoesNotExistException e) { throw notFound(new JobDeleteResponse(JobDeleteResponse.Status.JOB_NOT_FOUND)); } catch (JobStillDeployedException e) { throw badRequest(new JobDeleteResponse(JobDeleteResponse.Status.STILL_IN_USE)); } catch (TokenVerificationException e) { throw forbidden(new JobDeleteResponse(JobDeleteResponse.Status.FORBIDDEN)); } }