public Job getJob(long jobExecutionId) { if(!registry.containsKey(jobExecutionId)) { throw new NoSuchJobExecutionException("The job execution " + jobExecutionId + " was not found"); } else { return registry.get(jobExecutionId); } } }
@Override public final NoSuchJobExecutionException noSuchJobExecution(final long executionId) { final NoSuchJobExecutionException result = new NoSuchJobExecutionException(String.format(getLoggingLocale(), noSuchJobExecution$str(), executionId)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unrecognizableJobElement = "JBERET000605: Unrecognizable job element: %s in job: %s";
@Override public JobExecution getJobExecution(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution jobExecution = jobExplorer.getJobExecution(executionId); if(jobExecution == null) { throw new NoSuchJobExecutionException("No execution was found for executionId " + executionId); } return new JsrJobExecution(jobExecution, jobParametersConverter); }
public void remove(org.springframework.batch.core.JobExecution jobExecution) { if(!registry.containsKey(jobExecution.getId())) { throw new NoSuchJobExecutionException("The job execution " + jobExecution.getId() + " was not found"); } else { registry.remove(jobExecution.getId()); } }
@Override public Properties getParameters(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobExecutionException("Unable to find the JobExecution for id " + executionId); } Properties properties = jobParametersConverter.getProperties(execution.getJobParameters()); properties.remove(JsrJobParametersConverter.JOB_RUN_ID); return properties; }
@Override public JobInstance getJobInstance(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobExecutionException("The JobExecution was not found"); } return jobExplorer.getJobInstance(execution.getJobInstance().getId()); }
@Override public void abandon(long jobExecutionId) throws NoSuchJobExecutionException, JobExecutionIsRunningException, JobSecurityException { org.springframework.batch.core.JobExecution jobExecution = jobExplorer.getJobExecution(jobExecutionId); if(jobExecution == null) { throw new NoSuchJobExecutionException("Unable to retrieve JobExecution for id " + jobExecutionId); } if(jobExecution.isRunning()) { throw new JobExecutionIsRunningException("Unable to abandon a job that is currently running"); } jobExecution.upgradeStatus(BatchStatus.ABANDONED); jobRepository.update(jobExecution); }
throw new NoSuchJobExecutionException("No JobExecution found for id: [" + executionId + "]"); } else if(previousJobExecution.getStatus().equals(BatchStatus.COMPLETED)) { throw new JobExecutionAlreadyCompleteException("The requested job has already completed");
@Override public JobExecutionEntity getJobExecution(long jobExecutionId) throws NoSuchJobExecutionException { final JobExecutionEntity jobExecution = data.executionInstanceData.get(jobExecutionId); if (jobExecution == null) { throw new NoSuchJobExecutionException("No job execution found for id = " + jobExecutionId); } return jobExecution; }
@Override public JobExecutionEntity call() throws Exception { JobExecutionEntity execution = em.find(JobExecutionEntity.class, jobExecutionId); if (execution == null) { throw new NoSuchJobExecutionException("No job execution found for id = " + jobExecutionId); } return execution; } }.runInNewOrExistingGlobalTran();
public Job getJob(long jobExecutionId) { if(!registry.containsKey(jobExecutionId)) { throw new NoSuchJobExecutionException("The job execution " + jobExecutionId + " was not found"); } else { return registry.get(jobExecutionId); } } }
public Job getJob(long jobExecutionId) { if(!registry.containsKey(jobExecutionId)) { throw new NoSuchJobExecutionException("The job execution " + jobExecutionId + " was not found"); } else { return registry.get(jobExecutionId); } } }
public Job getJob(long jobExecutionId) { if(!registry.containsKey(jobExecutionId)) { throw new NoSuchJobExecutionException("The job execution " + jobExecutionId + " was not found"); } else { return registry.get(jobExecutionId); } } }
@Override public long getJobInstanceIdByExecutionId(final long executionId) throws NoSuchJobExecutionException { final Structures.ExecutionInstanceData executionInstanceData = data.executionInstanceData.get(executionId); if (executionInstanceData == null) { throw new NoSuchJobExecutionException("Execution #" + executionId); } return executionInstanceData.execution.getInstanceId(); }
@Override public JobExecutionEntity call() { JobExecutionEntity exec = entityMgr.find(JobExecutionEntity.class, jobExecutionId); if (exec == null) { throw new NoSuchJobExecutionException("No job execution found for id = " + jobExecutionId); } exec.setLogpath(logDirPath); return exec; } }.runInNewOrExistingGlobalTran();
@Override public JobInstanceEntity getJobInstanceFromExecutionId(long jobExecutionId) throws NoSuchJobExecutionException { final JobExecutionEntity jobExecution = data.executionInstanceData.get(jobExecutionId); if (jobExecution == null) { throw new NoSuchJobExecutionException("No job execution found for id = " + jobExecutionId); } return jobExecution.getJobInstance(); }
@Override public JobExecution getJobExecution(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution jobExecution = jobExplorer.getJobExecution(executionId); if(jobExecution == null) { throw new NoSuchJobExecutionException("No execution was found for executionId " + executionId); } return new JsrJobExecution(jobExecution, jobParametersConverter); }
@Override public JobExecution getJobExecution(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution jobExecution = jobExplorer.getJobExecution(executionId); if(jobExecution == null) { throw new NoSuchJobExecutionException("No execution was found for executionId " + executionId); } return new JsrJobExecution(jobExecution, jobParametersConverter); }
private List<StepExecution> findStepExecutions() throws JobSecurityException, NoSuchJobExecutionException { JobOperator jobOperator = AbstractListCommand.getJobOperatorFromBatchRuntime(); JobExecution je = jobOperator.getJobExecution(Long.parseLong(executionId)); if (!glassFishBatchSecurityHelper.isVisibleToThisInstance(((TaggedJobExecution) je).getTagName())) throw new NoSuchJobExecutionException("No job execution exists for job execution id: " + executionId); List<StepExecution> stepExecutions = jobOperator.getStepExecutions(Long.parseLong(executionId)); if (stepExecutions == null || stepExecutions.size() == 0) throw new NoSuchJobExecutionException("No job execution exists for job execution id: " + executionId); return stepExecutions; }
public void remove(org.springframework.batch.core.JobExecution jobExecution) { if(!registry.containsKey(jobExecution.getId())) { throw new NoSuchJobExecutionException("The job execution " + jobExecution.getId() + " was not found"); } else { registry.remove(jobExecution.getId()); } }