001/* 002 * Copyright 2007 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 */ 016package org.kuali.ole.gl.batch.service; 017 018import java.io.PrintStream; 019import java.util.List; 020 021import org.kuali.ole.gl.batch.CollectorBatch; 022import org.kuali.ole.gl.report.CollectorReportData; 023import org.kuali.ole.gl.service.impl.CollectorScrubberStatus; 024import org.kuali.ole.sys.batch.BatchInputFileType; 025 026/** 027 * Provides methods for processing gl incoming batch files. 028 */ 029public interface CollectorHelperService { 030 031 /** 032 * Loads the file given by the filename, then performs the collector process: parse, validate, store, email. 033 * 034 * @param fileName - name of file to load (including path) 035 * @param group the group into which to persist the origin entries for the collector batch/file 036 * @param collectorReportData the object used to store all of the collector status information for reporting 037 * @param collectorScrubberStatuses if the collector scrubber is able to be invoked upon this collector batch, then the status 038 * info of the collector status run is added to the end of this list 039 * @param the output stream to which to store origin entries that properly pass validation 040 * @return boolean - true if load was successful, false if errors were encountered 041 */ 042 public boolean loadCollectorFile(String fileName, CollectorReportData collectorReportData, List<CollectorScrubberStatus> collectorScrubberStatuses, BatchInputFileType collectorInputFileType, PrintStream originEntryOutputPs); 043 044 /** 045 * Validates the contents of a parsed file. 046 * 047 * @param batch - batch to validate 048 * @return boolean - true if validation was OK, false if there were errors 049 */ 050 public boolean performValidation(CollectorBatch batch); 051 052 /** 053 * Reconciles the trailer total count and amount to the actual parsed contents. 054 * 055 * @param batch - batch to check trailer 056 * @param collectorReportData if running the actual collector batch process, should be the object representing the reporting 057 * data for the batch run. Otherwise, if running in the batch upload screen or in a manner in which reporting information 058 * is not needed, then null may be passed in 059 * @return boolean - true if trailer check was OK, false if totals did not match 060 */ 061 public boolean checkTrailerTotals(CollectorBatch batch, CollectorReportData collectorReportData); 062 063}