View Javadoc

1   /**
2    * Copyright 2004-2013 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.hr.time.calendar.service;
17  
18  import java.sql.Time;
19  import java.util.Date;
20  import java.util.List;
21  
22  import org.kuali.hr.time.calendar.Calendar;
23  import org.kuali.hr.time.calendar.CalendarEntries;
24  import org.springframework.cache.annotation.Cacheable;
25  
26  public interface CalendarService {
27  	/**
28  	 * Fetch a pay calendar with the given id
29  	 * @param hrCalendarId
30  	 * @return
31  	 */
32      @Cacheable(value= Calendar.CACHE_NAME, key="'hrCalendarId=' + #p0")
33  	public Calendar getCalendar(String hrCalendarId);
34  
35  	/**
36  	 * Fetch a pay calendar by group
37  	 * @param calendarName
38  	 * @return
39  	 */
40      @Cacheable(value= Calendar.CACHE_NAME, key="'calendarName=' + #p0")
41  	public Calendar getCalendarByGroup(String calendarName);
42  
43  	/**
44       * Use this method to get CalendarEntries if you are passing in a "current date"
45       * style of date, ie todays date. If you are in a logic situation where you would
46       * pass EITHER todays date or a pay calendar date, pass the Pay period BEGIN date,
47       * so that the retrieval logic will correctly place the date in the window.
48  	 *
49  	 * @param principalId
50  	 * @param currentDate
51  	 * @return
52  	 */
53  	public CalendarEntries getCurrentCalendarDates(String principalId, Date currentDate);
54  
55      /**
56       * A method to use specifically when you have a Timesheet Documents Pay Period
57       * end date. Do not use if you are passing in a date known not to be the END period date.
58       *
59       * @param principalId
60       * @param payEndDate
61       * @return
62       */
63      @Cacheable(value= Calendar.CACHE_NAME, key="'principalId=' + #p0 + '|' + 'payEndDate=' + #p1 + '|' + 'calendarType=' + #p2")
64      public CalendarEntries getCalendarDatesByPayEndDate(String principalId, Date payEndDate, String calendarType);
65  
66  	/**
67  	 * Returns the Pay CalendarEntry for previous pay calendar
68  	 * @param tkCalendarId
69  	 * @param beginDateCurrentCalendar
70  	 * @return
71  	 */
72      @Cacheable(value= Calendar.CACHE_NAME, key="'tkCalendarId=' + #p0 + '|' + 'beginDateCurrentCalendar=' + #p1")
73  	public CalendarEntries getPreviousCalendarEntry(String tkCalendarId, Date beginDateCurrentCalendar);
74  	
75  	/**
76  	 * Fetch a pay calendar with the given principalId and date, returns null if none found
77  	 * @param principalId
78  	 * @param asOfDate
79  	 * @return
80  	 */
81  	public Calendar getCalendarByPrincipalIdAndDate(String principalId, Date asOfDate);
82  
83      public List<Calendar> getCalendars(String calendarName, String flsaBeginDay, String flsaBeginTime);
84  
85  }