1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kim.api.group;
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.util.jaxb.MapStringStringAdapter;
21 import org.kuali.rice.kim.api.KimConstants;
22 import org.kuali.rice.kim.api.role.Role;
23 import org.springframework.cache.annotation.CacheEvict;
24 import org.springframework.cache.annotation.Cacheable;
25 import javax.jws.WebMethod;
26 import javax.jws.WebParam;
27 import javax.jws.WebResult;
28 import javax.jws.WebService;
29 import javax.jws.soap.SOAPBinding;
30 import javax.xml.bind.annotation.XmlElement;
31 import javax.xml.bind.annotation.XmlElementWrapper;
32 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
33 import java.util.Collection;
34 import java.util.List;
35 import java.util.Map;
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55 @WebService(name = "groupService", targetNamespace = KimConstants.Namespaces.KIM_NAMESPACE_2_0)
56 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
57 public interface GroupService {
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72 @WebMethod(operationName = "getGroupsByPrincipalId")
73 @XmlElementWrapper(name = "groups", required = true)
74 @XmlElement(name = "group", required = false)
75 @WebResult(name = "groups")
76 @Cacheable(value= GroupMember.Cache.NAME, key="'principalId=' + #p0")
77 List<Group> getGroupsByPrincipalId(@WebParam(name = "principalId") String principalId) throws RiceIllegalArgumentException;
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94 @WebMethod(operationName = "getGroupsByPrincipalIdAndNamespaceCode")
95 @XmlElementWrapper(name = "groups", required = true)
96 @XmlElement(name = "group", required = false)
97 @WebResult(name = "groups")
98 @Cacheable(value= GroupMember.Cache.NAME, key="'principalId=' + #p0 + '|' + 'namespaceCode=' + #p1")
99 List<Group> getGroupsByPrincipalIdAndNamespaceCode(@WebParam(name = "principalId") String principalId,
100 @WebParam(name = "namespaceCode") String namespaceCode) throws RiceIllegalArgumentException;
101
102
103
104
105
106
107
108
109
110
111
112
113
114 @WebMethod(operationName = "findGroupIds")
115 @XmlElementWrapper(name = "groupIds", required = true)
116 @XmlElement(name = "groupId", required = false)
117 @WebResult(name = "groupIds")
118 List<String> findGroupIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
119
120
121
122
123
124
125
126
127
128
129
130
131
132 @WebMethod(operationName = "findGroups")
133 @WebResult(name = "results")
134 GroupQueryResults findGroups(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
135
136
137
138
139
140
141
142
143
144
145
146
147
148 @WebMethod(operationName = "findGroupMembers")
149 @WebResult(name = "results")
150 GroupMemberQueryResults findGroupMembers(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
151
152
153
154
155
156
157
158
159
160 @WebMethod(operationName = "getGroup")
161 @WebResult(name = "group")
162 @Cacheable(value= Group.Cache.NAME, key="'id=' + #p0")
163 Group getGroup(@WebParam(name="id") String id) throws RiceIllegalArgumentException;
164
165
166
167
168
169
170
171
172
173
174
175 @WebMethod(operationName = "getGroupByNamespaceCodeAndName")
176 @WebResult(name = "group")
177 @Cacheable(value= Group.Cache.NAME, key="'namespaceCode=' + #p0 + '|' + 'groupName=' + #p1")
178 Group getGroupByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
179 @WebParam(name = "groupName") String groupName) throws RiceIllegalArgumentException;
180
181
182
183
184
185
186
187
188
189
190
191 @WebMethod(operationName = "getGroups")
192 @XmlElementWrapper(name = "groups", required = true)
193 @XmlElement(name = "group", required = false)
194 @WebResult(name = "groups")
195 @Cacheable(value= Group.Cache.NAME, key="'ids=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0)")
196 List<Group> getGroups(@WebParam(name="ids") Collection<String> ids) throws RiceIllegalArgumentException;
197
198
199
200
201
202
203
204
205
206
207
208
209 @WebMethod(operationName = "isMemberOfGroup")
210 @WebResult(name = "isMember")
211 @Cacheable(value= GroupMember.Cache.NAME, key="'{isMemberOfGroup}' + 'principalId=' + #p0 + '|' + 'groupId=' + #p1")
212 boolean isMemberOfGroup(@WebParam(name="principalId") String principalId, @WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229 @WebMethod(operationName = "isDirectMemberOfGroup")
230 @WebResult(name = "isDirectMember")
231 @Cacheable(value= GroupMember.Cache.NAME, key="'{isDirectMemberOfGroup}' + 'principalId=' + #p0 + '|' + 'groupId=' + #p1")
232 boolean isDirectMemberOfGroup(@WebParam(name="principalId") String principalId, @WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
233
234
235
236
237
238
239
240
241
242
243
244
245
246 @WebMethod(operationName = "getGroupIdsByPrincipalId")
247 @XmlElementWrapper(name = "groupIds", required = true)
248 @XmlElement(name = "groupId", required = false)
249 @WebResult(name = "groupIds")
250 @Cacheable(value= GroupMember.Cache.NAME, key="'{getGroupIdsByPrincipalId}' + 'principalId=' + #p0")
251 List<String> getGroupIdsByPrincipalId(@WebParam(name = "principalId") String principalId) throws RiceIllegalArgumentException;
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266 @WebMethod(operationName = "getGroupIdsByPrincipalIdAndNamespaceCode")
267 @XmlElementWrapper(name = "groupIds", required = true)
268 @XmlElement(name = "groupId", required = false)
269 @WebResult(name = "groupIds")
270 @Cacheable(value= GroupMember.Cache.NAME, key="'{getGroupIdsByPrincipalIdAndNamespaceCode}' + 'principalId=' + #p0 + '|' + 'namespaceCode=' + #p1")
271 List<String> getGroupIdsByPrincipalIdAndNamespaceCode(@WebParam(name = "principalId") String principalId,
272 @WebParam(name = "namespaceCode") String namespaceCode) throws RiceIllegalArgumentException;
273
274
275
276
277
278
279
280
281
282
283
284
285
286 @WebMethod(operationName = "getDirectGroupIdsByPrincipalId")
287 @XmlElementWrapper(name = "groupIds", required = true)
288 @XmlElement(name = "groupId", required = false)
289 @WebResult(name = "groupIds")
290 @Cacheable(value= GroupMember.Cache.NAME, key="'{getDirectGroupIdsByPrincipalId}' + 'principalId=' + #p0")
291 List<String> getDirectGroupIdsByPrincipalId(@WebParam(name = "principalId") String principalId) throws RiceIllegalArgumentException;
292
293
294
295
296
297
298
299
300
301
302
303
304
305 @WebMethod(operationName = "isGroupMemberOfGroup")
306 @WebResult(name = "isMember")
307 @Cacheable(value= GroupMember.Cache.NAME, key="'{isGroupMemberOfGroup}' + 'groupMemberId=' + #p0 + '|' + 'groupId=' + #p1")
308 boolean isGroupMemberOfGroup(@WebParam(name="groupMemberId") String groupMemberId, @WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
309
310
311
312
313
314
315
316
317
318
319
320
321 @WebMethod(operationName = "getMemberPrincipalIds")
322 @XmlElementWrapper(name = "principalIds", required = true)
323 @XmlElement(name = "principalId", required = false)
324 @WebResult(name = "principalIds")
325 @Cacheable(value= GroupMember.Cache.NAME, key="'{getMemberPrincipalIds}' + 'groupId=' + #p0")
326 List<String> getMemberPrincipalIds(@WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
327
328
329
330
331
332
333
334
335
336
337
338 @WebMethod(operationName = "getDirectMemberPrincipalIds")
339 @XmlElementWrapper(name = "principalIds", required = true)
340 @XmlElement(name = "principalId", required = false)
341 @WebResult(name = "principalIds")
342 @Cacheable(value= GroupMember.Cache.NAME, key="'{getDirectMemberPrincipalIds}' + 'groupId=' + #p0")
343 List<String> getDirectMemberPrincipalIds(@WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
344
345
346
347
348
349
350
351
352
353
354
355
356 @WebMethod(operationName = "getMemberGroupIds")
357 @XmlElementWrapper(name = "groupIds", required = true)
358 @XmlElement(name = "groupId", required = false)
359 @WebResult(name = "groupIds")
360 @Cacheable(value= GroupMember.Cache.NAME, key="'{getMemberGroupIds}' + 'groupId=' + #p0")
361 List<String> getMemberGroupIds( @WebParam(name="groupId") String groupId ) throws RiceIllegalArgumentException;
362
363
364
365
366
367
368
369
370
371
372
373 @WebMethod(operationName = "getDirectMemberOfGroup")
374 @XmlElementWrapper(name = "groupIds", required = true)
375 @XmlElement(name = "groupId", required = false)
376 @WebResult(name = "groupIds")
377 @Cacheable(value= GroupMember.Cache.NAME, key="'{getDirectMemberGroupIds}' + 'groupId=' + #p0")
378 List<String> getDirectMemberGroupIds( @WebParam(name="groupId") String groupId ) throws RiceIllegalArgumentException;
379
380
381
382
383
384
385
386
387
388
389
390
391 @WebMethod(operationName = "getParentGroupIds")
392 @XmlElementWrapper(name = "groupIds", required = true)
393 @XmlElement(name = "groupId", required = false)
394 @WebResult(name = "groupIds")
395 @Cacheable(value= GroupMember.Cache.NAME, key="'{getParentGroupIds}' + 'groupId=' + #p0")
396 List<String> getParentGroupIds(@WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
397
398
399
400
401
402
403
404
405
406
407
408 @WebMethod(operationName = "getDirectParentGroupIds")
409 @XmlElementWrapper(name = "groupIds", required = true)
410 @XmlElement(name = "groupId", required = false)
411 @WebResult(name = "groupIds")
412 @Cacheable(value= GroupMember.Cache.NAME, key="'{getDirectParentGroupIds}' + 'groupId=' + #p0")
413 List<String> getDirectParentGroupIds(@WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
414
415
416
417
418
419 @WebMethod(operationName = "getAttributes")
420 @WebResult(name = "attributes")
421 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
422 @Cacheable(value= Group.Cache.NAME, key="'{getAttributes}' + 'groupId=' + #p0")
423 Map<String, String> getAttributes( @WebParam(name="groupId") String groupId ) throws RiceIllegalArgumentException;
424
425
426
427
428
429
430
431
432
433
434
435
436
437 @WebMethod(operationName = "getMembersOfGroup")
438 @XmlElementWrapper(name = "members", required = true)
439 @XmlElement(name = "member", required = false)
440 @WebResult(name = "members")
441 @Cacheable(value= GroupMember.Cache.NAME, key="'groupId=' + #p0")
442 List<GroupMember> getMembersOfGroup( @WebParam(name="groupId") String groupId ) throws RiceIllegalArgumentException;
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457 @WebMethod(operationName = "getMembers")
458 @XmlElementWrapper(name = "members", required = true)
459 @XmlElement(name = "member", required = false)
460 @WebResult(name = "members")
461 @Cacheable(value= GroupMember.Cache.NAME, key="'groupIds=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0)")
462 List<GroupMember> getMembers( @WebParam(name="groupIds") List<String> groupIds ) throws RiceIllegalArgumentException;
463
464
465
466
467
468
469
470
471
472
473
474
475
476 @WebMethod(operationName = "createGroup")
477 @WebResult(name = "group")
478 @CacheEvict(value={Group.Cache.NAME, GroupMember.Cache.NAME}, allEntries = true)
479 Group createGroup(@WebParam(name="group") Group group) throws RiceIllegalArgumentException;
480
481
482
483
484
485
486
487
488
489
490
491
492
493 @WebMethod(operationName = "updateGroup")
494 @WebResult(name = "group")
495 @CacheEvict(value={Group.Cache.NAME, GroupMember.Cache.NAME}, allEntries = true)
496 Group updateGroup(@WebParam(name="group") Group group) throws RiceIllegalArgumentException;
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511 @WebMethod(operationName = "updateGroupWithId")
512 @WebResult(name = "group")
513 @CacheEvict(value={Group.Cache.NAME, GroupMember.Cache.NAME}, allEntries = true)
514 Group updateGroup(@WebParam(name="groupId") String groupId, @WebParam(name="group") Group group) throws RiceIllegalArgumentException;
515
516
517
518
519
520
521
522
523
524
525
526
527 @WebMethod(operationName = "createGroupMember")
528 @WebResult(name = "groupMember")
529 @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
530 GroupMember createGroupMember(@WebParam(name="groupMember") GroupMember groupMember) throws RiceIllegalArgumentException;
531
532
533
534
535
536
537
538
539
540
541
542
543
544 @WebMethod(operationName = "updateGroupMember")
545 @WebResult(name = "groupMember")
546 @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
547 GroupMember updateGroupMember(@WebParam(name="groupMember") GroupMember groupMember) throws RiceIllegalArgumentException;
548
549
550
551
552
553
554
555
556
557 @WebMethod(operationName = "addGroupToGroup")
558 @WebResult(name = "addedToGroup")
559 @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
560 boolean addGroupToGroup(@WebParam(name="childId") String childId, @WebParam(name="parentId") String parentId) throws RiceIllegalArgumentException;
561
562
563
564
565
566
567
568
569
570 @WebMethod(operationName = "removeGroupFromGroup")
571 @WebResult(name = "removedFromGroup")
572 @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
573 boolean removeGroupFromGroup(@WebParam(name="childId") String childId, @WebParam(name="parentId") String parentId) throws RiceIllegalArgumentException;
574
575
576
577
578
579
580
581
582
583 @WebMethod(operationName = "addPrincipalToGroup")
584 @WebResult(name = "addedToGroup")
585 @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
586 boolean addPrincipalToGroup(@WebParam(name="principalId") String principalId, @WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
587
588
589
590
591
592
593
594
595
596 @WebMethod(operationName = "removePrincipalFromGroup")
597 @WebResult(name = "removedFromGroup")
598 @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
599 boolean removePrincipalFromGroup(@WebParam(name="principalId") String principalId, @WebParam(name="groupId") String groupId) throws RiceIllegalArgumentException;
600
601
602
603
604
605
606
607 @WebMethod(operationName = "removeAllMembers")
608 @CacheEvict(value={GroupMember.Cache.NAME, Role.Cache.NAME}, allEntries = true)
609 void removeAllMembers( @WebParam(name="groupId") String groupId ) throws RiceIllegalArgumentException;
610 }