01: /*
02: * Copyright 2005-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.chart.service;
17:
18: import java.sql.Date;
19: import java.util.Collection;
20:
21: import org.kuali.module.chart.bo.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 getAllAccountingPeriods();
34:
35: /**
36: * This method retrieves a list of all open accounting periods in the system.
37: *
38: * @return
39: */
40: public Collection 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,
50: Integer fiscalYear);
51:
52: /**
53: * This method takes a date and returns the corresponding period
54: *
55: * @param date
56: * @return period that matches the date
57: */
58: public AccountingPeriod getByDate(Date date);
59:
60: /**
61: * This method compares two accounting periods, hopefully by comparing their closing dates. If a is earlier than b, it should
62: * return a negative number; if a is later, it should return a positive number; and if the closing dates are equal, it should
63: * return a 0.
64: *
65: * @param a the first accounting period to compare
66: * @param b the second accounting period to compare
67: * @return an integer representing which is earlier or later, or if they occur simultaneously
68: */
69: public int compareAccountingPeriodsByDate(AccountingPeriod a,
70: AccountingPeriod b);
71: }
|