View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.kfs.gl.batch.service;
20  
21  import java.io.File;
22  
23  import org.kuali.kfs.gl.businessobject.Balance;
24  import org.kuali.kfs.gl.businessobject.LedgerBalanceHistory;
25  import org.kuali.kfs.gl.businessobject.OriginEntryInformation;
26  
27  
28  /**
29   * Interface for BalancingService
30   */
31  public interface BalancingService {
32      /**
33       * Handle for batch processes to kick off balancing
34       * @return boolean true when success
35       */
36      public boolean runBalancing();
37  
38      /**
39       * @return input poster file. Returns null if no file found.
40       */
41      public abstract File getPosterInputFile();
42  
43      /**
44       * @return output poster error file. Returns null if no file found.
45       */
46      public abstract File getPosterErrorOutputFile();
47  
48      /**
49       * @return input reversal file. Returns null if no file found.
50       */
51      public abstract File getReversalInputFile();
52  
53      /**
54       * @return output reversal error file. Returns null if no file found.
55       */
56      public abstract File getReversalErrorOutputFile();
57  
58      /**
59       * @return input ICR file. Returns null if no file found.
60       */
61      public abstract File getICRInputFile();
62  
63      /**
64       * @return output ICR error file. Returns null if no file found.
65       */
66      public abstract File getICRErrorOutputFile();
67  
68      /**
69       * @return input ICR Encumbrance file. Returns null if no file found.
70       */
71      public abstract File getICREncumbranceInputFile();
72  
73      /**
74       * @return output ICR Encumbrance error file. Returns null if no file found.
75       */
76      public abstract File getICREncumbranceErrorOutputFile();
77  
78      /**
79       * @return system parameter for NUMBER_OF_PAST_FISCAL_YEARS_TO_CONSIDER
80       */
81      public abstract int getPastFiscalYearsToConsider();
82  
83      /**
84       * @return system parameter for NUMBER_OF_COMPARISON_FAILURES_TO_PRINT_PER_REPORT
85       */
86      public abstract int getComparisonFailuresToPrintPerReport();
87  
88      /**
89       * @param businessObjectName name of the BO for which to return the label
90       * @return functional short labels for tables affected in this process
91       */
92      public abstract String getShortTableLabel(String businessObjectName);
93  
94      /**
95       * Gets an OriginEntryInformation for the parsed line. This needs to be handled separately for GL and Labor because Labor is a special case
96       * of GL (positionNumber + emplid). Could be done with an OriginEntryHistory interface but in the interest of not mucking with
97       * OriginEntries the is done with delegation.
98       * @param inputLine line that was read from getPosterInputFilename
99       * @param lineNumber line number we are currently reading from getPosterInputFilename
100      * @return parsed line into an object as per inputLine parameter
101      */
102     public abstract OriginEntryInformation getOriginEntry(String inputLine, int lineNumber);
103 
104     /**
105      * Update the entry history table
106      * @param mode of post, e.g. MODE_REVERSAL
107      * @param originEntry representing the update details
108      */
109     public abstract void updateEntryHistory(Integer postMode, OriginEntryInformation originEntry);
110 
111     /**
112      * Updates the balance history table
113      * @param originEntry representing the update details
114      */
115     public abstract void updateBalanceHistory(Integer postMode, OriginEntryInformation originEntry);
116 
117     /**
118      * Returns a Balance object for the parameters of the passed in LedgerBalanceHistory. Necessary for generic amount comparision since
119      * it may be either labor or gl.
120      * @param ledgerBalanceHistory to retrieve the Balance object for
121      * @return balance object adhereing to the Balance interface
122      */
123     public abstract Balance getBalance(LedgerBalanceHistory ledgerBalanceHistory);
124 
125     /**
126      * 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.
127      */
128     public abstract void clearPosterFileCache();
129 
130     /**
131      * Removes the data from the History tables.
132      */
133     public abstract void clearHistories();
134 
135     /**
136      * Returns filenames used by process. Comma separated
137      */
138     public abstract String getFilenames();
139 }