View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kim.api.role;
17  
18  import org.kuali.rice.core.api.criteria.QueryByCriteria;
19  import org.kuali.rice.core.api.delegation.DelegationType;
20  import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
21  import org.kuali.rice.core.api.exception.RiceIllegalStateException;
22  import org.kuali.rice.core.api.util.jaxb.MapStringStringAdapter;
23  import org.kuali.rice.kim.api.KimApiConstants;
24  import org.kuali.rice.kim.api.common.delegate.DelegateMember;
25  import org.kuali.rice.kim.api.common.delegate.DelegateType;
26  import org.springframework.cache.annotation.CacheEvict;
27  import org.springframework.cache.annotation.Cacheable;
28  
29  import javax.jws.WebMethod;
30  import javax.jws.WebParam;
31  import javax.jws.WebResult;
32  import javax.jws.WebService;
33  import javax.jws.soap.SOAPBinding;
34  import javax.xml.bind.annotation.XmlElement;
35  import javax.xml.bind.annotation.XmlElementWrapper;
36  import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
37  import java.util.Collection;
38  import java.util.List;
39  import java.util.Map;
40  import java.util.Set;
41  
42  /**
43   *
44   * This service provides operations for querying role and role qualification
45   * data.
46   *
47   * <p>A role is where permissions and responsibilities are granted.  Roles have
48   * a membership consisting of principals, groups or even other roles.  By
49   * being assigned as members of a role, the associated principals will be
50   * granted all permissions and responsibilities that have been granted to the
51   * role.
52   *
53   * <p>Each membership assignment on the role can have a qualification which
54   * defines extra information about that particular member of the role.  For
55   * example, one may have the role of "Dean" but that can be further qualified
56   * by the school they are the dean of, such as "Dean of Computer Science".
57   * Authorization checks that are then done in the permission service can pass
58   * qualifiers as part of the operation if they want to restrict the subset of
59   * the role against which the check is made.
60   *
61   * @author Kuali Rice Team (rice.collab@kuali.org)
62   *
63   */
64  @WebService(name = "roleService", targetNamespace = KimApiConstants.Namespaces.KIM_NAMESPACE_2_0 )
65  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
66  public interface RoleService {
67      /**
68       * This will create a {@link org.kuali.rice.kim.api.role.Role} exactly like the role passed in.
69       *
70       * @param role the role to create
71       * @return the newly created object.  will never be null.
72       * @throws RiceIllegalArgumentException if the role passed in is null
73       * @throws RiceIllegalStateException if the role is already existing in the system
74       */
75      @WebMethod(operationName="createRole")
76      @WebResult(name = "role")
77      @CacheEvict(value={Role.Cache.NAME, RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME}, allEntries = true)
78      Role createRole(@WebParam(name = "role") Role role)
79              throws RiceIllegalArgumentException, RiceIllegalStateException;
80  
81      /**
82       * This will update a {@link Role}.
83       *
84       * @param role the role to update
85       * @throws RiceIllegalArgumentException if the role is null
86       * @throws RiceIllegalStateException if the role does not exist in the system
87       */
88      @WebMethod(operationName="updateRole")
89      @WebResult(name = "role")
90      @CacheEvict(value={Role.Cache.NAME, RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME}, allEntries = true)
91      Role updateRole(@WebParam(name = "role") Role role)
92              throws RiceIllegalArgumentException, RiceIllegalStateException;
93  
94  	/**
95  	 * Get the KIM Role object with the given ID.
96  	 *
97       * @param id the id of the role.
98       * @return the role with the given id or null if role doesn't exist.
99       * @throws RiceIllegalArgumentException if roleId is null or Blank
100 	 */
101     @WebMethod(operationName = "getRole")
102     @WebResult(name = "role")
103     @Cacheable(value= Role.Cache.NAME, key="'id=' + #p0")
104     Role getRole(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
105 
106 	/**
107 	 * Get the KIM Role objects for the role IDs in the given List.
108      *
109      * @param ids the ids of the roles.
110      * @return a list of roles with the given ids or null if no roles are found.
111      * @throws RiceIllegalArgumentException if ids is null or Blank
112 	 */
113     @WebMethod(operationName = "getRoles")
114     @XmlElementWrapper(name = "roles", required = true)
115     @XmlElement(name = "role", required = false)
116     @WebResult(name = "roles")
117     @Cacheable(value= Role.Cache.NAME, key="'ids=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0)")
118 	List<Role> getRoles( @WebParam(name="ids") List<String> ids ) throws RiceIllegalArgumentException;
119 
120 	/** Get the KIM Role object with the unique combination of namespace, component,
121 	 * and role name.
122 	 *
123      * @param namespaceCode the namespace code of the role.
124      * @param name the name of the role.
125      * @return a role with the given namespace code and name or null if role does not exist.
126      * @throws RiceIllegalArgumentException if namespaceCode or name is null or blank.
127 	 */
128     @WebMethod(operationName = "getRoleByNamespaceCodeAndName")
129     @WebResult(name = "role")
130     @Cacheable(value=Role.Cache.NAME, key="'namespaceCode=' + #p0 + '|' + 'name=' + #p1")
131     Role getRoleByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
132             @WebParam(name = "name") String name) throws RiceIllegalArgumentException;
133 
134 	/**
135 	 * Return the Role ID for the given unique combination of namespace,
136 	 * component and role name.
137      *
138      * @param namespaceCode the namespace code of the role.
139      * @param name the name of the role.
140      * @return a role id for a role with the given namespace code and name or null if role does not exist.
141      * @throws RiceIllegalArgumentException if namespaceCode or name is null or blank.
142 	 */
143     @WebMethod(operationName = "getRoleIdByNamespaceCodeAndName")
144     @WebResult(name = "roleId")
145     @Cacheable(value=Role.Cache.NAME, key="'{getRoleIdByNamespaceCodeAndName}' + 'namespaceCode=' + #p0 + '|' + 'name=' + #p1")
146 	String getRoleIdByNamespaceCodeAndName(@WebParam(name = "namespaceCode") String namespaceCode,
147             @WebParam(name = "name") String name) throws RiceIllegalArgumentException;
148 
149 	/**
150 	 * Checks whether the role with the given role ID is active.
151 	 *
152 	 * @param id the unique id of a role.
153 	 * @return true if the role with the given id is active.
154      * @throws RiceIllegalArgumentException if id is null or blank.
155 	 */
156     @WebMethod(operationName = "isRoleActive")
157     @WebResult(name = "isRoleActive")
158     @Cacheable(value=Role.Cache.NAME, key="'{isRoleActive}' + 'id=' + #p0")
159     boolean isRoleActive( @WebParam(name="id") String id ) throws RiceIllegalArgumentException;
160 
161     /**
162      * Returns a list of role qualifiers that the given principal has without taking into consideration
163      * that the principal may be a member via an assigned group or role.  Use in situations where
164      * you are only interested in the qualifiers that are directly assigned to the principal.
165      *
166      * @param principalId the principalId to
167      * @param roleIds the namespace code of the role.
168      * @param qualification the qualifications for the roleIds.
169      * @return a map of role qualifiers for the given principalId, roleIds and qualifications or an empty map if none found.
170      * @throws RiceIllegalArgumentException if principalId is null or blank or roleIds is null.
171      */
172     @WebMethod(operationName = "getRoleQualifersForPrincipalByRoleIds")
173     @XmlElementWrapper(name = "attributes", required = true)
174     @XmlElement(name = "attribute", required = false)
175     @WebResult(name = "attributes")
176     @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
177     List<Map<String, String>> getRoleQualifersForPrincipalByRoleIds(@WebParam(name = "principalId") String principalId,
178             @WebParam(name = "roleIds") List<String> roleIds, @WebParam(name = "qualification") @XmlJavaTypeAdapter(
179             value = MapStringStringAdapter.class) Map<String, String> qualification)
180             throws RiceIllegalArgumentException;
181 
182     /**
183      * Returns a list of role qualifiers that the given principal has without taking into consideration
184      * that the principal may be a member via an assigned group or role.  Use in situations where
185      * you are only interested in the qualifiers that are directly assigned to the principal.
186      *
187      * @param principalId the principalId to
188      * @param namespaceCode the namespace code of the role.
189      * @param roleName the name of the role.
190      * @param qualification the qualifications for the roleIds.
191      * @return a map of role qualifiers for the given parameters or an empty map if none found.
192      * @throws RiceIllegalArgumentException if principalId, namespaceCode, or roleName is null or blank.
193      */
194     @WebMethod(operationName = "getRoleQualifersForPrincipalByNamespaceAndRolename")
195     @XmlElementWrapper(name = "attributes", required = true)
196     @XmlElement(name = "attribute", required = false)
197     @WebResult(name = "attributes")
198     @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
199     List<Map<String, String>> getRoleQualifersForPrincipalByNamespaceAndRolename(
200             @WebParam(name = "principalId") String principalId, @WebParam(name = "namespaceCode") String namespaceCode,
201             @WebParam(name = "roleName") String roleName, @WebParam(name = "qualification") @XmlJavaTypeAdapter(
202             value = MapStringStringAdapter.class) Map<String, String> qualification)
203             throws RiceIllegalArgumentException;
204 
205     /**
206      * Returns a list of role qualifiers that the given principal.  If the principal's membership
207      * is via a group or role, that group or role's qualifier on the given role is returned.
208      *
209      * @param principalId the principalId to
210      * @param namespaceCode the namespace code of the role.
211      * @param roleName the name of the role.
212      * @param qualification the qualifications for the roleIds.
213      * @return a map of nested role qualifiers for the given parameters or an empty map if none found.
214      * @throws RiceIllegalArgumentException if principalId, namespaceCode, or roleName is null or blank.
215      */
216     @WebMethod(operationName = "getNestedRoleQualifersForPrincipalByNamespaceAndRolename")
217     @XmlElementWrapper(name = "attributes", required = true)
218     @XmlElement(name = "attribute", required = false)
219     @WebResult(name = "attributes")
220     @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
221 	List<Map<String, String>> getNestedRoleQualifersForPrincipalByNamespaceAndRolename(
222             @WebParam(name = "principalId") String principalId, @WebParam(name = "namespaceCode") String namespaceCode,
223             @WebParam(name = "roleName") String roleName, @WebParam(name = "qualification") @XmlJavaTypeAdapter(
224             value = MapStringStringAdapter.class) Map<String, String> qualification)
225             throws RiceIllegalArgumentException;
226 
227     /**
228      * Returns a list of role qualifiers that the given principal.  If the principal's membership
229      * is via a group or role, that group or role's qualifier on the given role is returned.
230      *
231      * @param principalId the principalId to
232      * @param roleIds the namespace code of the role.
233      * @param qualification the qualifications for the roleIds.
234      * @return a map of role qualifiers for the given roleIds and qualifications or an empty map if none found.
235      * @throws RiceIllegalArgumentException if principalId, namespaceCode, or roleName is null or blank.
236      */
237     @WebMethod(operationName = "getNestedRoleQualifiersForPrincipalByRoleIds")
238     @XmlElementWrapper(name = "attributes", required = true)
239     @XmlElement(name = "attribute", required = false)
240     @WebResult(name = "attributes")
241     @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
242 	List<Map<String, String>> getNestedRoleQualifiersForPrincipalByRoleIds(
243             @WebParam(name = "principalId") String principalId, @WebParam(name = "roleIds") List<String> roleIds,
244             @WebParam(name = "qualification") @XmlJavaTypeAdapter(
245                     value = MapStringStringAdapter.class) Map<String, String> qualification)
246             throws RiceIllegalArgumentException;
247 
248 
249     // --------------------
250     // Role Membership Checks
251     // --------------------
252 
253     /**
254      * Get all the role members (groups and principals) associated with the given list of roles
255      * where their role membership/assignment matches the given qualification.  The list of RoleMemberships returned
256      * will only contain group and principal members.  Any nested role members will be resolved and flattened into
257      * the principals and groups that are members of that nested role (assuming qualifications match).
258      *
259      * The return object will have each membership relationship along with the delegations
260      *
261      * @param roleIds a list of role Ids.
262      * @param qualification the qualifications for the roleIds.
263      * @return a list of role members for the given roleIds and qualifications or an empty list if none found.
264      * @throws RiceIllegalArgumentException if roleIds is null.
265      */
266     @WebMethod(operationName = "getRoleMembers")
267     @XmlElementWrapper(name = "roleMemberships", required = true)
268     @XmlElement(name = "roleMembership", required = false)
269     @WebResult(name = "roleMemberships")
270     List<RoleMembership> getRoleMembers(
271                 @WebParam(name="roleIds")
272                 List<String> roleIds,
273                 @WebParam(name="qualification")
274                 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
275                 Map<String, String> qualification )
276             throws RiceIllegalArgumentException;
277 
278     /**
279 	 * This method gets all the members, then traverses down into members of type role and group to obtain the nested principal ids
280 	 *
281      * @param namespaceCode the namespace code of the role.
282      * @param roleName the name of the role
283      * @param qualification the qualifications for the roleIds.
284      * @return a list of role member principalIds for the given roleIds and qualifications, or an empty list if none found.
285      * @throws RiceIllegalArgumentException if namespaceCode, or roleName is null or blank.
286 	 */
287     @WebMethod(operationName = "getRoleMemberPrincipalIds")
288     @XmlElementWrapper(name = "principalIds", required = true)
289     @XmlElement(name = "principalId", required = false)
290     @WebResult(name = "principalIds")
291     Collection<String> getRoleMemberPrincipalIds(@WebParam(name="namespaceCode") String namespaceCode,
292                 @WebParam(name="roleName") String roleName,
293                 @WebParam(name="qualification")
294                 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
295                 Map<String, String> qualification)
296             throws RiceIllegalArgumentException;
297 
298     /**
299      * Returns whether the given principal has any of the passed role IDs with the given qualification.
300      *
301      * @param principalId the principal Id to check.
302      * @param roleIds the list of role ids.
303      * @param qualification the qualifications for the roleIds.
304      * @return true if the principal is assigned the one of the given roleIds with the passed in qualifications.
305      * @throws RiceIllegalArgumentException if roleIds is null or principalId is null or blank.
306      */
307     @WebMethod(operationName = "principalHasRole")
308     @WebResult(name = "principalHasRole")
309     boolean principalHasRole( @WebParam(name="principalId") String principalId,
310             @WebParam(name="roleIds") List<String> roleIds,
311             @WebParam(name="qualification") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> qualification )
312             throws RiceIllegalArgumentException;
313 
314     /**
315      * Returns the subset of the given principal ID list which has the given role and qualification.
316      * This is designed to be used by lookups of people by their roles.
317      *
318      * @param principalIds the principal Ids to check.
319      * @param roleNamespaceCode the namespaceCode of the role.
320      * @param roleName the name of the role.
321      * @param qualification the qualifications for the roleIds.
322      * @return list of principalIds that is the subset of list passed in with the given role and qualifications or an empty list.
323      * @throws RiceIllegalArgumentException if principalIds is null or the roleNamespaceCode or roleName is null or blank.
324      */
325     @WebMethod(operationName = "getPrincipalIdSubListWithRole")
326     @XmlElementWrapper(name = "principalIds", required = true)
327     @XmlElement(name = "principalId", required = false)
328     @WebResult(name = "principalIds")
329     List<String> getPrincipalIdSubListWithRole( @WebParam(name="principalIds") List<String> principalIds,
330             @WebParam(name="roleNamespaceCode") String roleNamespaceCode,
331             @WebParam(name="roleName") String roleName,
332             @WebParam(name="qualification") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> qualification )
333             throws RiceIllegalArgumentException;
334 
335     /**
336 	 *
337 	 * This method gets search results for role lookup
338      *
339      * @param queryByCriteria the qualifications for the roleIds.
340      * @return query results.  will never return null.
341      * @throws RiceIllegalArgumentException if queryByCriteria is null.
342 	 */
343     @WebMethod(operationName = "getRolesSearchResults")
344     @WebResult(name = "results")
345 	RoleQueryResults findRoles(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
346 
347 
348 
349     /**
350      * Gets all direct members of the roles that have ids within the given list
351      * of role ids.  This method does not recurse into any nested roles.
352      *
353      *  <p>The resulting List of role membership will contain membership for
354      *  all the roles with the specified ids.  The list is not guaranteed to be
355      *  in any particular order and may have membership info for the
356      *  different roles interleaved with each other.
357      *
358      * @param roleIds a list of  role Ids.
359      * @return list of RoleMembership that contains membership for the specified roleIds or empty list if none found.
360      * @throws RiceIllegalArgumentException if roleIds is null.
361      */
362     @WebMethod(operationName = "getFirstLevelRoleMembers")
363     @XmlElementWrapper(name = "roleMemberships", required = true)
364     @XmlElement(name = "roleMembership", required = false)
365     @WebResult(name = "roleMemberships")
366     @Cacheable(value=RoleMembership.Cache.NAME, key="'roleIds=' + T(org.kuali.rice.core.api.cache.CacheKeyUtils).key(#p0)")
367 	List<RoleMembership> getFirstLevelRoleMembers(
368                 @WebParam(name="roleIds") List<String> roleIds) throws RiceIllegalArgumentException;
369 
370 	/**
371 	 * Gets role member information based on the given search criteria.
372      *
373      * @param queryByCriteria the qualifications for the roleIds.
374      * @return query results.  will never return null.
375      * @throws RiceIllegalArgumentException if queryByCriteria is null.
376 	 */
377     @WebMethod(operationName = "findRoleMemberships")
378     @WebResult(name = "results")
379 	RoleMembershipQueryResults findRoleMemberships(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
380 
381 	/**
382 	 * Gets a list of Roles that the given member belongs to.
383      *
384      * @param memberType the role member type.
385      * @param memberId the role member id (principalId, roleId, groupId).
386      * @return list of RoleMembership that contains membership for the specified roleIds or an empty list if none found.
387      * @throws RiceIllegalArgumentException if memberType or memberId is null or blank.
388 	 */
389     @WebMethod(operationName = "getMemberParentRoleIds")
390     @XmlElementWrapper(name = "roleIds", required = true)
391     @XmlElement(name = "roleId", required = false)
392     @WebResult(name = "roleIds")
393     @Cacheable(value=RoleMembership.Cache.NAME, key="'memberType=' + #p0 + '|' + 'memberId=' + #p1")
394 	List<String> getMemberParentRoleIds(String memberType, String memberId) throws RiceIllegalArgumentException;
395 
396 
397     /**
398      * Gets role members based on the given search criteria.
399      *
400      * @param queryByCriteria the qualifications for the roleIds.
401      * @return query results.  will never return null.
402      * @throws RiceIllegalArgumentException if queryByCriteria is null.
403      */
404     @WebMethod(operationName = "findRoleMembers")
405     @WebResult(name = "results")
406 	RoleMemberQueryResults findRoleMembers(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
407 
408 
409     /**
410      * Gets a list of Roles Ids that are a member of the given roleId, including nested membership.
411      *
412      * @param roleId the role id.
413      * @return list of RoleIds that are members of the given role or and empty list if none found.
414      * @throws RiceIllegalArgumentException if roleId is null or blank.
415      */
416     @WebMethod(operationName = "getRoleTypeRoleMemberIds")
417     @XmlElementWrapper(name = "memberIds", required = true)
418     @XmlElement(name = "memberId", required = false)
419     @WebResult(name = "memberIds")
420     @Cacheable(value=RoleMember.Cache.NAME, key="'{getRoleTypeRoleMemberIds}' + 'roleId=' + #p0")
421     Set<String> getRoleTypeRoleMemberIds(@WebParam(name = "roleId") String roleId) throws RiceIllegalArgumentException;
422 
423 
424     /**
425      * Gets role members based on the given search criteria.
426      *
427      * @param queryByCriteria the qualifications for the roleIds.
428      * @return query results.  will never return null.
429      * @throws RiceIllegalArgumentException if queryByCriteria is null.
430      */
431     @WebMethod(operationName = "findDelegateMembers")
432     @WebResult(name = "results")
433     DelegateMemberQueryResults findDelegateMembers(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
434 
435 	/**
436 	 * Gets the delegate members for the given delegation.
437      *
438      * @param delegateId the delegate id.
439      * @return list of delegate members that are members of the given delegation or an empty list if none found.
440      * @throws RiceIllegalArgumentException if delegationId is null or blank.
441 	 */
442     @WebMethod(operationName = "getDelegationMembersByDelegationId")
443     @XmlElementWrapper(name = "delegateMembers", required = true)
444     @XmlElement(name = "delegateMember", required = false)
445     @WebResult(name = "delegateMembers")
446     @Cacheable(value=DelegateMember.Cache.NAME, key="'delegateId=' + #p0")
447     List<DelegateMember> getDelegationMembersByDelegationId(
448             @WebParam(name = "delegateId") String delegateId) throws RiceIllegalArgumentException;
449 
450 
451     /**
452      * Gets the delegate member for the given delegationId and memberId.
453      *
454      * @param delegationId the delegate id.
455      * @param memberId the member id matching the DelegateMember
456      * @return the delegate member with the given parameters or null if not found.
457      * @throws RiceIllegalArgumentException if delegationId or memberId is null or blank.
458      */
459     @WebMethod(operationName = "getDelegationMemberByDelegationAndMemberId")
460     @WebResult(name = "delegateMember")
461     @Cacheable(value=DelegateMember.Cache.NAME, key="'delegateId=' + #p0 + '|' + 'memberId=' + #p1")
462     DelegateMember getDelegationMemberByDelegationAndMemberId(
463             @WebParam(name = "delegationId") String delegationId, @WebParam(name = "memberId") String memberId) throws RiceIllegalArgumentException;
464 
465 
466     /**
467      * Gets the delegate member with the given delegation member id.
468      *
469      * @param id the member id matching the DelegateMember
470      * @return the delegate member with the given parameters or null if not found.
471      * @throws RiceIllegalArgumentException if delegationId or memberId is null or blank.
472      */
473     @WebMethod(operationName = "getDelegationMemberById")
474     @WebResult(name = "delegateMember")
475     @Cacheable(value=DelegateMember.Cache.NAME, key="'id=' + #p0")
476     DelegateMember getDelegationMemberById(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
477 
478 
479     /**
480      * Gets a list of role reponsibilities for the given role id.
481      *
482      * @param roleId the role Id.
483      * @return a list of RoleResponsibilities for the given role Id, or an empty list if none found.
484      * @throws RiceIllegalArgumentException if roleId is null or blank.
485      */
486     @WebMethod(operationName = "getRoleResponsibilities")
487     @XmlElementWrapper(name = "roleResponsibilities", required = true)
488     @XmlElement(name = "roleResponsibility", required = false)
489     @WebResult(name = "roleResponsibilities")
490     @Cacheable(value=RoleResponsibility.Cache.NAME, key="'roleId=' + #p0")
491 	List<RoleResponsibility> getRoleResponsibilities(@WebParam(name="roleId") String roleId)  throws RiceIllegalArgumentException;
492 
493 
494     /**
495      * Gets a list of RoleResponsibilityActions for the given role member id.
496      *
497      * @param roleMemberId the role member Id.
498      * @return a list of RoleResponsibilityActions for the given role member Id, or an empty list if none found.
499      * @throws RiceIllegalArgumentException if roleMemberId is null or blank.
500      */
501     @WebMethod(operationName = "getRoleMemberResponsibilityActions")
502     @XmlElementWrapper(name = "roleResponsibilityActions", required = true)
503     @XmlElement(name = "roleResponsibilityAction", required = false)
504     @WebResult(name = "roleResponsibilityActions")
505     @Cacheable(value=RoleResponsibility.Cache.NAME, key="'roleMemberId=' + #p0")
506 	List<RoleResponsibilityAction> getRoleMemberResponsibilityActions(
507             @WebParam(name = "roleMemberId") String roleMemberId)  throws RiceIllegalArgumentException;
508 
509 
510     /**
511      * Gets a DelegateTyupe for the given role id and delegation type.
512      *
513      * @param roleId the role Id.
514      * @param delegateType type of delegation
515      * @return the DelegateType for the given role Id and delegationType, or null if none found.
516      * @throws RiceIllegalArgumentException if roleId or delegationType is null or blank.
517      */
518     @WebMethod(operationName = "getDelegateTypeByRoleIdAndDelegateTypeCode")
519     @WebResult(name = "delegateType")
520     @Cacheable(value=DelegateType.Cache.NAME, key="'roleId=' + #p0 + '|' + 'code=' + #p1")
521     DelegateType getDelegateTypeByRoleIdAndDelegateTypeCode(@WebParam(name = "roleId") String roleId,
522             @WebParam(name = "delegateType") DelegationType delegateType)  throws RiceIllegalArgumentException;
523 
524 
525     /**
526      * Gets a DelegateType for the given delegation id.
527      *
528      * @param delegationId the id of delegation
529      * @return the DelegateType for the given delegation Id, or null if none found.
530      * @throws RiceIllegalArgumentException if delegationId is null or blank.
531      */
532     @WebMethod(operationName = "getDelegateTypeByDelegationId")
533     @WebResult(name = "delegateType")
534     @Cacheable(value=DelegateType.Cache.NAME, key="'delegationId=' + #p0")
535     DelegateType getDelegateTypeByDelegationId(@WebParam(name = "delegationId") String delegationId)  throws RiceIllegalArgumentException;
536 
537     /**
538 	 * Assigns the principal with the given id to the role with the specified
539 	 * namespace code and name with the supplied set of qualifications.
540      *
541      * @param principalId the principalId
542      * @param namespaceCode the namespaceCode of the Role
543      * @param roleName the name of the role
544      * @param qualifications the qualifications for the principalId to be assigned to the role
545      * @return newly created/assigned RoleMember.
546      * @throws RiceIllegalArgumentException if princialId, namespaceCode or roleName is null or blank.
547 	 */
548     @WebMethod(operationName = "assignPrincipalToRole")
549     @WebResult(name = "roleMember")
550     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
551     RoleMember assignPrincipalToRole(@WebParam(name="principalId") String principalId,
552                 @WebParam(name="namespaceCode")
553                 String namespaceCode,
554                 @WebParam(name="roleName")
555                 String roleName,
556                 @WebParam(name="qualifications")
557                 @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
558                 Map<String, String> qualifications)
559             throws RiceIllegalArgumentException;
560 
561 	/**
562 	 * Assigns the group with the given id to the role with the specified
563 	 * namespace code and name with the supplied set of qualifications.
564      *
565      * @param groupId the groupId
566      * @param namespaceCode the namespaceCode of the Role
567      * @param roleName the name of the role
568      * @param qualifications the qualifications for the principalId to be assigned to the role
569      * @return newly created/assigned RoleMember.
570      * @throws RiceIllegalArgumentException if groupId, namespaceCode or roleName is null or blank.
571 	 */
572     @WebMethod(operationName = "assignGroupToRole")
573     @WebResult(name = "roleMember")
574     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
575     RoleMember assignGroupToRole(@WebParam(name="groupId") String groupId,
576     		@WebParam(name="namespaceCode") String namespaceCode,
577     		@WebParam(name="roleName") String roleName,
578     		@WebParam(name="qualifications") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> qualifications)
579             throws RiceIllegalArgumentException;
580 
581 	/**
582 	 * Assigns the role with the given id to the role with the specified
583 	 * namespace code and name with the supplied set of qualifications.
584      *
585      * @param roleId the roleId
586      * @param namespaceCode the namespaceCode of the Role
587      * @param roleName the name of the role
588      * @param qualifications the qualifications for the principalId to be assigned to the role
589      * @return newly created/assigned RoleMember.
590      * @throws RiceIllegalArgumentException if princiapId, namespaceCode or roleName is null or blank.
591 	 */
592     @WebMethod(operationName = "assignRoleToRole")
593     @WebResult(name = "roleMember")
594     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
595     RoleMember assignRoleToRole(@WebParam(name="roleId") String roleId,
596     		@WebParam(name="namespaceCode") String namespaceCode,
597     		@WebParam(name="roleName") String roleName,
598     		@WebParam(name="qualifications") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> qualifications)
599             throws RiceIllegalArgumentException;
600 
601 	/**
602 	 * Creates a new RoleMember.  Needs to be passed a valid RoleMember object that does not currently exist.
603      *
604      * @param roleMember the new RoleMember to save.
605      * @return RoleMember as created.
606      * @throws RiceIllegalArgumentException if roleMember is null.
607      * @throws RiceIllegalStateException if roleMember already exists.
608 	 */
609     @WebMethod(operationName = "createRoleMember")
610     @WebResult(name = "roleMember")
611     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
612     RoleMember createRoleMember(
613                 @WebParam(name = "roleMember")
614                 RoleMember roleMember) throws RiceIllegalArgumentException, RiceIllegalStateException;
615 
616     /**
617 	 * Updates the given roleMember to the values in the passed in roleMember
618      *
619      * @param roleMember the new RoleMember to save.
620      * @return RoleMember as updated.
621      * @throws RiceIllegalArgumentException if roleMember is null.
622      * @throws RiceIllegalStateException if roleMember does not yet exist.
623 	 */
624     @WebMethod(operationName = "updateRoleMember")
625     @WebResult(name = "roleMember")
626     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
627     RoleMember updateRoleMember(@WebParam(name = "roleMember") RoleMember roleMember) throws RiceIllegalArgumentException, RiceIllegalStateException;
628 
629 
630     /**
631      * Creates a new RoleResponsibilityAction.  Needs to be passed a valid RoleResponsibilityAction
632      * object that does not currently exist.
633      *
634      * @param roleResponsibilityAction the new RoleResponsibilityAction to save.
635      * @return RoleResponsibilityAction as created.
636      * @throws RiceIllegalArgumentException if roleResponsibilityAction is null.
637      * @throws RiceIllegalStateException if roleResponsibilityAction already exists.
638      */
639     @WebMethod(operationName = "createRoleResponsibilityAction")
640     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
641     RoleResponsibilityAction createRoleResponsibilityAction(@WebParam(name = "roleResponsibilityAction") RoleResponsibilityAction roleResponsibilityAction) throws RiceIllegalArgumentException;
642 
643     /**
644      * Creates a new DelegateType.  Needs to be passed a valid DelegateType
645      * object that does not currently exist.
646      *
647      * @param delegateType the new DelegateType to save.
648      * @return DelegateType as created.
649      * @throws RiceIllegalArgumentException if delegateType is null.
650      * @throws RiceIllegalStateException if delegateType already exists.
651      */
652     @WebMethod(operationName = "createDelegateType")
653     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
654     DelegateType createDelegateType(@WebParam(name="delegateType") DelegateType delegateType) throws RiceIllegalArgumentException, RiceIllegalStateException;
655 
656     /**
657      * Updates the given DelegateType to the values in the passed in delegateType
658      *
659      * @param delegateType the new DelegateType to save.
660      * @return DelegateType as updated.
661      * @throws RiceIllegalArgumentException if delegateType is null.
662      * @throws RiceIllegalStateException if delegateType does not yet exist.
663      */
664     @WebMethod(operationName = "updateDelegateType")
665     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
666     DelegateType updateDelegateType(@WebParam(name="delegateType") DelegateType delegateType) throws RiceIllegalArgumentException, RiceIllegalStateException;
667 
668     /**
669      * Remove the principal with the given id and qualifications from the role
670      * with the specified namespace code and role name.
671      *
672      * @param principalId the principalId
673      * @param namespaceCode the namespaceCode of the Role
674      * @param roleName the name of the role
675      * @param qualifications the qualifications for the principalId to be assigned to the role
676      * @return void.
677      * @throws RiceIllegalArgumentException if principalId, namespaceCode or roleName is null or blank.
678      */
679     @WebMethod(operationName = "removePrincipalFromRole")
680     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
681     void removePrincipalFromRole(@WebParam(name="principalId") String principalId,
682     		@WebParam(name="namespaceCode") String namespaceCode,
683     		@WebParam(name="roleName") String roleName,
684     		@WebParam(name="qualifications") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> qualifications) throws RiceIllegalArgumentException;
685 
686     /**
687      * Remove the group with the given id and qualifications from the role
688      * with the specified namespace code and role name.
689      *
690      * @param groupId the groupId
691      * @param namespaceCode the namespaceCode of the Role
692      * @param roleName the name of the role
693      * @param qualifications the qualifications for the principalId to be assigned to the role
694      * @return void.
695      * @throws RiceIllegalArgumentException if groupId, namespaceCode or roleName is null or blank.
696      */
697     @WebMethod(operationName = "removeGroupFromRole")
698     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
699     void removeGroupFromRole(@WebParam(name="groupId") String groupId,
700     		@WebParam(name="namespaceCode") String namespaceCode,
701     		@WebParam(name="roleName") String roleName,
702     		@WebParam(name="qualifications") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> qualifications) throws RiceIllegalArgumentException;
703 
704     /**
705      * Remove the group with the given id and qualifications from the role
706      * with the specified namespace code and role name.
707      *
708      * @param roleId the roleId
709      * @param namespaceCode the namespaceCode of the Role
710      * @param roleName the name of the role
711      * @param qualifications the qualifications for the principalId to be assigned to the role
712      * @return void.
713      * @throws RiceIllegalArgumentException if roleId, namespaceCode or roleName is null or blank.
714      */
715     @WebMethod(operationName = "removeRoleFromRole")
716     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
717     void removeRoleFromRole(@WebParam(name="roleId") String roleId,
718     		@WebParam(name="namespaceCode") String namespaceCode,
719     		@WebParam(name="roleName") String roleName,
720     		@WebParam(name="qualifications") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> qualifications) throws RiceIllegalArgumentException;
721 
722     /**
723      * Assigns the given permission to the given role
724      *
725      * @param permissionId the permissionId
726      * @param roleId the roleId
727      * @return void.
728      * @throws RiceIllegalArgumentException if permissionId or roleId is null or blank.
729      */
730     @WebMethod(operationName = "assignPermissionToRole")
731     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
732     void assignPermissionToRole(
733             @WebParam(name = "permissionId") String permissionId,
734             @WebParam(name = "roleId") String roleId)
735             throws RiceIllegalArgumentException;
736 
737     /**
738      * Removes the given permission to the given role
739      *
740      * @param permissionId the permissionId
741      * @param roleId the roleId
742      * @return void.
743      * @throws RiceIllegalArgumentException if permissionId or roleId is null or blank.
744      */
745     @WebMethod(operationName = "revokePermissionFromRole")
746     @CacheEvict(value={RoleMembership.Cache.NAME, RoleMember.Cache.NAME, DelegateMember.Cache.NAME, RoleResponsibility.Cache.NAME, DelegateType.Cache.NAME }, allEntries = true)
747     void revokePermissionFromRole(
748             @WebParam(name = "permissionId") String permissionId,
749             @WebParam(name = "roleId") String roleId)
750             throws RiceIllegalArgumentException;
751 }