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