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.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 List<Department> getDepartments(String userPrincipalId, String department, String location, String descr, String active, String showHistory);
35
36 /**
37 * get count of department with given department
38 * @param department
39 * @return int
40 */
41 int getDepartmentCount(String department);
42
43 /**
44 * Get Department as of a particular date passed in
45 * @param department
46 * @param asOfDate
47 * @return
48 */
49 @Cacheable(value=Department.CACHE_NAME, key="'department=' + #p0 + '|' + 'asOfDate=' + #p1")
50 Department getDepartment(String department, LocalDate asOfDate);
51
52 /**
53 * Fetches a list of Department objects as of the specified date all of which
54 * belong to the indicated location.
55 *
56 * @param location The search criteria
57 * @param asOfDate Effective date
58 * @return A List<Department> object.
59 */
60 @Cacheable(value=Department.CACHE_NAME, key="'chart=' + #p0 + '|' + 'asOfDate=' + #p1")
61 List<Department> getDepartments(String location, LocalDate asOfDate);
62
63 /**
64 * get count of department with given department
65 * @param department
66 * @return int
67 */
68 List<Department> getDepartments(String department);
69
70 }