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
61 @Cacheable(value= TkRole.CACHE_NAME, key="'workArea=' + #p0 + '|' + 'asOfDate=' + #p1")
62 public List<TkRole> getWorkAreaRoles(Long workArea, Date asOfDate);
63
64
65
66
67
68
69
70 @Cacheable(value= TkRole.CACHE_NAME, key="'workArea=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
71 public List<TkRole> getWorkAreaRoles(Long workArea, String roleName, Date asOfDate);
72
73
74
75
76
77
78 @Cacheable(value= TkRole.CACHE_NAME, key="'{getInActiveWorkAreaRoles}' + 'workArea=' + #p0 + '|' + 'asOfDate=' + #p1")
79 public List<TkRole> getInActiveWorkAreaRoles(Long workArea, Date asOfDate);
80
81
82
83
84
85
86
87 @Cacheable(value= TkRole.CACHE_NAME, key="'{getInActiveWorkAreaRoles}' + 'workArea=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
88 public List<TkRole> getInActiveWorkAreaRoles(Long workArea, String roleName, Date asOfDate);
89
90
91
92
93
94
95
96 @Cacheable(value= TkRole.CACHE_NAME, key="'department=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
97 public List<TkRole> getDepartmentRoles(String department, String roleName, Date asOfDate);
98
99
100
101
102
103
104
105
106 @Cacheable(value= TkRole.CACHE_NAME, key="'{getDepartmentInactiveRoles}' + 'department=' + #p0 + '|' + 'roleName=' + #p1 + '|' + 'asOfDate=' + #p2")
107 public List<TkRole> getDepartmentInactiveRoles(String department, String roleName, Date asOfDate);
108
109
110
111
112
113
114 @Cacheable(value= TkRole.CACHE_NAME, key="'department=' + #p0 + '|' + 'asOfDate=' + #p1")
115 public List<TkRole> getDepartmentRoles(String department, Date asOfDate);
116
117
118
119
120 @CacheEvict(value={TkRole.CACHE_NAME, TkRoleGroup.CACHE_NAME}, allEntries = true)
121 public void saveOrUpdate(TkRole role);
122
123
124
125
126 @CacheEvict(value={TkRole.CACHE_NAME, TkRoleGroup.CACHE_NAME}, allEntries = true)
127 public void saveOrUpdate(List<TkRole> roles);
128
129
130
131
132
133
134
135
136
137
138 public List<String> getResponsibleParties(Assignment assignment, String roleName, Date asOfDate);
139
140
141
142
143
144
145
146 @Cacheable(value= TkRole.CACHE_NAME, key="'{getWorkAreasForApprover}' + 'principalId=' + #p0 + '|' + 'asOfDate=' + #p1")
147 public Set<Long> getWorkAreasForApprover(String principalId, Date asOfDate);
148
149
150
151
152
153
154
155
156 public Set<String> getActivePrinciaplsForWorkAreas(Set<Long> workAreas, Date asOfDate);
157
158
159
160
161 @Cacheable(value= TkRole.CACHE_NAME, key="'tkRoleId=' + #p0")
162 public TkRole getRole(String tkRoleId);
163
164
165
166
167 @Cacheable(value= TkRole.CACHE_NAME, key="'positionNumber=' + #p0")
168 public TkRole getRolesByPosition(String positionNumber);
169
170 @Cacheable(value= TkRole.CACHE_NAME, key="'{getInactiveRolesByPosition}' + 'positionNumber=' + #p0")
171 public TkRole getInactiveRolesByPosition(String positionNumber);
172
173 @Cacheable(value= TkRole.CACHE_NAME, key="'{getPositionRolesForWorkArea}' + 'workArea=' + #p0 + '|' + 'asOfDate=' + #p1")
174 public List<TkRole> getPositionRolesForWorkArea(Long workArea, Date asOfDate);
175
176 @Cacheable(value= TkRole.CACHE_NAME,
177 key="'principalId=' + #p0" +
178 "+ '|' + 'asOfDate=' + #p1" +
179 "+ '|' + 'roleName=' + #p2" +
180 "+ '|' + 'workArea=' + #p3" +
181 "+ '|' + 'department=' + #p4")
182 List<TkRole> getRoles(String principalId, Date asOfDate, String roleName, Long workArea, String department);
183 }