1 /* 2 * Copyright 2007-2009 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.File; 19 20 import org.kuali.ole.gl.businessobject.Balance; 21 import org.kuali.ole.gl.businessobject.LedgerBalanceHistory; 22 import org.kuali.ole.gl.businessobject.OriginEntryInformation; 23 24 25 /** 26 * Interface for BalancingService 27 */ 28 public interface BalancingService { 29 /** 30 * Handle for batch processes to kick off balancing 31 * @return boolean true when success 32 */ 33 public boolean runBalancing(); 34 35 /** 36 * @return input poster file. Returns null if no file found. 37 */ 38 public abstract File getPosterInputFile(); 39 40 /** 41 * @return output poster error file. Returns null if no file found. 42 */ 43 public abstract File getPosterErrorOutputFile(); 44 45 /** 46 * @return input reversal file. Returns null if no file found. 47 */ 48 public abstract File getReversalInputFile(); 49 50 /** 51 * @return output reversal error file. Returns null if no file found. 52 */ 53 public abstract File getReversalErrorOutputFile(); 54 55 /** 56 * @return input ICR file. Returns null if no file found. 57 */ 58 public abstract File getICRInputFile(); 59 60 /** 61 * @return output ICR error file. Returns null if no file found. 62 */ 63 public abstract File getICRErrorOutputFile(); 64 65 /** 66 * @return system parameter for NUMBER_OF_PAST_FISCAL_YEARS_TO_CONSIDER 67 */ 68 public abstract int getPastFiscalYearsToConsider(); 69 70 /** 71 * @return system parameter for NUMBER_OF_COMPARISON_FAILURES_TO_PRINT_PER_REPORT 72 */ 73 public abstract int getComparisonFailuresToPrintPerReport(); 74 75 /** 76 * @param businessObjectName name of the BO for which to return the label 77 * @return functional short labels for tables affected in this process 78 */ 79 public abstract String getShortTableLabel(String businessObjectName); 80 81 /** 82 * Gets an OriginEntryInformation for the parsed line. This needs to be handled separately for GL and Labor because Labor is a special case 83 * of GL (positionNumber + emplid). Could be done with an OriginEntryHistory interface but in the interest of not mucking with 84 * OriginEntries the is done with delegation. 85 * @param inputLine line that was read from getPosterInputFilename 86 * @param lineNumber line number we are currently reading from getPosterInputFilename 87 * @return parsed line into an object as per inputLine parameter 88 */ 89 public abstract OriginEntryInformation getOriginEntry(String inputLine, int lineNumber); 90 91 /** 92 * Update the entry history table 93 * @param mode of post, e.g. MODE_REVERSAL 94 * @param originEntry representing the update details 95 */ 96 public abstract void updateEntryHistory(Integer postMode, OriginEntryInformation originEntry); 97 98 /** 99 * Updates the balance history table 100 * @param originEntry representing the update details 101 */ 102 public abstract void updateBalanceHistory(Integer postMode, OriginEntryInformation originEntry); 103 104 /** 105 * Returns a Balance object for the parameters of the passed in LedgerBalanceHistory. Necessary for generic amount comparision since 106 * it may be either labor or gl. 107 * @param ledgerBalanceHistory to retrieve the Balance object for 108 * @return balance object adhereing to the Balance interface 109 */ 110 public abstract Balance getBalance(LedgerBalanceHistory ledgerBalanceHistory); 111 112 /** 113 * In order to avoid file system scans this class caches poster input and poster error filenames. In rare cases they may want to be reset. 114 */ 115 public abstract void clearPosterFileCache(); 116 117 /** 118 * Removes the data from the History tables. 119 */ 120 public abstract void clearHistories(); 121 122 /** 123 * Returns filenames used by process. Comma separated 124 */ 125 public abstract String getFilenames(); 126 }