Coverage Report - org.kuali.rice.kim.service.RoleService
 
Classes in this File Line Coverage Branch Coverage Complexity
RoleService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007 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.service;
 17  
 
 18  
 import java.util.Collection;
 19  
 import java.util.List;
 20  
 import java.util.Map;
 21  
 
 22  
 import javax.jws.WebMethod;
 23  
 import javax.jws.WebParam;
 24  
 import javax.jws.WebService;
 25  
 import javax.jws.soap.SOAPBinding;
 26  
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 27  
 
 28  
 import org.kuali.rice.core.jaxb.AttributeSetAdapter;
 29  
 import org.kuali.rice.core.jaxb.MapStringStringAdapter;
 30  
 import org.kuali.rice.core.xml.dto.AttributeSet;
 31  
 import org.kuali.rice.kim.bo.Role;
 32  
 import org.kuali.rice.kim.bo.role.dto.DelegateMemberCompleteInfo;
 33  
 import org.kuali.rice.kim.bo.role.dto.DelegateTypeInfo;
 34  
 import org.kuali.rice.kim.bo.role.dto.KimRoleInfo;
 35  
 import org.kuali.rice.kim.bo.role.dto.RoleMemberCompleteInfo;
 36  
 import org.kuali.rice.kim.bo.role.dto.RoleMembershipInfo;
 37  
 import org.kuali.rice.kim.bo.role.dto.RoleResponsibilityActionInfo;
 38  
 import org.kuali.rice.kim.bo.role.dto.RoleResponsibilityInfo;
 39  
 import org.kuali.rice.kim.util.KIMWebServiceConstants;
 40  
 
 41  
 /**
 42  
  * 
 43  
  * This service provides operations for querying role and role qualification 
 44  
  * data.
 45  
  * 
 46  
  * <p>A role is where permissions and responsibilities are granted.  Roles have
 47  
  * a membership consisting of principals, groups or even other roles.  By
 48  
  * being assigned as members of a role, the associated principals will be
 49  
  * granted all permissions and responsibilities that have been granted to the
 50  
  * role.
 51  
  * 
 52  
  * <p>Each membership assignment on the role can have a qualification which 
 53  
  * defines extra information about that particular member of the role.  For 
 54  
  * example, one may have the role of "Dean" but that can be further qualified
 55  
  * by the school they are the dean of, such as "Dean of Computer Science".
 56  
  * Authorization checks that are then done in the permission service can pass
 57  
  * qualifiers as part of the operation if they want to restrict the subset of
 58  
  * the role against which the check is made.
 59  
  * 
 60  
  * <p>This service provides read-only operations.  For write operations, see
 61  
  * {@link RoleUpdateService}.
 62  
  * 
 63  
  * @see RoleUpdateService
 64  
  * @see PermissionService
 65  
  * 
 66  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 67  
  *
 68  
  */
 69  
 @WebService(name = KIMWebServiceConstants.RoleService.WEB_SERVICE_NAME, targetNamespace = KIMWebServiceConstants.MODULE_TARGET_NAMESPACE)
 70  
 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
 71  
 public interface RoleService {
 72  
     // --------------------
 73  
     // Role Data
 74  
     // --------------------
 75  
 
 76  
         /**
 77  
          * Get the KIM Role object with the given ID.
 78  
          * 
 79  
          * If the roleId is blank, this method returns <code>null</code>.
 80  
          */
 81  
         KimRoleInfo getRole( @WebParam(name="roleId") String roleId );
 82  
         
 83  
         /**
 84  
          * Get the KIM Role objects for the role IDs in the given List.
 85  
          */
 86  
         List<KimRoleInfo> getRoles( @WebParam(name="roleIds") List<String> roleIds );
 87  
 
 88  
         /** Get the KIM Role object with the unique combination of namespace, component,
 89  
          * and role name.
 90  
          * 
 91  
          * If any parameter is blank, this method returns <code>null</code>.
 92  
          */
 93  
     KimRoleInfo getRoleByName( @WebParam(name="namespaceCode") String namespaceCode, @WebParam(name="roleName") String roleName );
 94  
         
 95  
         /** 
 96  
          * Return the Role ID for the given unique combination of namespace,
 97  
          * component and role name.
 98  
          */
 99  
         String getRoleIdByName( @WebParam(name="namespaceCode") String namespaceCode, @WebParam(name="roleName") String roleName );
 100  
     
 101  
         /**
 102  
          * Checks whether the role with the given role ID is active.
 103  
          * 
 104  
          * @param roleId
 105  
          * @return
 106  
          */
 107  
     boolean isRoleActive( @WebParam(name="roleId") String roleId );
 108  
 
 109  
     /**
 110  
      * Returns a list of role qualifiers that the given principal has without taking into consideration
 111  
      * that the principal may be a member via an assigned group or role.  Use in situations where
 112  
      * you are only interested in the qualifiers that are directly assigned to the principal.
 113  
      */
 114  
     @WebMethod(operationName = "getRoleQualifersForPrincipalRoleIds")
 115  
     List<AttributeSet> getRoleQualifiersForPrincipal( @WebParam(name="principalId") String principalId, @WebParam(name="roleIds") List<String> roleIds, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 116  
 
 117  
     /**
 118  
      * Returns a list of role qualifiers that the given principal has without taking into consideration
 119  
      * that the principal may be a member via an assigned group or role.  Use in situations where
 120  
      * you are only interested in the qualifiers that are directly assigned to the principal.
 121  
      */
 122  
     @WebMethod(operationName = "getRoleQualifersForPrincipalNamespaceRolename")
 123  
     List<AttributeSet> getRoleQualifiersForPrincipal( @WebParam(name="principalId") String principalId, @WebParam(name="namespaceCode") String namespaceCode, @WebParam(name="roleName") String roleName, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 124  
     
 125  
     /**
 126  
      * Returns a list of role qualifiers that the given principal.  If the principal's membership
 127  
      * is via a group or role, that group or role's qualifier on the given role is returned.
 128  
      */
 129  
     @WebMethod(operationName = "getRoleQualifersForPrincipalIncludingNestedNamespaceRolename")
 130  
         List<AttributeSet> getRoleQualifiersForPrincipalIncludingNested( @WebParam(name="principalId") String principalId, @WebParam(name="namespaceCode") String namespaceCode, @WebParam(name="roleName") String roleName, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 131  
 
 132  
     /**
 133  
      * Returns a list of role qualifiers that the given principal.  If the principal's membership
 134  
      * is via a group or role, that group or role's qualifier on the given role is returned.
 135  
      */
 136  
     @WebMethod(operationName = "getRoleQualifersForPrincipalIncludingNestedRoleIds")
 137  
         List<AttributeSet> getRoleQualifiersForPrincipalIncludingNested( @WebParam(name="principalId") String principalId, @WebParam(name="roleIds") List<String> roleIds, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 138  
 
 139  
     // --------------------
 140  
     // Role Membership Checks
 141  
     // --------------------
 142  
     
 143  
     /**
 144  
      * Get all the role members (groups and principals) associated with the given list of roles
 145  
      * where their role membership/assignment matches the given qualification.
 146  
      *
 147  
      * The return object will have each membership relationship along with the delegations
 148  
      * 
 149  
      */
 150  
     List<RoleMembershipInfo> getRoleMembers( @WebParam(name="roleIds") List<String> roleIds, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 151  
 
 152  
     /**
 153  
          * This method gets all the members, then traverses down into members of type role and group to obtain the nested principal ids
 154  
          * 
 155  
          * @return list of member principal ids
 156  
          */
 157  
     Collection<String> getRoleMemberPrincipalIds(@WebParam(name="namespaceCode") String namespaceCode, @WebParam(name="roleName") String roleName, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification);
 158  
 
 159  
     /**
 160  
      * Returns whether the given principal has any of the passed role IDs with the given qualification.
 161  
      */
 162  
     boolean principalHasRole( @WebParam(name="principalId") String principalId, @WebParam(name="roleIds") List<String> roleIds, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 163  
     
 164  
     /**
 165  
      * Returns the subset of the given principal ID list which has the given role and qualification.
 166  
      * This is designed to be used by lookups of people by their roles.
 167  
      */
 168  
     List<String> getPrincipalIdSubListWithRole( @WebParam(name="principalIds") List<String> principalIds, @WebParam(name="roleNamespaceCode") String roleNamespaceCode, @WebParam(name="roleName") String roleName, @WebParam(name="qualification") @XmlJavaTypeAdapter(value = AttributeSetAdapter.class) AttributeSet qualification );
 169  
 
 170  
     /**
 171  
          * 
 172  
          * This method get search results for role lookup
 173  
          */
 174  
         List<? extends Role> getRolesSearchResults(@XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name = "fieldValues") java.util.Map<String,String> fieldValues);
 175  
         
 176  
         /**
 177  
          * Notifies all of a principal's roles and role types that the principal has been inactivated.
 178  
          */
 179  
         void principalInactivated( @WebParam(name="principalId") String principalId );
 180  
         
 181  
         /**
 182  
          * Notifies the role service that the role with the given id has been inactivated. 
 183  
          */
 184  
         void roleInactivated(@WebParam(name="roleId") String roleId);
 185  
 
 186  
         /**
 187  
          * Notifies the role service that the group with the given id has been inactivated. 
 188  
          */
 189  
     void groupInactivated(@WebParam(name="groupId") String groupId);
 190  
     
 191  
     /**
 192  
      * Gets all direct members of the roles that have ids within the given list
 193  
      * of role ids.  This method does not recurse into any nested roles.
 194  
      * 
 195  
      *  <p>The resulting List of role membership will contain membership for
 196  
      *  all the roles with the specified ids.  The list is not guaranteed to be
 197  
      *  in any particular order and may have membership info for the
 198  
      *  different roles interleaved with each other.
 199  
      */
 200  
         List<RoleMembershipInfo> getFirstLevelRoleMembers(@WebParam(name="roleIds") List<String> roleIds);
 201  
         
 202  
         /**
 203  
          * Gets role member information based on the given search criteria.  The
 204  
          * map of criteria contains attributes of RoleMembershipInfo as it's
 205  
          * key and the values to search on as the value.
 206  
          */
 207  
         List<RoleMembershipInfo> findRoleMembers(@XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name="fieldValues") java.util.Map<String, String> fieldValues);
 208  
 
 209  
         /**
 210  
          * 
 211  
          * Gets a list of Roles that the given member belongs to.  
 212  
          * 
 213  
          */
 214  
         List<String> getMemberParentRoleIds(String memberType, String memberId);
 215  
         
 216  
         List<RoleMemberCompleteInfo> findRoleMembersCompleteInfo(@XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name="fieldValues") java.util.Map<String, String> fieldValues);
 217  
 
 218  
         List<DelegateMemberCompleteInfo> findDelegateMembersCompleteInfo(@XmlJavaTypeAdapter(value = MapStringStringAdapter.class) @WebParam(name="fieldValues") java.util.Map<String, String> fieldValues);
 219  
         
 220  
         /**
 221  
          * Gets delegation member information based on the given search criteria.  The
 222  
          * map of criteria contains attributes of DelegateInfo as it's
 223  
          * key and the values to search on as the value.
 224  
          */
 225  
         List<DelegateMemberCompleteInfo> getDelegationMembersByDelegationId(@WebParam(name="delegationId") String delegationId);
 226  
                 
 227  
         DelegateMemberCompleteInfo getDelegationMemberByDelegationAndMemberId(@WebParam(name="delegationId") String delegationId, @WebParam(name="memberId") String memberId);
 228  
         
 229  
         DelegateMemberCompleteInfo getDelegationMemberById(@WebParam(name="delegationMemberId") String delegationMemberId);
 230  
 
 231  
         List<RoleResponsibilityInfo> getRoleResponsibilities(@WebParam(name="roleId") String roleId);
 232  
         
 233  
         List<RoleResponsibilityActionInfo> getRoleMemberResponsibilityActionInfo( @WebParam(name="roleMemberId") String roleMemberId);
 234  
 
 235  
         DelegateTypeInfo getDelegateTypeInfo( @WebParam(name="roleId") String roleId, @WebParam(name="delegationTypeCode") String delegationTypeCode);
 236  
 
 237  
         DelegateTypeInfo getDelegateTypeInfoById( @WebParam(name="delegationId") String delegationId);
 238  
         
 239  
         void applicationRoleMembershipChanged( @WebParam(name="roleId") String roleId );
 240  
         
 241  
         List<KimRoleInfo> lookupRoles(@WebParam(name="searchCriteria") @XmlJavaTypeAdapter(value = MapStringStringAdapter.class) Map<String, String> searchCriteria);
 242  
 
 243  
         /**
 244  
          * Flushes an internal role cache used by the base implementation to prevent repeated database I/O.
 245  
          */
 246  
         void flushInternalRoleCache();
 247  
         
 248  
         /**
 249  
          * Flushes an internal role member cache used by the base implementation to prevent repeated database I/O.
 250  
          */
 251  
         void flushInternalRoleMemberCache();
 252  
         
 253  
         /**
 254  
          * Flushes an internal delegation cache used by the base implementation to prevent repeated database I/O.
 255  
          */
 256  
         void flushInternalDelegationCache();
 257  
         
 258  
         /**
 259  
          * Flushes an internal delegation member cache used by the base implementation to prevent repeated database I/O.
 260  
          */
 261  
         void flushInternalDelegationMemberCache();
 262  
 }