001: /*
002: * Copyright 2005-2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.gl.service;
017:
018: import java.sql.Date;
019: import java.util.Collection;
020: import java.util.Map;
021:
022: import org.kuali.module.gl.bo.OriginEntryGroup;
023:
024: /**
025: * An interface of methods to interact with Origin Entry Groups
026: */
027: public interface OriginEntryGroupService {
028: public OriginEntryGroup getGroupWithMaxIdFromSource(
029: String sourceCode);
030:
031: /**
032: * Mark a group as don't process
033: *
034: * @param groupId the id of the group to mark
035: */
036: public void dontProcessGroup(Integer groupId);
037:
038: /**
039: * Marks all backup groups (source code BACK) in the database so that they will not be scrubbed when the nightly scrubber step
040: * runs again.
041: */
042: public void markScrubbableBackupGroupsAsUnscrubbable();
043:
044: /**
045: * Marks all postable scrubber valid groups (source code SCV) in the database so that they will not be posted when the main
046: * posted runs
047: */
048: public void markPostableScrubberValidGroupsAsUnpostable();
049:
050: /**
051: * Marks all of the origin entry groups that would be returned from getIcrGroupsToPost() as don't process
052: */
053: public void markPostableIcrGroupsAsUnpostable();
054:
055: /**
056: * Get the newest scrubber error group
057: *
058: * @return the origin entry group that was most recently created, or null if there are no origin entry groups in the database
059: */
060: public OriginEntryGroup getNewestScrubberErrorGroup();
061:
062: /**
063: * Create the backup group which has all the entries from all the groups where all the flags are set Y.
064: */
065: public void createBackupGroup();
066:
067: /**
068: * Create the backup group which has all the entries from all the groups where all the flags are set Y.
069: */
070: public void createLaborBackupGroup();
071:
072: /**
073: * Delete all the groups (and entries) where the group is this many days old or older
074: *
075: * @param days groups older than the given days will be deleted by this method
076: */
077: public void deleteOlderGroups(int days);
078:
079: /**
080: * Deletes several origin entry groups
081: *
082: * @param groupsToDelete a Collection of origin entry groups to delete
083: */
084: public void deleteGroups(Collection<OriginEntryGroup> groupsToDelete);
085:
086: /**
087: * Get groups that match
088: *
089: * @param criteria a map of criteria to build a query from
090: * @return a Collection of qualifying origin entry groups
091: */
092: public Collection getMatchingGroups(Map criteria);
093:
094: /**
095: * Retrieves all groups which are not marked to be processed
096: *
097: * @return a Collection of qualifying origin entry groups
098: */
099: public Collection getOriginEntryGroupsPendingProcessing();
100:
101: /**
102: * Returns all groups of entries that should be processed by the poster
103: *
104: * @return a Collection of qualifying origin entry groups
105: */
106: public Collection getGroupsToPost();
107:
108: /**
109: * get entry groups to be posted that have the given group source code
110: *
111: * @param entryGroupSourceCode the given group source code
112: * @return the entry groups to be posted that have the given group source code
113: */
114: public Collection getGroupsToPost(String entryGroupSourceCode);
115:
116: /**
117: * Returns all groups with indirect cost recovery entries ready for positing
118: *
119: * @return a Collection of origin entry groups of indirect cost recovery entries to post
120: */
121: public Collection getIcrGroupsToPost();
122:
123: /**
124: * Gets a collection of all scrubbable backup groups (i.e. scrub, valid, process indicators all true)
125: *
126: * @return a Collection of origin entry backup groups that should be scrubbed
127: */
128: public Collection<OriginEntryGroup> getAllScrubbableBackupGroups();
129:
130: /**
131: * Get all the unscrubbed backup groups for Labor
132: *
133: * @param backupDate the date all groups created on or before should be return to be backed up
134: * @return a Collection of labor origin entry groups to backup
135: */
136: public Collection getLaborBackupGroups(Date backupDate);
137:
138: /**
139: * Get all the groups that need to be put into the backup group
140: *
141: * @param backupDate the date all groups created on or before should be return to be backed up
142: * @return a Collection of origin entry groups to backup
143: */
144: public Collection getGroupsToBackup(Date backupDate);
145:
146: /**
147: * Creates a brand new group
148: *
149: * @param date the date this group should list as its creation date
150: * @param sourceCode the source of this origin entry group
151: * @param valid whether this group is valid - ie, all entries within it are valid
152: * @param process whether this group should be processed by the next step
153: * @param scrub whether this group should be input to the scrubber
154: * @return a new origin entry group to put origin entries into
155: */
156: public OriginEntryGroup createGroup(Date date, String sourceCode,
157: boolean valid, boolean process, boolean scrub);
158:
159: /**
160: * save a group
161: *
162: * @param group the group to save
163: */
164: public void save(OriginEntryGroup group);
165:
166: /**
167: * Returns the origin entry group by the given id
168: *
169: * @param id the id of the group to retrieve
170: * @return an origin entry group with the given id, or null if nothing could be found
171: */
172: public OriginEntryGroup getExactMatchingEntryGroup(Integer id);
173:
174: /**
175: * Retrieves all origin entry groups currently in the persistence store
176: *
177: * @return a Collection of all the origin entry groups in the persistence store
178: */
179: public Collection getAllOriginEntryGroup();
180:
181: /**
182: * Retrieves origin entry groups created within the past number of given days
183: *
184: * @param days groups created within the past number of days will be retrieved
185: * @return a Collection of retrieved origin entry groups
186: */
187: public Collection getRecentGroupsByDays(int days);
188:
189: /**
190: * Returns whether the group indicated with the group ID still exists within the system
191: *
192: * @param groupId the id of the group to check for existence
193: * @return true if it still exists in the persistence mechanism, false otherwise
194: */
195: public boolean getGroupExists(Integer groupId);
196: }
|