1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.api.responsibility;
17
18 import org.kuali.rice.core.api.criteria.QueryByCriteria;
19 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
20 import org.kuali.rice.core.api.exception.RiceIllegalStateException;
21 import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
22 import org.kuali.rice.kim.api.KimConstants;
23 import org.kuali.rice.kim.api.common.template.Template;
24 import org.kuali.rice.kim.api.common.template.TemplateQueryResults;
25 import org.springframework.cache.annotation.CacheEvict;
26 import org.springframework.cache.annotation.Cacheable;
27
28 import javax.jws.WebMethod;
29 import javax.jws.WebParam;
30 import javax.jws.WebResult;
31 import javax.jws.WebService;
32 import javax.jws.soap.SOAPBinding;
33 import javax.xml.bind.annotation.XmlElement;
34 import javax.xml.bind.annotation.XmlElementWrapper;
35 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
36 import java.util.List;
37 import java.util.Map;
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62 @WebService(name = "responsibilityService", targetNamespace = KimConstants.Namespaces.KIM_NAMESPACE_2_0)
63 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
64 public interface ResponsibilityService {
65
66
67
68
69
70
71
72
73
74 @WebMethod(operationName="createResponsibility")
75 @WebResult(name = "responsibility")
76 @CacheEvict(value={Responsibility.Cache.NAME, Template.Cache.NAME + "{Responsibility}"}, allEntries = true)
77 Responsibility createResponsibility(@WebParam(name = "responsibility") Responsibility responsibility)
78 throws RiceIllegalArgumentException, RiceIllegalStateException;
79
80
81
82
83
84
85
86
87 @WebMethod(operationName="updateResponsibility")
88 @WebResult(name = "responsibility")
89 @CacheEvict(value={Responsibility.Cache.NAME, Template.Cache.NAME + "{Responsibility}"}, allEntries = true)
90 Responsibility updateResponsibility(@WebParam(name = "responsibility") Responsibility responsibility)
91 throws RiceIllegalArgumentException, RiceIllegalStateException;
92
93
94
95
96
97
98
99
100
101
102
103
104 @WebMethod(operationName = "getResponsibility")
105 @WebResult(name = "responsibility")
106 @Cacheable(value=Responsibility.Cache.NAME, key="'id=' + #p0")
107 Responsibility getResponsibility(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
108
109
110
111
112
113
114
115
116
117 @WebMethod(operationName = "findRespByNamespaceCodeAndName")
118 @WebResult(name = "responsibility")
119 @Cacheable(value=Responsibility.Cache.NAME, key="'namespaceCode=' + #p0 + '|' + 'name=' + #p1")
120 Responsibility findRespByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
121 @WebParam(name = "name") String name) throws RiceIllegalArgumentException;
122
123
124
125
126
127
128
129
130
131
132
133 @WebMethod(operationName = "getResponsibilityTemplate")
134 @WebResult(name = "template")
135 @Cacheable(value=Template.Cache.NAME + "{Responsibility}", key="'id=' + #p0")
136 Template getResponsibilityTemplate(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
137
138
139
140
141
142
143
144
145
146 @WebMethod(operationName = "findRespTemplateByNamespaceCodeAndName")
147 @WebResult(name = "template")
148 @Cacheable(value=Template.Cache.NAME + "{Responsibility}", key="'namespaceCode=' + #p0 + '|' + 'name=' + #p1")
149 Template findRespTemplateByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
150 @WebParam(name = "name") String name) throws RiceIllegalArgumentException;
151
152
153
154
155
156
157
158
159
160
161
162 @WebMethod(operationName = "hasResponsibility")
163 @WebResult(name = "result")
164 @Cacheable(value= Responsibility.Cache.NAME,
165 key="'{hasResponsibility}' + 'principalId=' + #p0 + '|' + 'namespaceCode=' + #p1 + '|' + 'respName=' + #p2 + '|' + 'qualification=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).mapKey(#p3)",
166 condition="!T(org.kuali.rice.kim.api.cache.KimCacheUtils).isResponsibilityAssignedToDynamicRole(#p1, #p2)")
167 boolean hasResponsibility(@WebParam(name = "principalId") String principalId,
168 @WebParam(name = "namespaceCode") String namespaceCode,
169 @WebParam(name = "respName") String respName,
170 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
171 @WebParam(name = "qualification") Map<String, String> qualification) throws RiceIllegalArgumentException;
172
173
174
175
176
177
178
179
180
181
182
183
184
185 @WebMethod(operationName = "hasResponsibilityByTemplate")
186 @WebResult(name = "result")
187 @Cacheable(value= Responsibility.Cache.NAME,
188 key="'{hasResponsibilityByTemplate}' + 'principalId=' + #p0 + '|' + 'namespaceCode=' + #p1 + '|' + 'respTemplateName=' + #p2 + '|' + 'qualification=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).mapKey(#p3) + '|' + 'respDetails=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).mapKey(#p4)",
189 condition="!T(org.kuali.rice.kim.api.cache.KimCacheUtils).isResponsibilityTemplateAssignedToDynamicRole(#p1, #p2)")
190 boolean hasResponsibilityByTemplate(@WebParam(name = "principalId") String principalId,
191 @WebParam(name = "namespaceCode") String namespaceCode,
192 @WebParam(name = "respTemplateName") String respTemplateName,
193 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(
194 name = "qualification") Map<String, String> qualification,
195 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(
196 name = "respDetails") Map<String, String> respDetails) throws RiceIllegalArgumentException;
197
198
199
200
201
202
203
204
205
206
207
208 @WebMethod(operationName = "getResponsibilityActions")
209 @XmlElementWrapper(name = "responsibilityActions", required = true)
210 @XmlElement(name = "responsibilityAction", required = false)
211 @WebResult(name = "responsibilityActions")
212 List<ResponsibilityAction> getResponsibilityActions(@WebParam(name = "namespaceCode") String namespaceCode,
213 @WebParam(name = "respName") String respName,
214 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
215 @WebParam(name = "qualification") Map<String, String> qualification) throws RiceIllegalArgumentException;
216
217
218
219
220
221
222
223
224
225
226
227
228 @WebMethod(operationName = "getResponsibilityActionsByTemplate")
229 @XmlElementWrapper(name = "responsibilityActions", required = true)
230 @XmlElement(name = "responsibilityAction", required = false)
231 @WebResult(name = "responsibilityActions")
232 List<ResponsibilityAction> getResponsibilityActionsByTemplate(
233 @WebParam(name = "namespaceCode") String namespaceCode,
234 @WebParam(name = "responsibilityTemplateName") String respTemplateName,
235 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(
236 name = "qualification") Map<String, String> qualification,
237 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(
238 name = "respDetails") Map<String, String> respDetails) throws RiceIllegalArgumentException;
239
240
241
242
243
244
245
246
247 @WebMethod(operationName = "getRoleIdsForResponsibility")
248 @XmlElementWrapper(name = "roleIds", required = true)
249 @XmlElement(name = "roleId", required = false)
250 @WebResult(name = "roleIds")
251 @Cacheable(value=Responsibility.Cache.NAME, key="'{getRoleIdsForResponsibility}' + 'id=' + #p0")
252 List<String> getRoleIdsForResponsibility(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
253
254
255
256
257
258
259
260
261 @WebMethod(operationName = "findResponsibilities")
262 @WebResult(name = "results")
263 ResponsibilityQueryResults findResponsibilities(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
264
265
266
267
268
269
270
271
272
273 @WebMethod(operationName = "findResponsibilityTemplates")
274 @WebResult(name = "results")
275 TemplateQueryResults findResponsibilityTemplates(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
276
277
278
279
280
281
282
283
284
285
286
287 @WebMethod(operationName = "findResponsibilitiesByTemplate")
288 @XmlElementWrapper(name = "responsibilities", required = true)
289 @XmlElement(name = "responsibility", required = false)
290 @WebResult(name = "responsibilities")
291 @Cacheable(value=Responsibility.Cache.NAME, key="'namespaceCode=' + #p1 + '|' + 'templateName=' + #p2")
292 List<Responsibility> findResponsibilitiesByTemplate(
293 @WebParam(name = "namespaceCode") String namespaceCode,
294 @WebParam(name = "templateName") String templateName)
295 throws RiceIllegalArgumentException;
296
297
298
299
300
301
302
303
304
305
306 @WebMethod(operationName = "findWorkflowResponsibilities")
307 @XmlElementWrapper(name = "responsibilities", required = true)
308 @XmlElement(name = "responsibility", required = false)
309 @WebResult(name = "responsibilities")
310 List<Responsibility> findWorkflowResponsibilities(
311 @WebParam(name = "documentTypeName") String documentTypeName)
312 throws RiceIllegalArgumentException;
313
314
315
316
317
318
319
320
321
322
323 @WebMethod(operationName = "findWorkflowExceptionResponsibilities")
324 @XmlElementWrapper(name = "responsibilities", required = true)
325 @XmlElement(name = "responsibility", required = false)
326 @WebResult(name = "responsibilities")
327 List<Responsibility> findWorkflowExceptionResponsibilities(
328 @WebParam(name = "documentTypeName") String documentTypeName)
329 throws RiceIllegalArgumentException;
330
331 }