1 /* 2 * Copyright 2007 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.ole.gl.batch.service; 17 18 import java.io.PrintStream; 19 import java.util.List; 20 21 import org.kuali.ole.gl.batch.CollectorBatch; 22 import org.kuali.ole.gl.report.CollectorReportData; 23 import org.kuali.ole.gl.service.impl.CollectorScrubberStatus; 24 import org.kuali.ole.sys.batch.BatchInputFileType; 25 26 /** 27 * Provides methods for processing gl incoming batch files. 28 */ 29 public interface CollectorHelperService { 30 31 /** 32 * Loads the file given by the filename, then performs the collector process: parse, validate, store, email. 33 * 34 * @param fileName - name of file to load (including path) 35 * @param group the group into which to persist the origin entries for the collector batch/file 36 * @param collectorReportData the object used to store all of the collector status information for reporting 37 * @param collectorScrubberStatuses if the collector scrubber is able to be invoked upon this collector batch, then the status 38 * info of the collector status run is added to the end of this list 39 * @param the output stream to which to store origin entries that properly pass validation 40 * @return boolean - true if load was successful, false if errors were encountered 41 */ 42 public boolean loadCollectorFile(String fileName, CollectorReportData collectorReportData, List<CollectorScrubberStatus> collectorScrubberStatuses, BatchInputFileType collectorInputFileType, PrintStream originEntryOutputPs); 43 44 /** 45 * Validates the contents of a parsed file. 46 * 47 * @param batch - batch to validate 48 * @return boolean - true if validation was OK, false if there were errors 49 */ 50 public boolean performValidation(CollectorBatch batch); 51 52 /** 53 * Reconciles the trailer total count and amount to the actual parsed contents. 54 * 55 * @param batch - batch to check trailer 56 * @param collectorReportData if running the actual collector batch process, should be the object representing the reporting 57 * data for the batch run. Otherwise, if running in the batch upload screen or in a manner in which reporting information 58 * is not needed, then null may be passed in 59 * @return boolean - true if trailer check was OK, false if totals did not match 60 */ 61 public boolean checkTrailerTotals(CollectorBatch batch, CollectorReportData collectorReportData); 62 63 }