/** * Log the exception message at warn level and stack trace as trace level. * Return response status HttpStatus.NOT_FOUND */ @ExceptionHandler({NoSuchAppRegistrationException.class, NoSuchTaskDefinitionException.class, NoSuchTaskExecutionException.class, NoSuchJobExecutionException.class, NoSuchJobInstanceException.class, NoSuchJobException.class, NoSuchStepExecutionException.class, MetricsMvcEndpoint.NoSuchMetricException.class}) @ResponseStatus(HttpStatus.NOT_FOUND) @ResponseBody public VndErrors onNotFoundException(Exception e) { String logref = logWarnLevelExceptionMessage(e); if (logger.isTraceEnabled()) { logTraceLevelStrackTrace(e); } String msg = getExceptionMessage(e); return new VndErrors(logref, msg); }
/** * Log the exception message at warn level and stack trace as trace level. Return * response status HttpStatus.NOT_FOUND * * @param e one of the exceptions, {@link NoSuchStreamDefinitionException}, * {@link NoSuchAppRegistrationException}, {@link NoSuchTaskDefinitionException}, * {@link NoSuchTaskExecutionException}, {@link NoSuchJobExecutionException}, * {@link NoSuchJobInstanceException}, {@link NoSuchJobException}, * {@link NoSuchStepExecutionException}, * {@link MetricsMvcEndpoint.NoSuchMetricException}, {@link NoSuchAppException}, or * {@link NoSuchAppInstanceException} * @return the error response in JSON format with media type * application/vnd.error+json */ @ExceptionHandler({ NoSuchStreamDefinitionException.class, NoSuchAppRegistrationException.class, NoSuchTaskDefinitionException.class, NoSuchTaskExecutionException.class, NoSuchJobExecutionException.class, NoSuchJobInstanceException.class, NoSuchJobException.class, NoSuchStepExecutionException.class, MetricsMvcEndpoint.NoSuchMetricException.class, NoSuchAppException.class, NoSuchAppInstanceException.class, ApplicationDoesNotExistException.class }) @ResponseStatus(HttpStatus.NOT_FOUND) @ResponseBody public VndErrors onNotFoundException(Exception e) { String logref = logWarnLevelExceptionMessage(e); if (logger.isTraceEnabled()) { logTraceLevelStrackTrace(e); } String msg = getExceptionMessage(e); return new VndErrors(logref, msg); }
public JobInstance getJobInstance(long jobInstanceId) throws NoSuchJobInstanceException { return simpleJobService.getJobInstance(jobInstanceId); }
/** * View the details of a single task instance, specified by id. * * @param id the id of the requested {@link JobInstance} * @return the {@link JobInstance} * @throws NoSuchJobInstanceException if job instance for the id does not exist. * @throws NoSuchJobException if the job for the job instance does not exist. */ @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public JobInstanceResource view(@PathVariable("id") long id) throws NoSuchJobInstanceException, NoSuchJobException { JobInstanceExecutions jobInstance = taskJobService.getJobInstance(id); return jobAssembler.toResource(jobInstance); }
/** * Retrieves a {@link JobInstance} from the JobRepository and matches it with the * associated {@link JobExecution}s. * * @param id the id of the {@link JobInstance} * @return the {@link JobInstanceExecutions} associated with the id. * @throws NoSuchJobInstanceException if job instance id does not exist. * @throws NoSuchJobException if the job for the job instance does not exist. */ JobInstanceExecutions getJobInstance(long id) throws NoSuchJobInstanceException, NoSuchJobException;
/** * Retrieves a {@link JobInstance} from the JobRepository and matches it with the * associated {@link JobExecution}s. * * @param id the id of the {@link JobInstance} * @return the {@link JobInstanceExecutions} associated with the id. */ @Override public JobInstanceExecutions getJobInstance(long id) throws NoSuchJobInstanceException, NoSuchJobException { return getJobInstanceExecution(jobService.getJobInstance(id)); }