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

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

Introduction

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

Prototype

public Integer getVersion() 

Source Link

Usage

From source file:org.springframework.yarn.batch.repository.JobRepositoryRemoteService.java

/**
 * Handles synchronizing a job execution.
 *
 * @param request the {@link SynchronizeStatusReq}
 * @return the {@link SynchronizeStatusRes}
 *//*from  w  ww  . ja v  a2s.c o  m*/
private SynchronizeStatusRes handleSynchronizeStatus(SynchronizeStatusReq request) {
    SynchronizeStatusRes response = null;
    try {
        JobExecution jobExecution = JobRepositoryRpcFactory.convertJobExecutionType(request.jobExecution);
        jobExecutionDao.synchronizeStatus(jobExecution);
        response = new SynchronizeStatusRes(jobExecution.getVersion(), jobExecution.getStatus());
    } catch (Exception e) {
        log.error("error handling command", e);
    }
    return response;
}

From source file:org.springframework.yarn.batch.repository.JobRepositoryService.java

private BaseResponseObject handleUpdateWithJobExecutionReq(UpdateWithJobExecutionReq request) {
    UpdateWithJobExecutionRes response = null;
    JobExecution jobExecution = JobRepositoryRpcFactory.convertJobExecutionType(request.jobExecution);
    jobRepository.update(jobExecution);//from   w  w  w.j a  v a 2  s.co  m
    response = new UpdateWithJobExecutionRes();
    response.id = jobExecution.getId();
    response.version = jobExecution.getVersion();
    return response;
}