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.module.ld.service;
017    
018    import java.io.BufferedReader;
019    import java.util.List;
020    import java.util.Map;
021    
022    import org.kuali.kfs.gl.businessobject.OriginEntryStatistics;
023    import org.kuali.kfs.module.ld.businessobject.LaborOriginEntry;
024    
025    /**
026     * Defines methods that must be implemented by classes providing a LaborOriginEntryServiceImpl.
027     */
028    public interface LaborOriginEntryService {
029    
030        /**
031         * Get statistics from a group
032         */
033        //public OriginEntryStatistics getStatistics(Integer groupId);
034        public OriginEntryStatistics getStatistics(String fileName);
035    
036        /**
037         * Copy a set of entries into a new group
038         */
039        //public OriginEntryGroup copyEntries(Date date, String sourceCode, boolean valid, boolean process, boolean scrub, Collection<LaborOriginEntry> entries);
040    
041        /**
042         * Copy a set of entries into a new group
043         */
044        //public OriginEntryGroup copyEntries(Date date, String sourceCode, boolean valid, boolean process, boolean scrub, Iterator<LaborOriginEntry> entries);
045    
046        /**
047         * Delete entry
048         * 
049         * @param oe Entry to delete
050         */
051        //public void delete(LaborOriginEntry oe);
052    
053        /**
054         * Return all documents in a group
055         * 
056         * @param oeg Group used to select documents
057         * @return Collection to all documents
058         */
059        //public Collection<LaborOriginEntry> getDocumentsByGroup(OriginEntryGroup oeg);
060    
061        /**
062         * Return all entries for a group sorted by account number for the error
063         * 
064         * @param oeg
065         * @return
066         */
067        //public Iterator<LaborOriginEntry> getEntriesByGroupAccountOrder(OriginEntryGroup oeg);
068    
069        /**
070         * Return all entries for a group sorted for display on the pending entry report.
071         * 
072         * @param oeg
073         * @return
074         */
075        //public Iterator<LaborOriginEntry> getEntriesByGroupReportOrder(OriginEntryGroup oeg);
076    
077        /**
078         * Return all entries for a group sorted across the columns in report from left to right.
079         * 
080         * @param oeg
081         * @return
082         */
083        //public Iterator<LaborOriginEntry> getEntriesByGroupListingReportOrder(OriginEntryGroup oeg);
084    
085        /**
086         * Return all entries for the groups where the balance type is empty
087         * 
088         * @param groups
089         * @return
090         */
091        //public Iterator<LaborOriginEntry> getBadBalanceEntries(Collection groups);
092    
093        /**
094         * Return all the entries for a specific document in a specific group
095         * 
096         * @param oeg Group selection
097         * @param documentNumber Document number selection
098         * @param documentTypeCode Document type selection
099         * @param originCode Origin Code selection
100         * @return iterator to all the entries
101         */
102        //public Collection<LaborOriginEntry> getEntriesByDocument(OriginEntryGroup oeg, String documentNumber, String documentTypeCode, String originCode);
103    
104        /**
105         * Take a generic transaction and save it as an origin entry in a specific group
106         * 
107         * @param tran transaction to save
108         * @param group group to save the transaction
109         */
110        //public void createEntry(LaborTransaction laborTran, OriginEntryGroup group);
111    
112        /**
113         * Save an laborOrigin entry
114         * 
115         * @param entry
116         */
117        //public void save(LaborOriginEntry entry);
118    
119        /**
120         * Export all origin entries in a group to a flat text file
121         * 
122         * @param filename Filename to save the text
123         * @param groupId Group to save
124         */
125        //public void exportFlatFile(String filename, Integer groupId);
126    
127        /**
128         * Load a flat file of transations into the origin entry table
129         * 
130         * @param filename Filename with the text
131         * @param groupSourceCode Source of the new group
132         * @param valid Valid flag for new group
133         * @param processed Process flag for new group
134         * @param scrub Scrub flag for new group
135         */
136        //public void loadFlatFile(String filename, String groupSourceCode, boolean valid, boolean processed, boolean scrub);
137    
138        /**
139         * Send data to an output stream
140         * 
141         * @param groupId
142         * @param bw
143         */
144        //public void flatFile(Integer groupId, BufferedOutputStream bw);
145    
146        /**
147         * Return all entries by searchCriteria
148         * 
149         * @param searchCriteria
150         */
151        //public Collection getMatchingEntriesByCollection(Map searchCriteria);
152    
153        /**
154         * Return a matched entry with entryId
155         * 
156         * @param entryId
157         */
158        //public LaborOriginEntry getExactMatchingEntry(Integer entryId);
159    
160    
161        /**
162         * Get origin entries that belong to the given group
163         * 
164         * @param group the given origin entry group
165         * @return origin entries that belong to the given group
166         */
167        //public Iterator<LaborOriginEntry> getEntriesByGroup(OriginEntryGroup group);
168    
169        /**
170         * Get origin entries that belong to the given group
171         * 
172         * @param group the given origin entry group
173         * @return origin entries that belong to the given group
174         */
175        //public Collection<LaborOriginEntry> getEntryCollectionByGroup(OriginEntryGroup group);
176    
177        /**
178         * Get origin entries that belong to the given groups
179         * 
180         * @param groups the given origin entry groups
181         * @return origin entries that belong to the given groups
182         */
183        //public Iterator<LaborOriginEntry> getEntriesByGroups(Collection<OriginEntryGroup> groups);
184    
185        /**
186         * Get the origin entries that belong to the given group in either the consolidation manner or not
187         * 
188         * @param group the given group
189         * @param isConsolidated the flag that indicates if return origin entries in either the consolidation manner or not
190         * @return the origin entries that belong to the given group in either the consolidation manner or not
191         */
192        //public Iterator<LaborOriginEntry> getEntriesByGroup(OriginEntryGroup group, boolean isConsolidated);
193    
194        /**
195         * Get the origin entries that belong to the given group in either the consolidation manner or not
196         * 
197         * @param group the given group
198         * @param isConsolidated the flag that indicates if return origin entries in either the consolidation manner or not
199         * @return the origin entries that belong to the given group in either the consolidation manner or not
200         */
201        //public Collection<LaborOriginEntry> getConsolidatedEntryCollectionByGroup(OriginEntryGroup group);
202    
203        /**
204         * get the summarized information of the entries that belong to the given entry groups
205         * 
206         * @param groups the origin entry groups
207         * @return a set of summarized information of the entries within the specified groups
208         */
209        //public LedgerEntryHolder getSummariedEntriesByGroups(Collection<OriginEntryGroup> groups);
210    
211        /**
212         * get the summarized information of poster input entries that belong to the given entry groups
213         * 
214         * @param groups the origin entry groups
215         * @return a map of summarized information of poster input entries within the specified groups
216         */
217        //public Map<String, PosterOutputSummaryEntry> getPosterOutputSummaryByGroups(Collection<OriginEntryGroup> groups);
218    
219        /**
220         * get the count of the origin entry collection in the given groups
221         * 
222         * @param groups the given groups
223         * @return the count of the origin entry collection in the given group
224         */
225        //public int getCountOfEntriesInGroups(Collection<OriginEntryGroup> groups);
226    
227        /**
228         * get all entries with groupId
229         * 
230         * @param groupId
231         */
232        //public List<LaborOriginEntry> getEntriesByGroupId(Integer groupId);
233        
234        public Map getEntriesByGroupIdWithPath(String fileNameWithPath, List<LaborOriginEntry> originEntryList);
235    
236        public Map getEntriesByBufferedReader(BufferedReader inputBufferedReader, List<LaborOriginEntry> originEntryList);
237        /**
238         * get the summarized information of the entries that belong to the entry groups with the given group id list
239         * 
240         * @param groupIdList the origin entry groups
241         * @return a set of summarized information of the entries within the specified group
242         */
243        //public LedgerEntryHolder getSummaryByGroupId(Collection groupIdList);
244    
245        /**
246         * get the count of the origin entry collection in the given group
247         * 
248         * @param group the given group
249         * @return the count of the origin entry collection in the given group
250         */
251        //public int getCountOfEntriesInSingleGroup(OriginEntryGroup group);
252        
253        /**
254         * Get all the unscrubbed backup groups for Labor
255         * 
256         * @param backupDate the date all groups created on or before should be return to be backed up
257         * @return a Collection of labor origin entry groups to backup
258         */
259        //public Collection getLaborBackupGroups(Date backupDate);
260        
261        /**
262         * Counts the number of entries in a group
263         * @param the id of an origin entry group
264         * @return the count of the entries in that group
265         */
266        //public Integer getGroupCount(Integer groupId);
267        
268        public Integer getGroupCount(String fileName);
269    }