return jobToInstanceCountMap;
}
private List<JobExecution> findJobExecutions() {
List<JobExecution> jobExecutions = new ArrayList<JobExecution>();
JobOperator jobOperator = BatchRuntime.getJobOperator();
if (executionId != null) {
JobExecution jobExecution = jobOperator.getJobExecution(Long.valueOf(executionId));
if (jobExecution != null)
jobExecutions.add(jobExecution);
} else if (instanceId != null) {
jobExecutions.addAll(getJobExecutionForInstance(Long.valueOf(instanceId)));
} else if (jobName != null) {
List<JobInstance> exe = jobOperator.getJobInstances(jobName, 0, Integer.MAX_VALUE - 1);
if (exe != null) {
for (JobInstance ji : exe) {
jobExecutions.addAll(jobOperator.getExecutions(ji));
}
}
} else {
Set<String> jobNames = jobOperator.getJobNames();
if (jobNames != null) {
for (String jn : jobOperator.getJobNames()) {
List<JobInstance> exe = jobOperator.getJobInstances(jn, 0, Integer.MAX_VALUE - 1);
if (exe != null) {
for (JobInstance ji : exe) {
jobExecutions.addAll(jobOperator.getExecutions(ji));
}
}
}
}
}