Example usage for org.springframework.batch.core StepContribution getProcessSkipCount

List of usage examples for org.springframework.batch.core StepContribution getProcessSkipCount

Introduction

In this page you can find the example usage for org.springframework.batch.core StepContribution getProcessSkipCount.

Prototype

public int getProcessSkipCount() 

Source Link

Document

Public getter for the process skip count.

Usage

From source file:es.fcs.batch.integration.chunk.MyRemoteChunkHandlerFactoryBean.java

/**
 * Update a StepContribution with all the data from a StepContributionSource. The filter and write conuts plus the
 * exit status will be updated to reflect the data in the source.
 * /*w  w w.j  a v a  2  s  .c  o  m*/
 * @param contribution the current contribution
 * @param stepContributionSource a source of StepContributions
 */
protected void updateStepContribution(StepContribution contribution,
        StepContributionSource stepContributionSource) {
    for (StepContribution result : stepContributionSource.getStepContributions()) {
        contribution.incrementFilterCount(result.getFilterCount());
        contribution.incrementWriteCount(result.getWriteCount());
        for (int i = 0; i < result.getProcessSkipCount(); i++) {
            contribution.incrementProcessSkipCount();
        }
        for (int i = 0; i < result.getWriteSkipCount(); i++) {
            contribution.incrementWriteSkipCount();
        }
        contribution.setExitStatus(contribution.getExitStatus().and(result.getExitStatus()));
    }
}