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 org.kuali.hr.time.calendar.CalendarEntries;
19  import org.kuali.hr.time.calendar.CalendarEntryPeriodType;
20  import org.springframework.cache.annotation.Cacheable;
21  
22  import java.util.Date;
23  import java.util.List;
24  
25  public interface CalendarEntriesService {
26  
27      /**
28       * Method to directly access the CalendarEntries object by ID.
29       *
30       * @param hrCalendarEntriesId The ID to retrieve.
31       * @return a CalendarEntries object.
32       */
33      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarEntriesId=' + #p0")
34  	public CalendarEntries getCalendarEntries(String hrCalendarEntriesId);
35  
36      /**
37       * Method to obtain the current CalendarEntries object based on the
38       * indicated calendar and asOfDate.
39       * @param hrCalendarId The calendar to reference.
40       * @param asOfDate The date reference point.
41       * @return the current CalendarEntries effective by the asOfDate.
42       */
43      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0 + '|' + 'asOfDate=' + #p1")
44  	public CalendarEntries getCurrentCalendarEntriesByCalendarId(String hrCalendarId, Date asOfDate);
45  
46      /**
47       * Method to obtain theCalendarEntries object based in a date range
48       * @param hrCalendarId The calendar to reference.
49       * @param beginDate
50       * @param endDate
51       * @return the current CalendarEntries effective by the asOfDate.
52       */
53      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0 + '|' + 'beginDate=' + #p1 + '|' + 'endDate=' + #p2")
54      public CalendarEntries getCalendarEntriesByCalendarIdAndDateRange(String hrCalendarId, Date beginDate, Date endDate);
55  
56      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0 + '|' + 'endPeriodDate=' + #p1")
57      public CalendarEntries getCalendarEntriesByIdAndPeriodEndDate(String hrCalendarId, Date endPeriodDate);
58  
59      public CalendarEntries getPreviousCalendarEntriesByCalendarId(String hrCalendarId, CalendarEntries pce);
60      public CalendarEntries getNextCalendarEntriesByCalendarId(String hrCalendarId, CalendarEntries pce);
61  
62      /**
63       * Provides a list of CalendarEntries that are in the indicated window
64       * of time from the as of date.
65       * @param thresholdDays ± days from the asOfDate to form the window of time.
66       * @param asOfDate The central date to query from.
67       * @return A list of CalendarEntries.
68       */
69      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'thresholdDays=' + #p0 + '|' + 'endPeriodDate=' + #p1")
70  	public List<CalendarEntries> getCurrentCalendarEntryNeedsScheduled(int thresholdDays, Date asOfDate);
71  	
72  	public CalendarEntries createNextCalendarEntry(CalendarEntries calendarEntries, CalendarEntryPeriodType type);
73  	
74  	public List<CalendarEntries> getFutureCalendarEntries(String hrCalendarId, Date currentDate, int numberOfEntries);
75  
76      public List<CalendarEntries> getCalendarEntriesEndingBetweenBeginAndEndDate(String hrCalendarId, Date beginDate, Date endDate);
77  
78      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0")
79      public List<CalendarEntries> getAllCalendarEntriesForCalendarId(String hrCalendarId);
80      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0 + '|' + 'year=' + #p1")
81      public List<CalendarEntries> getAllCalendarEntriesForCalendarIdAndYear(String hrCalendarId, String year);
82      
83      public List<CalendarEntries> getAllCalendarEntriesForCalendarIdUpToPlanningMonths(String hrCalendarId, String principalId);
84      
85      public List<CalendarEntries> getAllCalendarEntriesForCalendarIdUpToCutOffTime(String hrCalendarId, Date cutOffTime);
86  
87  }