package uk.ac.ebi.quickgo.index.annotation.coterms;

import uk.ac.ebi.quickgo.annotation.common.document.AnnotationDocument;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.ExitStatus;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.StepExecutionListener;
import org.springframework.batch.item.ItemWriter;

/**
 * Listener to be activated when all annotations have been passed to the co-occurring term aggregation code.
 *
 * @author Tony Wardell
 * Date: 12/09/2016
 * Time: 15:01
 * Created with IntelliJ IDEA.
 */
class CoTermsStepExecutionListener implements StepExecutionListener {

    // logger
    private static final Logger LOGGER = LoggerFactory.getLogger( CoTermsStepExecutionListener.class);

    private final ItemWriter<AnnotationDocument> all;
    private final ItemWriter<AnnotationDocument> manual;

    public CoTermsStepExecutionListener(ItemWriter<AnnotationDocument> all,
            ItemWriter<AnnotationDocument> manual) {
        this.all = all;
        this.manual = manual;
    }

    @Override
    public void beforeStep(StepExecution stepExecution) {
    }

    /**
     * Call finish() on the aggregation instances, so the last accumulating buckets can be processed.
     * Call initialize on calculators so they have the data ready to calculate.
     * @param stepExecution
     * @return 'COMPLETED' once the aggregation code has finished processing.
     */
    @Override
    public ExitStatus afterStep(StepExecution stepExecution) {
        ((CoTermsAggregator)all).finish();
        ((CoTermsAggregator)manual).finish();
        return stepExecution.getExitStatus();
    }
}

@@ -676,126 +676,8 @@
  %7B%0A%0A
-    // logger%0A    private static final Logger LOGGER = LoggerFactory.getLogger( CoTermsStepExecutionListener.class);%0A%0A
     

Remove unused Logger.