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<Long> instanceIds = jobOperator.getJobInstanceIds(jobName, 0, Integer.MAX_VALUE - 1);
if (instanceIds != null) {
for (Long instId : instanceIds) {
jobExecutions.addAll(getJobExecutionForInstance(instId));
}
}
} else {
Set<String> jobNames = jobOperator.getJobNames();
if (jobNames != null) {
for (String j : jobOperator.getJobNames()) {
List<Long> instIds = jobOperator.getJobInstanceIds(j, 0, Integer.MAX_VALUE - 1);
if (instIds != null) {
for (long instId : instIds) {
jobExecutions.addAll(getJobExecutionForInstance(instId));
}
}