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.gl.dataaccess;
017
018 import java.sql.Date;
019 import java.util.Collection;
020 import java.util.Map;
021
022 import org.kuali.kfs.gl.businessobject.OriginEntryGroup;
023
024 public interface OriginEntryGroupDao {
025 /**
026 * Given an origin entry group source type (defined in OriginEntrySource)
027 *
028 * @param sourceCode the source code of the groups to find
029 * @return a OriginEntryGroup with the given source code and max ORIGIN_ENTRY_GRP_ID
030 * @see org.kuali.kfs.gl.businessobject.OriginEntrySource
031 */
032 public OriginEntryGroup getGroupWithMaxIdFromSource(String sourceCode);
033
034 /**
035 * Get all the groups that are older than a date
036 *
037 * @param day the date groups returned should be older than
038 * @return a Collection of origin entry groups older than that date
039 */
040 public Collection<OriginEntryGroup> getOlderGroups(Date day);
041
042 /**
043 * Delete all the groups in the list. Note...it doesn't delete the entries within them, you need
044 * OriginEntryDao.deleteGroups for that
045 *
046 * @params groups a Collection of origin entry groups to delete
047 */
048 public void deleteGroups(Collection<OriginEntryGroup> groups);
049
050 /**
051 * Fetch all the groups that match the criteria
052 *
053 * @param searchCriteria a Map of search criteria to form the query
054 * @return a Collection of Origin Entry Groups that match that criteria
055 */
056 public Collection getMatchingGroups(Map searchCriteria);
057
058 /**
059 * Get all the groups for the poster (that is to say, Groups with "Process" being true)
060 *
061 * @param groupSourceCode the source code of origin entry groups to return
062 * @return a Collection of origin entry groups that should be processed by the poster
063 */
064 public Collection getPosterGroups(String groupSourceCode);
065
066 /**
067 * Gets a collection of all backup groups that are scrubbable (i.e. valid, process, scrub indicators all set to true)
068 *
069 * @return a Collection of scrubbable origin entry groups
070 */
071 public Collection<OriginEntryGroup> getAllScrubbableBackupGroups();
072
073 /**
074 * Get all the groups to be copied into the backup group
075 *
076 * @param groupDate the date returned origin entry groups must have been created on or before
077 * @return a Collection of origin entry groups to backup
078 */
079 public Collection getGroupsToBackup(Date groupDate);
080
081 /**
082 * Save a group
083 *
084 * @param group a group to save
085 */
086 public void save(OriginEntryGroup group);
087
088 /**
089 * The the group for the ID passed. The EXACT one, not one that is close, it must be EXACTLY EXACT.
090 *
091 * @param id the group id of the group to return
092 * @return a highly exact origin entry group, or, if not found, null
093 */
094 public OriginEntryGroup getExactMatchingEntryGroup(Integer id);
095
096 /**
097 * Fetches groups created on or after the given date
098 *
099 * @param day the date origin entry groups to return must have been created on or after
100 * @return a Collection of origin entry groups created on or after that day
101 */
102 public Collection<OriginEntryGroup> getRecentGroups(Date day);
103 }