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