Coverage Report - org.kuali.rice.kim.api.role.RoleService
 
Classes in this File Line Coverage Branch Coverage Complexity
RoleService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2006-2011 The Kuali Foundation
 3  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 4  
  * you may not use this file except in compliance with the License.
 5  
  * You may obtain a copy of the License at
 6  
  *
 7  
  * http://www.opensource.org/licenses/ecl2.php
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing, software
 10  
  * distributed under the License is distributed on an "AS IS" BASIS,
 11  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
  * See the License for the specific language governing permissions and
 13  
  * limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.rice.kim.api.role;
 17  
 
 18  
 import org.kuali.rice.core.util.AttributeSet;
 19  
 import org.kuali.rice.core.util.jaxb.AttributeSetAdapter;
 20  
 import org.kuali.rice.core.util.jaxb.MapStringStringAdapter;
 21  
 import org.kuali.rice.kim.api.KimConstants;
 22  
 import org.kuali.rice.kim.api.common.delegate.Delegate;
 23  
 import org.kuali.rice.kim.api.common.delegate.DelegateType;
 24  
 
 25  
 import javax.jws.WebMethod;
 26  
 import javax.jws.WebParam;
 27  
 import javax.jws.WebResult;
 28  
 import javax.jws.WebService;
 29  
 import javax.jws.soap.SOAPBinding;
 30  
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 31  
 import java.util.Collection;
 32  
 import java.util.List;
 33  
 import java.util.Map;
 34  
 
 35  
 /**
 36  
  *
 37  
  * This service provides operations for querying role and role qualification
 38  
  * data.
 39  
  *
 40  
  * <p>A role is where permissions and responsibilities are granted.  Roles have
 41  
  * a membership consisting of principals, groups or even other roles.  By
 42  
  * being assigned as members of a role, the associated principals will be
 43  
  * granted all permissions and responsibilities that have been granted to the
 44  
  * role.
 45  
  *
 46  
  * <p>Each membership assignment on the role can have a qualification which
 47  
  * defines extra information about that particular member of the role.  For
 48  
  * example, one may have the role of "Dean" but that can be further qualified
 49  
  * by the school they are the dean of, such as "Dean of Computer Science".
 50  
  * Authorization checks that are then done in the permission service can pass
 51  
  * qualifiers as part of the operation if they want to restrict the subset of
 52  
  * the role against which the check is made.
 53  
  *
 54  
  * <p>This service provides read-only operations.  For write operations, see
 55  
  * {@link RoleUpdateService}.
 56  
  *
 57  
  * @see RoleUpdateService
 58  
  * @see org.kuali.rice.kim.service.PermissionService
 59  
  *
 60  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 61  
  *
 62  
  */
 63  
 @WebService(name = "RoleService", targetNamespace = KimConstants.Namespaces.KIM_NAMESPACE_2_0 )
 64  
 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
 65  
 public interface RoleService {
 66  
     // --------------------
 67  
     // Role Data
 68  
     // --------------------
 69  
 
 70  
         /**
 71  
          * Get the KIM Role object with the given ID.
 72  
          *
 73  
          * If the roleId is blank, this method returns <code>null</code>.
 74  
          */
 75  
     @WebMethod(operationName = "getRole")
 76  
     @WebResult(name = "role")
 77  
     Role getRole(@WebParam(name = "roleId") String roleId);
 78  
 
 79  
         /**
 80  
          * Get the KIM Role objects for the role IDs in the given List.
 81  
          */
 82  
     @WebMethod(operationName = "getRoles")
 83  
     @WebResult(name = "roles")
 84  
         List<Role> getRoles( @WebParam(name="roleIds") List<String> roleIds );
 85  
 
 86  
         /** Get the KIM Role object with the unique combination of namespace, component,
 87  
          * and role name.
 88  
          *
 89  
          * If any parameter is blank, this method returns <code>null</code>.
 90  
          */
 91  
     @WebMethod(operationName = "getRoleByName")
 92  
     @WebResult(name = "role")
 93  
     Role getRoleByName(@WebParam(name = "namespaceCode") String namespaceCode,
 94  
                        @WebParam(name = "roleName") String roleName);
 95  
 
 96  
         /**
 97  
          * Return the Role ID for the given unique combination of namespace,
 98  
          * component and role name.
 99  
          */
 100  
     @WebMethod(operationName = "getRoleIdByName")
 101  
     @WebResult(name = "roleId")
 102  
         String getRoleIdByName( @WebParam(name="namespaceCode") String namespaceCode,
 103  
                             @WebParam(name="roleName") String roleName );
 104  
 
 105  
         /**
 106  
          * Checks whether the role with the given role ID is active.
 107  
          *
 108  
          * @param roleId
 109  
          * @return
 110  
          */
 111  
     @WebMethod(operationName = "isRoleActive")
 112  
     @WebResult(name = "isRoleActive")
 113  
     boolean isRoleActive( @WebParam(name="roleId") String roleId );
 114  
 
 115  
     /**
 116  
      * Returns a list of role qualifiers that the given principal has without taking into consideration
 117  
      * that the principal may be a member via an assigned group or role.  Use in situations where
 118  
      * you are only interested in the qualifiers that are directly assigned to the principal.
 119  
      */
 120  
     @WebMethod(operationName = "getRoleQualifersForPrincipalByRoleIds")
 121  
     @WebResult(name = "attributeSets")
 122  
     List<AttributeSet> getRoleQualifiersForPrincipal(@WebParam(name="principalId") String principalId,
 123  
                                                      @WebParam(name="roleIds") List<String> roleIds,
 124  
                                                      @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 125  
 
 126  
     /**
 127  
      * Returns a list of role qualifiers that the given principal has without taking into consideration
 128  
      * that the principal may be a member via an assigned group or role.  Use in situations where
 129  
      * you are only interested in the qualifiers that are directly assigned to the principal.
 130  
      */
 131  
     @WebMethod(operationName = "getRoleQualifersForPrincipalByNamespaceAndRolename")
 132  
     @WebResult(name = "attributeSets")
 133  
     List<AttributeSet> getRoleQualifiersForPrincipal(@WebParam(name="principalId") String principalId,
 134  
                                                      @WebParam(name="namespaceCode") String namespaceCode,
 135  
                                                      @WebParam(name="roleName") String roleName,
 136  
                                                      @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 137  
 
 138  
     /**
 139  
      * Returns a list of role qualifiers that the given principal.  If the principal's membership
 140  
      * is via a group or role, that group or role's qualifier on the given role is returned.
 141  
      */
 142  
     @WebMethod(operationName = "getNestedRoleQualifersForPrincipalByNamespaceAndRolename")
 143  
     @WebResult(name = "attributeSets")
 144  
         List<AttributeSet> getNestedRoleQualifiersForPrincipal(@WebParam(name = "principalId") String principalId,
 145  
                                                            @WebParam(name = "namespaceCode") String namespaceCode,
 146  
                                                            @WebParam(name = "roleName") String roleName,
 147  
                                                            @WebParam(name = "qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification);
 148  
 
 149  
     /**
 150  
      * Returns a list of role qualifiers that the given principal.  If the principal's membership
 151  
      * is via a group or role, that group or role's qualifier on the given role is returned.
 152  
      */
 153  
     @WebMethod(operationName = "getNestedRoleQualifiersForPrincipalByRoleIds")
 154  
     @WebResult(name = "attributeSets")
 155  
         List<AttributeSet> getNestedRoleQualifiersForPrincipal(@WebParam(name = "principalId") String principalId, @WebParam(name = "roleIds") List<String> roleIds, @WebParam(name = "qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification);
 156  
 
 157  
 
 158  
     // --------------------
 159  
     // Role Membership Checks
 160  
     // --------------------
 161  
 
 162  
     /**
 163  
      * Get all the role members (groups and principals) associated with the given list of roles
 164  
      * where their role membership/assignment matches the given qualification.
 165  
      *
 166  
      * The return object will have each membership relationship along with the delegations
 167  
      *
 168  
      */
 169  
     @WebMethod(operationName = "getRoleMembers")
 170  
     @WebResult(name = "roleMemberships")
 171  
     List<RoleMembership> getRoleMembers( @WebParam(name="roleIds") List<String> roleIds,
 172  
                                              @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 173  
 
 174  
     /**
 175  
          * This method gets all the members, then traverses down into members of type role and group to obtain the nested principal ids
 176  
          *
 177  
          * @return list of member principal ids
 178  
          */
 179  
     @WebMethod(operationName = "getRoleMemberPrincipalIds")
 180  
     @WebResult(name = "principalIds")
 181  
     Collection<String> getRoleMemberPrincipalIds(@WebParam(name="namespaceCode") String namespaceCode,
 182  
                                                  @WebParam(name="roleName") String roleName,
 183  
                                                  @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification);
 184  
 
 185  
     /**
 186  
      * Returns whether the given principal has any of the passed role IDs with the given qualification.
 187  
      */
 188  
     @WebMethod(operationName = "principalHasRole")
 189  
     @WebResult(name = "principalHasRole")
 190  
     boolean principalHasRole( @WebParam(name="principalId") String principalId,
 191  
                               @WebParam(name="roleIds") List<String> roleIds,
 192  
                               @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 193  
 
 194  
     /**
 195  
      * Returns the subset of the given principal ID list which has the given role and qualification.
 196  
      * This is designed to be used by lookups of people by their roles.
 197  
      */
 198  
     @WebMethod(operationName = "getPrincipalIdSubListWithRole")
 199  
     @WebResult(name = "principalIds")
 200  
     List<String> getPrincipalIdSubListWithRole( @WebParam(name="principalIds") List<String> principalIds,
 201  
                                                 @WebParam(name="roleNamespaceCode") String roleNamespaceCode,
 202  
                                                 @WebParam(name="roleName") String roleName,
 203  
                                                 @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 204  
 
 205  
     /**
 206  
          *
 207  
          * This method gets search results for role lookup
 208  
          */
 209  
     @WebMethod(operationName = "getRolesSearchResults")
 210  
     @WebResult(name = "roles")
 211  
         List<? extends Role> getRolesSearchResults(
 212  
             @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name = "fieldValues") Map<String,String> fieldValues);
 213  
 
 214  
         /**
 215  
          * Notifies all of a principal's roles and role types that the principal has been inactivated.
 216  
          */
 217  
     @WebMethod(operationName = "principalInactivated")
 218  
         void principalInactivated( @WebParam(name="principalId") String principalId );
 219  
 
 220  
         /**
 221  
          * Notifies the role service that the role with the given id has been inactivated.
 222  
          */
 223  
     @WebMethod(operationName = "roleInactivated")
 224  
         void roleInactivated(@WebParam(name="roleId") String roleId);
 225  
 
 226  
         /**
 227  
          * Notifies the role service that the group with the given id has been inactivated.
 228  
          */
 229  
     @WebMethod(operationName = "groupInactivated")
 230  
     void groupInactivated(@WebParam(name="groupId") String groupId);
 231  
 
 232  
     /**
 233  
      * Gets all direct members of the roles that have ids within the given list
 234  
      * of role ids.  This method does not recurse into any nested roles.
 235  
      *
 236  
      *  <p>The resulting List of role membership will contain membership for
 237  
      *  all the roles with the specified ids.  The list is not guaranteed to be
 238  
      *  in any particular order and may have membership info for the
 239  
      *  different roles interleaved with each other.
 240  
      */
 241  
     @WebMethod(operationName = "getFirstLevelRoleMembers")
 242  
     @WebResult(name = "roleMemberships")
 243  
         List<RoleMembership> getFirstLevelRoleMembers(@WebParam(name="roleIds") List<String> roleIds);
 244  
 
 245  
         /**
 246  
          * Gets role member information based on the given search criteria.  The
 247  
          * map of criteria contains attributes of RoleMembership as it's
 248  
          * key and the values to search on as the value.
 249  
          */
 250  
     @WebMethod(operationName = "findRoleMembers")
 251  
     @WebResult(name = "roleMemberships")
 252  
         List<RoleMembership> findRoleMembers(
 253  
             @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name="fieldValues") java.util.Map<String, String> fieldValues);
 254  
 
 255  
         /**
 256  
          * Gets a list of Roles that the given member belongs to.
 257  
          */
 258  
     @WebMethod(operationName = "getMemberParentRoleIds")
 259  
     @WebResult(name = "roleIds")
 260  
         List<String> getMemberParentRoleIds(String memberType, String memberId);
 261  
 
 262  
 
 263  
     @WebMethod(operationName = "findRoleMembersCompleteInfo")
 264  
     @WebResult(name = "roleMemberInfos")
 265  
         List<RoleMember> findRoleMembersCompleteInfo(
 266  
             @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name="fieldValues") java.util.Map<String, String> fieldValues);
 267  
 
 268  
     @WebMethod(operationName = "findDelegateMembersCompleteInfo")
 269  
     @WebResult(name = "delegateMemberInfos")
 270  
     List<Delegate> findDelegateMembersCompleteInfo
 271  
             (@XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name = "fieldValues") java.util.Map<String, String> fieldValues);
 272  
 
 273  
         /**
 274  
          * Gets delegation member information based on the given search criteria.  The
 275  
          * map of criteria contains attributes of Delegate as it's
 276  
          * key and the values to search on as the value.
 277  
          */
 278  
     @WebMethod(operationName = "getDelegationMembersByDelegationId")
 279  
     @WebResult(name = "delegateMemberInfos")
 280  
     List<Delegate> getDelegationMembersByDelegationId(
 281  
             @WebParam(name = "delegationId") String delegationId);
 282  
 
 283  
     @WebMethod(operationName = "getDelegationMemberByDelegationAndMemberId")
 284  
     @WebResult(name = "delegateMemberInfo")
 285  
     Delegate getDelegationMemberByDelegationAndMemberId(
 286  
             @WebParam(name = "delegationId") String delegationId, @WebParam(name = "memberId") String memberId);
 287  
 
 288  
     @WebMethod(operationName = "getDelegationMemberById")
 289  
     @WebResult(name = "delegateMemberInfo")
 290  
     Delegate getDelegationMemberById(@WebParam(name = "delegationMemberId") String delegationMemberId);
 291  
 
 292  
     @WebMethod(operationName = "getRoleResponsibilities")
 293  
     @WebResult(name = "roleResponsibilities")
 294  
         List<RoleResponsibility> getRoleResponsibilities(@WebParam(name="roleId") String roleId);
 295  
 
 296  
     @WebMethod(operationName = "getRoleMemberResponsibilityActionInfo")
 297  
     @WebResult(name = "roleResponsibilityActions")
 298  
         List<RoleResponsibilityAction> getRoleMemberResponsibilityActionInfo(
 299  
             @WebParam(name="roleMemberId") String roleMemberId);
 300  
 
 301  
     @WebMethod(operationName = "getDelegateTypeInfo")
 302  
     @WebResult(name = "delegateType")
 303  
     DelegateType getDelegateTypeInfo(
 304  
             @WebParam(name="roleId") String roleId, @WebParam(name="delegationTypeCode") String delegationTypeCode);
 305  
 
 306  
     @WebMethod(operationName = "getDelegateTypeInfoById")
 307  
     @WebResult(name = "delegateType")
 308  
     DelegateType getDelegateTypeInfoById( @WebParam(name="delegationId") String delegationId);
 309  
 
 310  
         @WebMethod(operationName = "applicationRoleMembershipChanged")
 311  
     void applicationRoleMembershipChanged( @WebParam(name="roleId") String roleId );
 312  
 
 313  
     @WebMethod(operationName = "lookupRoles")
 314  
     @WebResult(name = "roles")
 315  
         List<Role> lookupRoles(@WebParam(name="searchCriteria") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> searchCriteria);
 316  
 
 317  
         /**
 318  
          * Flushes an internal role cache used by the base implementation to prevent repeated database I/O.
 319  
          */
 320  
     @WebMethod(operationName = "flushInternalRoleCache")
 321  
         void flushInternalRoleCache();
 322  
 
 323  
         /**
 324  
          * Flushes an internal role member cache used by the base implementation to prevent repeated database I/O.
 325  
          */
 326  
     @WebMethod(operationName = "flushInternalRoleMemberCache")
 327  
         void flushInternalRoleMemberCache();
 328  
 
 329  
         /**
 330  
          * Flushes an internal delegation cache used by the base implementation to prevent repeated database I/O.
 331  
          */
 332  
     @WebMethod(operationName = "flushInternalDelegationCache")
 333  
         void flushInternalDelegationCache();
 334  
 
 335  
         /**
 336  
          * Flushes an internal delegation member cache used by the base implementation to prevent repeated database I/O.
 337  
          */
 338  
     @WebMethod(operationName = "flushInternalDelegationMemberCache")
 339  
         void flushInternalDelegationMemberCache();
 340  
 }