View Javadoc

1   /**
2    * Copyright 2004-2014 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.kpme.core.department.service;
17  
18  import java.util.List;
19  
20  import org.joda.time.LocalDate;
21  import org.kuali.kpme.core.department.Department;
22  import org.springframework.cache.annotation.Cacheable;
23  
24  public interface DepartmentService {
25  	
26      /**
27       * Fetch department by id
28       * @param hrDeptId
29       * @return
30       */
31      @Cacheable(value=Department.CACHE_NAME, key="'hrDeptId=' + #p0")
32      Department getDepartment(String hrDeptId);
33  
34  
35      
36      List<Department> getDepartments(String userPrincipalId, String department, String location, String descr, String active, String showHistory, String payrollApproval);
37      
38      /**
39  	 * get count of department with given department
40  	 * @param department
41  	 * @return int
42  	 */
43  	int getDepartmentCount(String department);
44  	
45  	/**
46  	 * Get Department as of a particular date passed in
47  	 * @param department
48  	 * @param asOfDate
49  	 * @return
50  	 */
51      @Cacheable(value=Department.CACHE_NAME, key="'department=' + #p0 + '|' + 'asOfDate=' + #p1")
52  	Department getDepartment(String department, LocalDate asOfDate);
53  
54      /**
55       * Fetch department by id without sub kim role member data
56       * @param department
57       * @param asOfDate
58       * @return Department
59       */
60      @Cacheable(value=Department.CACHE_NAME, key="'{getDepartmentWithoutRoles}' + 'department=' + #p0 + '|' + 'asOfDate=' + #p1")
61      Department getDepartmentWithoutRoles(String department, LocalDate asOfDate);
62  
63      /**
64       * Fetches a list of Department objects as of the specified date all of which
65       * belong to the indicated location.
66       *
67       * @param location The search criteria
68       * @param asOfDate Effective date
69       * @return A List<Department> object.
70       */
71      @Cacheable(value=Department.CACHE_NAME, key="'chart=' + #p0 + '|' + 'asOfDate=' + #p1")
72      List<Department> getDepartments(String location, LocalDate asOfDate);
73  
74      /**
75       * Fetches a list of departments as of the specified date all of which
76       * belong to the indicated location.
77       *
78       * @param location The search criteria
79       * @param asOfDate Effective date
80       * @return A List<String> object.
81       */
82      @Cacheable(value=Department.CACHE_NAME, key="'{getDepartmentsForLocation}' + 'location=' + #p0 + '|' + 'asOfDate=' + #p1")
83      List<String> getDepartmentsForLocation(String location, LocalDate asOfDate);
84  
85      /**
86       * Fetches a list of departments as of the specified date all of which
87       * belong to the indicated locations.
88       *
89       * @param locations The search criteria
90       * @param asOfDate Effective date
91       * @return A List<String> object.
92       */
93      @Cacheable(value=Department.CACHE_NAME, key="'{getDepartmentsForLocations}' + 'location=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0) + '|' + 'asOfDate=' + #p1")
94      List<String> getDepartmentsForLocations(List<String> locations, LocalDate asOfDate);
95      
96  	/**
97  	 * get count of department with given department
98  	 * @param department
99  	 * @return int
100 	 */
101 	List<Department> getDepartments(String department);
102 
103 }