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