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

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

Introduction

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

Prototype

public int getWriteSkipCount() 

Source Link

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.
 * //from   w ww  .  j a  v a2s  .  co  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()));
    }
}