Example usage for org.springframework.batch.core JobExecution addStepExecutions

List of usage examples for org.springframework.batch.core JobExecution addStepExecutions

Introduction

In this page you can find the example usage for org.springframework.batch.core JobExecution addStepExecutions.

Prototype

public void addStepExecutions(List<StepExecution> stepExecutions) 

Source Link

Document

Add some step executions.

Usage

From source file:org.trpr.platform.batch.impl.spring.admin.repository.MapStepExecutionDao.java

@Override
public void addStepExecutions(JobExecution jobExecution) {
    Map<Long, StepExecution> executions = executionsByJobExecutionId.get(jobExecution.getId());
    if (executions == null || executions.isEmpty()) {
        return;//from   w  w  w  . j ava2  s  . c om
    }
    List<StepExecution> result = new ArrayList<StepExecution>(executions.values());
    Collections.sort(result, new Comparator<Entity>() {

        @Override
        public int compare(Entity o1, Entity o2) {
            return Long.signum(o2.getId() - o1.getId());
        }
    });

    List<StepExecution> copy = new ArrayList<StepExecution>(result.size());
    for (StepExecution exec : result) {
        copy.add(copy(exec));
    }
    jobExecution.addStepExecutions(copy);
}