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      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0 + '|' + 'endPeriodDate=' + #p1")
46      public CalendarEntries getCalendarEntriesByIdAndPeriodEndDate(String hrCalendarId, Date endPeriodDate);
47  
48      public CalendarEntries getPreviousCalendarEntriesByCalendarId(String hrCalendarId, CalendarEntries pce);
49      public CalendarEntries getNextCalendarEntriesByCalendarId(String hrCalendarId, CalendarEntries pce);
50  
51      /**
52       * Provides a list of CalendarEntries that are in the indicated window
53       * of time from the as of date.
54       * @param thresholdDays ± days from the asOfDate to form the window of time.
55       * @param asOfDate The central date to query from.
56       * @return A list of CalendarEntries.
57       */
58      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'thresholdDays=' + #p0 + '|' + 'endPeriodDate=' + #p1")
59  	public List<CalendarEntries> getCurrentCalendarEntryNeedsScheduled(int thresholdDays, Date asOfDate);
60  	
61  	public CalendarEntries createNextCalendarEntry(CalendarEntries calendarEntries, CalendarEntryPeriodType type);
62  	
63  	public List<CalendarEntries> getFutureCalendarEntries(String hrCalendarId, Date currentDate, int numberOfEntries);
64  
65      public CalendarEntries getCalendarEntriesByBeginAndEndDate(Date beginPeriodDate, Date endPeriodDate);
66  
67      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0")
68      public List<CalendarEntries> getAllCalendarEntriesForCalendarId(String hrCalendarId);
69      @Cacheable(value= CalendarEntries.CACHE_NAME, key="'hrCalendarId=' + #p0 + '|' + 'year=' + #p1")
70      public List<CalendarEntries> getAllCalendarEntriesForCalendarIdAndYear(String hrCalendarId, String year);
71  }