001 /*
002 * Copyright 2007-2010 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.rice.kns.service;
017
018 import java.util.Date;
019 import java.util.List;
020 import java.util.Map;
021
022 import org.kuali.rice.kns.bo.InactivateableFromTo;
023
024 /**
025 * Provides methods for retrieval of business objects implementing InactivateableFromTo and needing effective dating logic
026 *
027 * @see org.kuali.rice.kns.bo.InactivateableFromTo
028 */
029 public interface InactivateableFromToService {
030
031 /**
032 * Performs search on given class and criteria and returns only results that active based on the active to/from dates and the current
033 * date
034 *
035 * @param clazz
036 * - InactivateableFromTo class to search
037 * @param fieldValues
038 * - Search key values
039 * @return List of InactivateableFromTo instances that match search criteria and are active
040 */
041 public List<InactivateableFromTo> findMatchingActive(Class<? extends InactivateableFromTo> clazz, Map fieldValues);
042
043 /**
044 * Performs search on given class and criteria and returns only results that active based on the active to/from dates and the given
045 * active as of date
046 *
047 * @param clazz
048 * - InactivateableFromTo class to search
049 * @param fieldValues
050 * - Search key values
051 * @param activeAsOfDate
052 * - Date to compare to for determining active status
053 * @return List of InactivateableFromTo instances that match search criteria and are active as of the given date
054 */
055 public List<InactivateableFromTo> findMatchingActiveAsOfDate(Class<? extends InactivateableFromTo> clazz,
056 Map fieldValues, Date activeAsOfDate);
057
058 /**
059 * Removes instances from the given list that are inactive based on the current date
060 *
061 * @param filterList
062 * - List of InactivateableFromTo instances to filter
063 * @return List of InactivateableFromTo instances from the given list that are active as of the current date
064 */
065 public List<InactivateableFromTo> filterOutNonActive(List<InactivateableFromTo> filterList);
066
067 /**
068 * Removes instances from the given list that are inactive based on the given date
069 *
070 * @param filterList
071 * - List of InactivateableFromTo instances to filter
072 * @param activeAsOfDate
073 * - Date to compare to for determining active status
074 * @return List of InactivateableFromTo instances from the given list that are active as of the given date
075 */
076 public List<InactivateableFromTo> filterOutNonActive(List<InactivateableFromTo> filterList, Date activeAsOfDate);
077
078 /**
079 * Performs search on given class and criteria and returns that are active and most current. That is if two records are active the more
080 * current one will be the one with a later active begin date
081 *
082 * @param clazz
083 * - InactivateableFromTo class to search
084 * @param fieldValues
085 * - Search key values
086 * @return List of InactivateableFromTo instances that match search criteria and are current
087 */
088 public List<InactivateableFromTo> findMatchingCurrent(Class<? extends InactivateableFromTo> clazz,
089 Map fieldValues);
090
091 /**
092 * Performs search on given class and criteria and returns that are active and most current based on the given date. That is if two
093 * records are active the more current one will be the one with a later active begin date
094 *
095 * @param clazz
096 * - InactivateableFromTo class to search
097 * @param fieldValues
098 * - Search key values
099 * @param currentAsOfDate
100 * - Date to compare to for determining active and current status
101 * @return List of InactivateableFromTo instances that match search criteria and are current
102 */
103 public List<InactivateableFromTo> findMatchingCurrent(Class<? extends InactivateableFromTo> clazz,
104 Map fieldValues, Date currentAsOfDate);
105
106 /**
107 * Removes instances from the given list that are not current based on the current date
108 *
109 * @param filterList
110 * - List of InactivateableFromTo instances to filter
111 * @return List of InactivateableFromTo instances from the given list that are current as of the current date
112 */
113 public List<InactivateableFromTo> filterOutNonCurrent(List<InactivateableFromTo> filterList);
114
115 /**
116 * Removes instances from the given list that are not current based on the given date
117 *
118 * @param filterList
119 * - List of InactivateableFromTo instances to filter
120 * @param currentAsOfDate
121 * - Date to compare to for determining active and current status
122 * @return List of InactivateableFromTo instances from the given list that are current as of the given date
123 */
124 public List<InactivateableFromTo> filterOutNonCurrent(List<InactivateableFromTo> filterList, Date currentAsOfDate);
125
126 }