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

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

Introduction

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

Prototype

public int getFilterCount() 

Source Link

Document

Public getter for the filter counter.

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 ava  2  s. c  om
 * @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()));
    }
}