1 /* 2 * Copyright 2005 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.ole.coa.service; 17 18 import java.sql.Date; 19 import java.util.Collection; 20 21 import org.kuali.ole.coa.businessobject.AccountingPeriod; 22 23 /** 24 * This service interface defines methods necessary for retrieving fully populated AccountingPeriod business objects from the 25 * database that are necessary for transaction processing in the application. 26 */ 27 public interface AccountingPeriodService { 28 /** 29 * This method retrieves all valid accounting periods in the system. 30 * 31 * @return A list of accounting periods in Kuali. 32 */ 33 public Collection<AccountingPeriod> getAllAccountingPeriods(); 34 35 /** 36 * This method retrieves a list of all open accounting periods in the system. 37 * 38 * @return 39 */ 40 public Collection<AccountingPeriod> getOpenAccountingPeriods(); 41 42 /** 43 * This method retrieves an individual AccountingPeriod based on the period and fiscal year 44 * 45 * @param periodCode 46 * @param fiscalYear 47 * @return an accounting period 48 */ 49 public AccountingPeriod getByPeriod(String periodCode, Integer fiscalYear); 50 51 52 /** 53 * This method allows for AccountingPeriod retrieval via String date. 54 * 55 * @param String 56 */ 57 public AccountingPeriod getByStringDate(String dateString); 58 59 /** 60 * This method takes a date and returns the corresponding period 61 * 62 * @param date 63 * @return period that matches the date 64 */ 65 public AccountingPeriod getByDate(Date date); 66 67 /** 68 * This method compares two accounting periods, hopefully by comparing their closing dates. If a is earlier than b, it should 69 * return a negative number; if a is later, it should return a positive number; and if the closing dates are equal, it should 70 * return a 0. 71 * 72 * @param a the first accounting period to compare 73 * @param b the second accounting period to compare 74 * @return an integer representing which is earlier or later, or if they occur simultaneously 75 */ 76 public int compareAccountingPeriodsByDate(AccountingPeriod a, AccountingPeriod b); 77 78 public void clearCache(); 79 }