001    /*
002     * Copyright 2011 The Kuali Foundation.
003     * 
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     * 
008     * http://www.opensource.org/licenses/ecl2.php
009     * 
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.kfs.gl.batch.service;
017    
018    import java.io.PrintStream;
019    import java.util.List;
020    
021    import org.kuali.kfs.gl.batch.CollectorBatch;
022    import org.kuali.kfs.gl.businessobject.OriginEntryGroup;
023    import org.kuali.kfs.gl.report.CollectorReportData;
024    import org.kuali.kfs.gl.service.impl.CollectorScrubberStatus;
025    import org.kuali.kfs.sys.batch.BatchInputFileType;
026    
027    /**
028     * Provides methods for processing gl incoming batch files.
029     */
030    public interface CollectorHelperService {
031    
032        /**
033         * Loads the file given by the filename, then performs the collector process: parse, validate, store, email.
034         * 
035         * @param fileName - name of file to load (including path)
036         * @param group the group into which to persist the origin entries for the collector batch/file
037         * @param collectorReportData the object used to store all of the collector status information for reporting
038         * @param collectorScrubberStatuses if the collector scrubber is able to be invoked upon this collector batch, then the status
039         *        info of the collector status run is added to the end of this list
040         * @param the output stream to which to store origin entries that properly pass validation
041         * @return boolean - true if load was successful, false if errors were encountered
042         */
043        public boolean loadCollectorFile(String fileName, CollectorReportData collectorReportData, List<CollectorScrubberStatus> collectorScrubberStatuses, BatchInputFileType collectorInputFileType, PrintStream originEntryOutputPs);
044    
045        /**
046         * Validates the contents of a parsed file.
047         * 
048         * @param batch - batch to validate
049         * @return boolean - true if validation was OK, false if there were errors
050         */
051        public boolean performValidation(CollectorBatch batch);
052    
053        /**
054         * Reconciles the trailer total count and amount to the actual parsed contents.
055         * 
056         * @param batch - batch to check trailer
057         * @param collectorReportData if running the actual collector batch process, should be the object representing the reporting
058         *        data for the batch run. Otherwise, if running in the batch upload screen or in a manner in which reporting information
059         *        is not needed, then null may be passed in
060         * @return boolean - true if trailer check was OK, false if totals did not match
061         */
062        public boolean checkTrailerTotals(CollectorBatch batch, CollectorReportData collectorReportData);
063    
064    }