@Override public int getJobInstanceCount(String jobName) throws NoSuchJobException, JobSecurityException { try { int count = jobExplorer.getJobInstanceCount(jobName); if(count <= 0) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } else { return count; } } catch (org.springframework.batch.core.launch.NoSuchJobException e) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } }
@Override public List<JobInstance> getJobInstances(String jobName, int start, int count) throws NoSuchJobException, JobSecurityException { List<org.springframework.batch.core.JobInstance> jobInstances = jobExplorer.getJobInstances(jobName, start, count); if(jobInstances == null || jobInstances.size() == 0) { throw new NoSuchJobException("The job was not found"); } return new ArrayList<>(jobInstances); }
@Override public List<Long> getRunningExecutions(String name) throws NoSuchJobException, JobSecurityException { Set<org.springframework.batch.core.JobExecution> findRunningJobExecutions = jobExplorer.findRunningJobExecutions(name); if(findRunningJobExecutions.isEmpty()) { throw new NoSuchJobException("Job name: " + name + " not found."); } List<Long> results = new ArrayList<>(findRunningJobExecutions.size()); for (org.springframework.batch.core.JobExecution jobExecution : findRunningJobExecutions) { results.add(jobExecution.getId()); } return results; }
@Override public final NoSuchJobException noSuchJobException(final String jobName) { final NoSuchJobException result = new NoSuchJobException(String.format(getLoggingLocale(), noSuchJobException$str(), jobName)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String couldNotFindJobXml = "WFLYBATCH000006: Could not find the job XML file in the deployment: %s";
@Override public List<StepExecution> getStepExecutions(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found"); } Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions(); List<StepExecution> batchExecutions = new ArrayList<>(); if(executions != null) { for (org.springframework.batch.core.StepExecution stepExecution : executions) { if(!stepExecution.getStepName().contains(":partition")) { batchExecutions.add(new JsrStepExecution(jobExplorer.getStepExecution(executionId, stepExecution.getId()))); } } } return batchExecutions; }
@Override public int getJobInstanceCount(String jobName) throws NoSuchJobException, JobSecurityException { try { int count = jobExplorer.getJobInstanceCount(jobName); if(count <= 0) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } else { return count; } } catch (org.springframework.batch.core.launch.NoSuchJobException e) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } }
@Override public int getJobInstanceCount(String jobName) throws NoSuchJobException, JobSecurityException { try { int count = jobExplorer.getJobInstanceCount(jobName); if(count <= 0) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } else { return count; } } catch (org.springframework.batch.core.launch.NoSuchJobException e) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } }
@Override public int getJobInstanceCount(String jobName) throws NoSuchJobException, JobSecurityException { try { int count = jobExplorer.getJobInstanceCount(jobName); if(count <= 0) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } else { return count; } } catch (org.springframework.batch.core.launch.NoSuchJobException e) { throw new NoSuchJobException("No job instances were found for job name " + jobName); } }
@Override public List<JobInstance> getJobInstances(String jobName, int start, int count) throws NoSuchJobException, JobSecurityException { List<org.springframework.batch.core.JobInstance> jobInstances = jobExplorer.getJobInstances(jobName, start, count); if(jobInstances == null || jobInstances.size() == 0) { throw new NoSuchJobException("The job was not found"); } return new ArrayList<JobInstance>(jobInstances); }
@Override public List<JobInstance> getJobInstances(String jobName, int start, int count) throws NoSuchJobException, JobSecurityException { List<org.springframework.batch.core.JobInstance> jobInstances = jobExplorer.getJobInstances(jobName, start, count); if(jobInstances == null || jobInstances.size() == 0) { throw new NoSuchJobException("The job was not found"); } return new ArrayList<JobInstance>(jobInstances); }
@Override public int getJobInstanceCount(String jobName) throws NoSuchJobException, JobSecurityException { final int jobInstanceCount = persistenceManagerService.jobOperatorGetJobInstanceCount(jobName); if (jobInstanceCount > 0) { return jobInstanceCount; } throw new NoSuchJobException("Job " + jobName + " not found"); }
@Override public List<JobInstance> getJobInstances(String jobName, int start, int count) throws NoSuchJobException, JobSecurityException { List<org.springframework.batch.core.JobInstance> jobInstances = jobExplorer.getJobInstances(jobName, start, count); if(jobInstances == null || jobInstances.size() == 0) { throw new NoSuchJobException("The job was not found"); } return new ArrayList<JobInstance>(jobInstances); }
@Override public List<Long> getRunningExecutions(String name) throws NoSuchJobException, JobSecurityException { Set<org.springframework.batch.core.JobExecution> findRunningJobExecutions = jobExplorer.findRunningJobExecutions(name); if(findRunningJobExecutions.isEmpty()) { throw new NoSuchJobException("Job name: " + name + " not found."); } List<Long> results = new ArrayList<Long>(findRunningJobExecutions.size()); for (org.springframework.batch.core.JobExecution jobExecution : findRunningJobExecutions) { results.add(jobExecution.getId()); } return results; }
@Override public List<Long> getRunningExecutions(String name) throws NoSuchJobException, JobSecurityException { Set<org.springframework.batch.core.JobExecution> findRunningJobExecutions = jobExplorer.findRunningJobExecutions(name); if(findRunningJobExecutions.isEmpty()) { throw new NoSuchJobException("Job name: " + name + " not found."); } List<Long> results = new ArrayList<Long>(findRunningJobExecutions.size()); for (org.springframework.batch.core.JobExecution jobExecution : findRunningJobExecutions) { results.add(jobExecution.getId()); } return results; }
@Override public List<Long> getRunningExecutions(String name) throws NoSuchJobException, JobSecurityException { Set<org.springframework.batch.core.JobExecution> findRunningJobExecutions = jobExplorer.findRunningJobExecutions(name); if(findRunningJobExecutions.isEmpty()) { throw new NoSuchJobException("Job name: " + name + " not found."); } List<Long> results = new ArrayList<Long>(findRunningJobExecutions.size()); for (org.springframework.batch.core.JobExecution jobExecution : findRunningJobExecutions) { results.add(jobExecution.getId()); } return results; }
@Override public final NoSuchJobException noSuchJobException(final String jobName) { final NoSuchJobException result = new NoSuchJobException(String.format(getLoggingLocale(), noSuchJobException$str(), jobName)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidConfigProperty = "JBERET000633: Invalid JBeret configuration property %s = %s.";
@Override public final NoSuchJobException noSuchJobException(final String jobName) { final NoSuchJobException result = new NoSuchJobException(String.format(getLoggingLocale(), noSuchJobException$str(), jobName)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String couldNotFindJobXml = "WFLYBATCH000006: Could not find the job XML file in the deployment: %s";
@Override public List<StepExecution> getStepExecutions(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found"); } Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions(); List<StepExecution> batchExecutions = new ArrayList<StepExecution>(); if(executions != null) { for (org.springframework.batch.core.StepExecution stepExecution : executions) { if(!stepExecution.getStepName().contains(":partition")) { batchExecutions.add(new JsrStepExecution(jobExplorer.getStepExecution(executionId, stepExecution.getId()))); } } } return batchExecutions; }
@Override public List<StepExecution> getStepExecutions(long executionId) throws NoSuchJobExecutionException, JobSecurityException { org.springframework.batch.core.JobExecution execution = jobExplorer.getJobExecution(executionId); if(execution == null) { throw new NoSuchJobException("JobExecution with the id " + executionId + " was not found"); } Collection<org.springframework.batch.core.StepExecution> executions = execution.getStepExecutions(); List<StepExecution> batchExecutions = new ArrayList<StepExecution>(); if(executions != null) { for (org.springframework.batch.core.StepExecution stepExecution : executions) { if(!stepExecution.getStepName().contains(":partition")) { batchExecutions.add(new JsrStepExecution(jobExplorer.getStepExecution(executionId, stepExecution.getId()))); } } } return batchExecutions; }
@Override public int getJobInstanceCount(String jobName) throws NoSuchJobException, JobSecurityException { int jobInstanceCount = 0; BatchSecurityHelper helper = getBatchSecurityHelper(); if (isCurrentTagAdmin(helper)) { // Do an unfiltered query jobInstanceCount = persistenceService.jobOperatorGetJobInstanceCount(jobName); } else { jobInstanceCount = persistenceService.jobOperatorGetJobInstanceCount(jobName, helper.getCurrentTag()); } if (jobInstanceCount > 0) { return jobInstanceCount; } else { logger.fine("getJobInstanceCount: Job Name " + jobName + " not found"); throw new NoSuchJobException( "Job " + jobName + " not found"); } }