001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kim.api.group; 017 018import org.kuali.rice.core.api.criteria.QueryByCriteria; 019import org.kuali.rice.core.api.exception.RiceIllegalArgumentException; 020import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter; 021import org.kuali.rice.kim.api.KimConstants; 022import org.kuali.rice.kim.api.role.Role; 023import org.springframework.cache.annotation.CacheEvict; 024import org.springframework.cache.annotation.Cacheable; 025import javax.jws.WebMethod; 026import javax.jws.WebParam; 027import javax.jws.WebResult; 028import javax.jws.WebService; 029import javax.jws.soap.SOAPBinding; 030import javax.xml.bind.annotation.XmlElement; 031import javax.xml.bind.annotation.XmlElementWrapper; 032import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; 033import java.util.Collection; 034import java.util.List; 035import java.util.Map; 036/** 037 * 038 * This service provides operations for checking group membership, querying for group data, 039 * creating and updating groups. 040 * 041 * <p>A group is a collection of principals. It's membership consists of direct principal 042 * assignment and/or nested group membership. All groups are uniquely identified by a namespace 043 * code plus a name. 044 * 045 * <p>As mentioned previously, groups support nested group membership. A principal or group is 046 * considered to be a "member" of a group if it is either directly assigned to the group or 047 * indirectly assigned (via a nested group membership). A principal or group is said to be a 048 * "direct" member of another group only if it is directly assigned as a member of the group, 049 * and not via a nested group assignment. 050 * 051 * @author Kuali Rice Team (rice.collab@kuali.org) 052 * 053 */ 054 055@WebService(name = "groupService", targetNamespace = KimConstants.Namespaces.KIM_NAMESPACE_2_0) 056@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) 057public interface GroupService { 058 059 /** 060 * Get all the groups for a given principal. 061 * 062 * <p> 063 * This will include all groups directly assigned as well as those inferred 064 * by the fact that they are members of higher level groups. 065 * </p> 066 * 067 * @param principalId The id of the Principal 068 * @return a list of Group objects in which the given Principal is a member of. An empty list is returned if an invalid or 069 * non-existant principalId is supplied. 070 * @throws RiceIllegalArgumentException if the principalId is null or blank 071 */ 072 @WebMethod(operationName = "getGroupsByPrincipalId") 073 @XmlElementWrapper(name = "groups", required = true) 074 @XmlElement(name = "group", required = false) 075 @WebResult(name = "groups") 076 @Cacheable(value= GroupMember.Cache.NAME, key="'principalId=' + #p0") 077 List<Group> getGroupsByPrincipalId(@WebParam(name = "principalId") String principalId) throws RiceIllegalArgumentException; 078 079 080 /** 081 * Get all the groups within a namespace for a given principal. 082 * 083 * <p> 084 * This will include all groups directly assigned as well as those inferred 085 * by the fact that they are members of higher level groups, and filtered by Group namespace. 086 * </p> 087 * 088 * @param principalId The id of the Principal 089 * @param namespaceCode The namespace code of the desired Groups to return 090 * @return a list of Group objects in which the given Principal is a member of, filtered by Group namespace. An empty list is returned if an invalid or 091 * non-existant principalId is supplied. 092 * @throws RiceIllegalArgumentException if the principalId, namespaceCode is null or blank 093 */ 094 @WebMethod(operationName = "getGroupsByPrincipalIdAndNamespaceCode") 095 @XmlElementWrapper(name = "groups", required = true) 096 @XmlElement(name = "group", required = false) 097 @WebResult(name = "groups") 098 @Cacheable(value= GroupMember.Cache.NAME, key="'principalId=' + #p0 + '|' + 'namespaceCode=' + #p1") 099 List<Group> getGroupsByPrincipalIdAndNamespaceCode(@WebParam(name = "principalId") String principalId, 100 @WebParam(name = "namespaceCode") String namespaceCode) throws RiceIllegalArgumentException; 101 102 /** 103 * Query for groups based on the given search criteria which is a Map of group field names to values. 104 * 105 * <p> 106 * This method returns it's results as a List of group ids that match the given search criteria. 107 * </p> 108 * 109 * @param queryByCriteria the criteria. Cannot be null. 110 * @return a list of groupId Strings in which the given criteria match Group properties. An empty list is returned if an invalid or 111 * non-existent criteria is supplied. 112 * @throws RiceIllegalArgumentException if the queryByCriteria is null 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 * Query for groups based on the given search criteria which is a Map of group field names to values. 122 * 123 * <p> 124 * This method returns it's results as a List of Groups that match the given search criteria. 125 * </p> 126 * 127 * @param queryByCriteria the criteria. Cannot be null. 128 * @return a list of Group objects in which the given criteria match Group properties. An empty list is returned if an invalid or 129 * non-existent criteria is supplied. 130 * @throws RiceIllegalArgumentException if the queryByCriteria is null 131 */ 132 @WebMethod(operationName = "findGroups") 133 @WebResult(name = "results") 134 GroupQueryResults findGroups(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException; 135 136 /** 137 * Query for group members based on the given search criteria which is a Map of group member field names to values. 138 * 139 * <p> 140 * This method returns it's results as a List of GroupMemberss that match the given search criteria. 141 * </p> 142 * 143 * @param queryByCriteria the criteria. Cannot be null. 144 * @return a list of GroupMember objects in which the given criteria match Group properties. An empty list is returned if an invalid or 145 * non-existent criteria is supplied. 146 * @throws RiceIllegalArgumentException if the queryByCriteria is null 147 */ 148 @WebMethod(operationName = "findGroupMembers") 149 @WebResult(name = "results") 150 GroupMemberQueryResults findGroupMembers(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException; 151 /** 152 * Lookup a Group based on the passed in id. 153 * 154 * 155 * @param id String that matches the desired Groups id 156 * @return a Group with the given id value. A null reference is returned if an invalid or 157 * non-existant id is supplied. 158 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Lookup a Group based on the passed in namespace and name. 167 * 168 * 169 * @param namespaceCode String that matches the desired Group's namespaceCode 170 * @param groupName String that matches the desired Group's name 171 * @return a Group with the given namespace and name values. A null reference is returned if an invalid or 172 * non-existant id is supplied. 173 * @throws RiceIllegalArgumentException if the namespaceCode, groupName is null or blank 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 * Gets all groups for the given collection of group ids. 183 * 184 * <p>The result is a Map containing the group id as the key and the Group as the value.</p> 185 * 186 * @param ids Collection that matches the desired Groups' id 187 * @return a Map of Groups with the given id values. An empty Map is returned if an invalid or 188 * non-existant id is supplied. 189 * @throws RiceIllegalArgumentException if the groupIds null or empty 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 * Check whether the give principal is a member of the group. 201 * 202 * <p>Will return true if the principal is a member of the group or a group assigned to this group.</p> 203 * 204 * @param principalId Id of the principal 205 * @param groupId Id string of group 206 * @return true if principal is a member of the group or a member of a group assigned to the the group. 207 * @throws RiceIllegalArgumentException if the principalId, groupId is null or blank 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 * Check whether the give principal is a member of the group. 216 * 217 * <p>This will not recurse into contained groups. 218 */ 219 /** 220 * Check whether the give principal is a member of the group. 221 * 222 * <p>This method does not recurse into contained groups.</p> 223 * 224 * @param principalId Id of the principal 225 * @param groupId Id string of group 226 * @return true if principal is a direct member of the group. 227 * @throws RiceIllegalArgumentException if the principalId, groupId is null or blank 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 * Get all the groups for the given principal. Recurses into parent groups 236 * to provide a comprehensive list. 237 * 238 * <p> 239 * This returns id for all groups for a given principal id. 240 * </p> 241 * 242 * @param principalId Id of a Principal 243 * @return a list of Group Ids in which the principal is a member of. 244 * @throws RiceIllegalArgumentException if the principalId is null or blank 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 * Get all the groups for the given principal. Recurses into parent groups 255 * to provide a comprehensive list. This is limited to the passed in Group's namespace. 256 * 257 * <p> 258 * This returns id for all groups for a given principal id, limited to specific Group namespace. 259 * </p> 260 * 261 * @param principalId Id of a Principal 262 * @param namespaceCode Namspace code to limit group results to 263 * @return a list of Group Ids in which the principal is a member of, limited to the passed in namespace. 264 * @throws RiceIllegalArgumentException if the principalId, namespaceCode is null or blank 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 * Get all the groups for the given principal. Does not recurse into parent groups. 277 * 278 * <p> 279 * This returns id for all groups for a given principal id. 280 * </p> 281 * 282 * @param principalId Id of a Principal 283 * @return a list of Group Ids in which the principal is directly a member of. 284 * @throws RiceIllegalArgumentException if the principalId is null or blank 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 * Check whether the group identified by groupMemberId is a member of the group 296 * identified by groupId. This will recurse through all groups. 297 * 298 * <p>Will return true if the group is a member of the group or a group assigned to this group.</p> 299 * 300 * @param groupMemberId Id of the principal 301 * @param groupId Id string of group 302 * @return true if group is a member of the group or a member of a group assigned to the the group. 303 * @throws RiceIllegalArgumentException if the groupMemberId, groupId is null or blank 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 * Returns all principal ids that are members of the given group id. Recurses into contained groups for 313 * comprehensive list. 314 * 315 * <p>Will return a list of all principal ids for members this group.</p> 316 * 317 * @param groupId Id string of group 318 * @return List of principal ids 319 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Returns all principal ids that are direct members of the given group id. 331 * 332 * <p>Will return a list of all principal ids for direct members this group.</p> 333 * 334 * @param groupId Id string of group 335 * @return List of direct member principal ids. 336 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Returns all group ids that are members of the given group id. Recurses into contained groups for 348 * a comprehensive list. 349 * 350 * <p>Will return a list of all group ids for members this group.</p> 351 * 352 * @param groupId Id string of group 353 * @return List of group ids 354 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Returns all group ids that are direct members of the given group id. 366 * 367 * <p>Will return a list of all group ids for direct members this group.</p> 368 * 369 * @param groupId Id string of group 370 * @return List of direct member group ids. 371 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Returns all parent groups ids that the given group id is a member of. Recurses parent groups for 383 * a comprehensive list. 384 * 385 * <p>Will return a list of all group ids that the given group id is a member of.</p> 386 * 387 * @param groupId Id string of group 388 * @return List of parent group ids. 389 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Returns all parent groups ids that the given group id is a member of. 401 * 402 * <p>Will return a list of all group ids that the given group id is a member of.</p> 403 * 404 * @param groupId Id string of group 405 * @return List of parent group ids. 406 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Get all the attributes of the given group. 417 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Get all GroupMembers all the groups with a given group id. 428 * 429 * <p> 430 * The collection of GroupMembers will contain members for a the group in no defined order. 431 * </p> 432 * 433 * @param groupId Id of group 434 * @return Collection of GroupMembers. 435 * @throws RiceIllegalArgumentException if the groupId is null or blank 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 * Get all GroupMembers all the groups with the given group ids. 447 * 448 * <p> 449 * The collection of GroupMembers will contain members for all the groups in no defined order. 450 * The values returned may or may not be grouped by group id. 451 * </p> 452 * 453 * @param groupIds Ids of groups 454 * @return Collection of GroupMembers. 455 * @throws RiceIllegalArgumentException if the groupIds is null or empty 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 * Creates a new group using the given Group. 467 * 468 * <p> 469 * This will attempt to create a new Group 470 * </p> 471 * 472 * @param group The new group to be created 473 * @return a the Group that has been created. 474 * @throws RiceIllegalArgumentException if the group is null 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 * Updates an existing group using the given Group. 483 * 484 * <p> 485 * This will attempt to update an existing Group. For this to return without exceptions, the passed in Group 486 * must have it's Id set and be a valid group that already exists. 487 * </p> 488 * 489 * @param group The group to be updated 490 * @return a the Group that has been updated. 491 * @throws RiceIllegalArgumentException if the group is null 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 * Updates a group using the given Group. 500 * 501 * <p> 502 * This will attempt to update an existing group with data from the passed in group. If the passed in groupId and the group.id values are different 503 * this method will inactivate the old group and create a new group with the same members with the passed in groups properties. 504 * </p> 505 * 506 * @param groupId Id of the Group to be updated 507 * @param group Group object to use for update 508 * @return a the Group that has been updated. 509 * @throws RiceIllegalArgumentException if the group is null or the groupId is null or blank 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 * Creates a new group using the given GroupMember. 518 * 519 * <p> 520 * This will attempt to create a new GroupMember 521 * </p> 522 * 523 * @param groupMember The new groupMember to be created 524 * @return a the GroupMember that has been created. 525 * @throws RiceIllegalArgumentException if the group is null 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 * Updates an existing group using the given GroupMember. 534 * 535 * <p> 536 * This will attempt to update an existing GroupMember. For this to return without exceptions, the passed in 537 * GroupMember must have it's Id set and be a valid groupMember that already exists. 538 * </p> 539 * 540 * @param groupMember The groupMember to be updated 541 * @return a the GroupMember that has been updated. 542 * @throws RiceIllegalArgumentException if the groupMember is null 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 * Adds the group with the id supplied in childId as a member of the group with the id supplied in parentId. 551 * 552 * @param childId Id of the Group to be added to the members of Parent 553 * @param parentId Id of the Group object to add the member to 554 * @return true if the member was added successfully. 555 * @throws RiceIllegalArgumentException if the childId, parentId is null or blank 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 * Removes the group with the id supplied in childId from the group with the id supplied in parentId. 564 * 565 * @param childId Id of the Group to be removed from the members of Parent 566 * @param parentId Id of the Group object to remove the member from 567 * @return true if the member was removed successfully. 568 * @throws RiceIllegalArgumentException if the childId, parentId is null or blank 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 * Add the principal with the given principalId as a member of the group with the given groupId. 577 * 578 * @param principalId Id of the Principal to be added to the members of the Parent Group 579 * @param groupId Id of the Group object to add the member to 580 * @return true if the member was added successfully. 581 * @throws RiceIllegalArgumentException if the principalId, groupId is null or blank 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 * Removes the member principal with the given principalId from the group with the given groupId. 590 * 591 * @param principalId Id of the Principal to be removed from the members of the Parent Group 592 * @param groupId Id of the Group object to remove the member from 593 * @return true if the member was removed successfully. 594 * @throws RiceIllegalArgumentException if the principalId, groupId is null or blank 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 * Removes all members from the group with the given groupId. 603 * 604 * @param groupId Id of the Group object to remove the members from 605 * @throws RiceIllegalArgumentException if the groupId is null or blank 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}