1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.roles.service;
17
18 import org.kuali.hr.time.assignment.Assignment;
19 import org.kuali.hr.time.roles.TkRole;
20 import org.kuali.hr.time.roles.TkRoleGroup;
21 import org.springframework.cache.annotation.CacheEvict;
22 import org.springframework.cache.annotation.Cacheable;
23
24 import java.sql.Date;
25 import java.util.List;
26 import java.util.Set;
27
28 public interface TkRoleService {
29
30
31
32
33
34
35 @Cacheable(value= TkRole.CACHE_NAME, key="'principalId=' + #p0 + '|' + 'asOfDate=' + #p1")
36 public List<TkRole> getRoles(String principalId, Date asOfDate);
37
38
39
40
41
42
43
44 @Cacheable(value= TkRole.CACHE_NAME, key="'{getInactiveRoles}' + 'principalId=' + #p0 + '|' + 'asOfDate=' + #p1")
45 public List<TkRole> getInactiveRoles(String principalId, Date asOfDate);
46
47
48
49
50
51
52
53 @Cacheable(value= TkRole.CACHE_NAME, key="'principalId=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
54 public List<TkRole> getRoles(String principalId, String roleName, Date asOfDate);
55
56
57
58
59
60 @Cacheable(value= TkRole.CACHE_NAME, key="'workArea=' + #p0")
61 public List<TkRole> getWorkAreaRoles(Long workArea);
62
63
64
65
66
67
68
69 @Cacheable(value= TkRole.CACHE_NAME, key="'workArea=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
70 public List<TkRole> getWorkAreaRoles(Long workArea, String roleName, Date asOfDate);
71
72
73
74
75
76 @Cacheable(value= TkRole.CACHE_NAME, key="'{getInActiveWorkAreaRoles}' + 'workArea=' + #p0")
77 public List<TkRole> getInActiveWorkAreaRoles(Long workArea);
78
79
80
81
82
83
84
85 @Cacheable(value= TkRole.CACHE_NAME, key="'{getInActiveWorkAreaRoles}' + 'workArea=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
86 public List<TkRole> getInActiveWorkAreaRoles(Long workArea, String roleName, Date asOfDate);
87
88
89
90
91
92
93
94 @Cacheable(value= TkRole.CACHE_NAME, key="'department=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
95 public List<TkRole> getDepartmentRoles(String department, String roleName, Date asOfDate);
96
97
98
99
100
101
102
103
104 @Cacheable(value= TkRole.CACHE_NAME, key="'{getDepartmentInactiveRoles}' + 'department=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
105 public List<TkRole> getDepartmentInactiveRoles(String department, String roleName, Date asOfDate);
106
107
108
109
110
111 @Cacheable(value= TkRole.CACHE_NAME, key="'department=' + #p0")
112 public List<TkRole> getDepartmentRoles(String department);
113
114
115
116
117
118 @Cacheable(value= TkRole.CACHE_NAME, key="'{getDepartmentInactiveRoles}' + 'department=' + #p0")
119 public List<TkRole> getDepartmentInactiveRoles(String department);
120
121
122
123
124 @CacheEvict(value={TkRole.CACHE_NAME, TkRoleGroup.CACHE_NAME}, allEntries = true)
125 public void saveOrUpdate(TkRole role);
126
127
128
129
130 @CacheEvict(value={TkRole.CACHE_NAME, TkRoleGroup.CACHE_NAME}, allEntries = true)
131 public void saveOrUpdate(List<TkRole> roles);
132
133
134
135
136
137
138
139
140
141
142 public List<String> getResponsibleParties(Assignment assignment, String roleName, Date asOfDate);
143
144
145
146
147
148
149
150 @Cacheable(value= TkRole.CACHE_NAME, key="'{getWorkAreasForApprover}' + 'principalId=' + #p0 + '|' + 'asOfDate=' + #p1")
151 public Set<Long> getWorkAreasForApprover(String principalId, Date asOfDate);
152
153
154
155
156
157
158
159
160 public Set<String> getActivePrincipalsForWorkAreas(Set<Long> workAreas, Date asOfDate);
161
162
163
164
165 @Cacheable(value= TkRole.CACHE_NAME, key="'tkRoleId=' + #p0")
166 public TkRole getRole(String tkRoleId);
167
168
169
170
171 @Cacheable(value= TkRole.CACHE_NAME, key="'positionNumber=' + #p0")
172 public TkRole getRolesByPosition(String positionNumber);
173
174 @Cacheable(value= TkRole.CACHE_NAME, key="'{getInactiveRolesByPosition}' + 'positionNumber=' + #p0")
175 public TkRole getInactiveRolesByPosition(String positionNumber);
176
177 @Cacheable(value= TkRole.CACHE_NAME, key="'{getPositionRolesForWorkArea}' + 'workArea=' + #p0 + '|' + 'asOfDate=' + #p1")
178 public List<TkRole> getPositionRolesForWorkArea(Long workArea, Date asOfDate);
179
180 @Cacheable(value= TkRole.CACHE_NAME,
181 key="'principalId=' + #p0" +
182 "+ '|' + 'asOfDate=' + #p1" +
183 "+ '|' + 'roleName=' + #p2" +
184 "+ '|' + 'workArea=' + #p3" +
185 "+ '|' + 'department=' + #p4")
186 List<TkRole> getRoles(String principalId, Date asOfDate, String roleName, Long workArea, String department);
187 }