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.clock.location.service;
17  
18  import java.sql.Date;
19  import java.util.List;
20  
21  import org.kuali.hr.time.clock.location.ClockLocationRule;
22  import org.kuali.hr.time.clocklog.ClockLog;
23  import org.springframework.cache.annotation.Cacheable;
24  
25  public interface ClockLocationRuleService {
26  	/**
27  	 * Fetch Clock Location Rule based on criteria
28  	 * @param dept
29  	 * @param workArea
30  	 * @param principalId
31  	 * @param jobNumber
32  	 * @param asOfDate
33  	 * @return
34  	 */
35      @Cacheable(value= ClockLocationRule.CACHE_NAME,
36              key="'dept=' + #p0" +
37                      "+ '|' + 'workArea=' + #p1" +
38                      "+ '|' + 'principalId=' + #p2" +
39                      "+ '|' + 'jobNumber=' + #p3" +
40                      "+ '|' + 'asOfDate=' + #p4")
41  	public List<ClockLocationRule> getClockLocationRule(String dept, Long workArea,
42  			String principalId, Long jobNumber, Date asOfDate);
43  	/**
44  	 * Process clock location rule based on clock log passed in
45  	 * @param clockLog
46  	 * @param asOfDate
47  	 */
48  	public void processClockLocationRule(ClockLog clockLog, Date asOfDate);
49  	
50  	/**
51  	 * 
52  	 * @param dept
53  	 * @param workArea
54  	 * @param principalId
55  	 * @param jobNumber
56  	 * @param asOfDate
57  	 * @return
58  	 */
59      @Cacheable(value= ClockLocationRule.CACHE_NAME,
60              key="'{getNewerVersionClockLocationRule}' + 'dept=' + #p0" +
61                      "+ '|' + 'workArea=' + #p1" +
62                      "+ '|' + 'principalId=' + #p2" +
63                      "+ '|' + 'jobNumber=' + #p3" +
64                      "+ '|' + 'asOfDate=' + #p4")
65  	public List<ClockLocationRule> getNewerVersionClockLocationRule(String dept, Long workArea, String principalId, 
66  			Long jobNumber, Date asOfDate);
67  	/**
68  	 * 
69  	 * @param tkClockLocationRuleId
70  	 * @return
71  	 */
72      @Cacheable(value= ClockLocationRule.CACHE_NAME, key="'tkClockLocationRuleId=' + #p0")
73  	public ClockLocationRule getClockLocationRule(String tkClockLocationRuleId);
74  
75  	/**
76  	 * populate ip addresses for given ClockLocationRule
77  	 * @param clr
78  	 * @return
79  	 */
80  	public void populateIPAddressesForCLR(ClockLocationRule clr);
81  
82      List<ClockLocationRule> getClockLocationRules(Date fromEffdt, Date toEffdt, String principalId, String jobNumber,
83                                                    String dept, String workArea, String active, String showHistory);
84  }