1 /** 2 * Copyright 2005-2012 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.rice.krad.service; 17 18 import org.kuali.rice.krad.bo.InactivatableFromTo; 19 20 import java.util.Date; 21 import java.util.List; 22 import java.util.Map; 23 24 25 /** 26 * Provides methods for retrieval of business objects implementing InactivateableFromTo and needing effective dating logic 27 * 28 * @see org.kuali.rice.kns.bo.InactivateableFromTo 29 */ 30 public interface InactivateableFromToService { 31 32 /** 33 * Performs search on given class and criteria and returns only results that active based on the active to/from dates and the current 34 * date 35 * 36 * @param clazz 37 * - InactivateableFromTo class to search 38 * @param fieldValues 39 * - Search key values 40 * @return List of InactivateableFromTo instances that match search criteria and are active 41 */ 42 public List<InactivatableFromTo> findMatchingActive(Class<? extends InactivatableFromTo> clazz, Map fieldValues); 43 44 /** 45 * Performs search on given class and criteria and returns only results that active based on the active to/from dates and the given 46 * active as of date 47 * 48 * @param clazz 49 * - InactivateableFromTo class to search 50 * @param fieldValues 51 * - Search key values 52 * @param activeAsOfDate 53 * - Date to compare to for determining active status 54 * @return List of InactivateableFromTo instances that match search criteria and are active as of the given date 55 */ 56 public List<InactivatableFromTo> findMatchingActiveAsOfDate(Class<? extends InactivatableFromTo> clazz, 57 Map fieldValues, Date activeAsOfDate); 58 59 /** 60 * Removes instances from the given list that are inactive based on the current date 61 * 62 * @param filterList 63 * - List of InactivateableFromTo instances to filter 64 * @return List of InactivateableFromTo instances from the given list that are active as of the current date 65 */ 66 public List<InactivatableFromTo> filterOutNonActive(List<InactivatableFromTo> filterList); 67 68 /** 69 * Removes instances from the given list that are inactive based on the given date 70 * 71 * @param filterList 72 * - List of InactivateableFromTo instances to filter 73 * @param activeAsOfDate 74 * - Date to compare to for determining active status 75 * @return List of InactivateableFromTo instances from the given list that are active as of the given date 76 */ 77 public List<InactivatableFromTo> filterOutNonActive(List<InactivatableFromTo> filterList, Date activeAsOfDate); 78 79 /** 80 * Performs search on given class and criteria and returns that are active and most current. That is if two records are active the more 81 * current one will be the one with a later active begin date 82 * 83 * @param clazz 84 * - InactivateableFromTo class to search 85 * @param fieldValues 86 * - Search key values 87 * @return List of InactivateableFromTo instances that match search criteria and are current 88 */ 89 public List<InactivatableFromTo> findMatchingCurrent(Class<? extends InactivatableFromTo> clazz, 90 Map fieldValues); 91 92 /** 93 * Performs search on given class and criteria and returns that are active and most current based on the given date. That is if two 94 * records are active the more current one will be the one with a later active begin date 95 * 96 * @param clazz 97 * - InactivateableFromTo class to search 98 * @param fieldValues 99 * - Search key values 100 * @param currentAsOfDate 101 * - Date to compare to for determining active and current status 102 * @return List of InactivateableFromTo instances that match search criteria and are current 103 */ 104 public List<InactivatableFromTo> findMatchingCurrent(Class<? extends InactivatableFromTo> clazz, 105 Map fieldValues, Date currentAsOfDate); 106 107 /** 108 * Removes instances from the given list that are not current based on the current date 109 * 110 * @param filterList 111 * - List of InactivateableFromTo instances to filter 112 * @return List of InactivateableFromTo instances from the given list that are current as of the current date 113 */ 114 public List<InactivatableFromTo> filterOutNonCurrent(List<InactivatableFromTo> filterList); 115 116 /** 117 * Removes instances from the given list that are not current based on the given date 118 * 119 * @param filterList 120 * - List of InactivateableFromTo instances to filter 121 * @param currentAsOfDate 122 * - Date to compare to for determining active and current status 123 * @return List of InactivateableFromTo instances from the given list that are current as of the given date 124 */ 125 public List<InactivatableFromTo> filterOutNonCurrent(List<InactivatableFromTo> filterList, Date currentAsOfDate); 126 127 }