com.ibm.jarm.api.security

Interface RMRoles

  • All Superinterfaces:
    java.lang.Iterable<RMRole>


    public interface RMRoles
    extends java.lang.Iterable<RMRole>
    Represents a collection of RMRole instances.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      RMRole addNewRole(java.lang.String roleName, java.lang.String roleType, java.lang.String applicationName, java.lang.String description)
      Creates a new RMRole member for this collection and saves it to the corresponding repository from which this collection originated.
      java.lang.String getApplicationName()
      Returns the application name String, if any, that was originally used to fetch this RMRoles collection; see RMDomain.fetchRMRoles(Repository, String).
      Repository getRepository()
      Specifies the Repository used to retrieve roles from and save roles to.
      RMRole getRoleById(java.lang.String id)
      Retrieves a RMRole instance from the repository based upon its ID string.
      RMRole getRoleByNames(java.lang.String roleName, java.lang.String applicationName)
      Retrieves a RMRole instance from the repository based upon the specified role name and application name values.
      boolean isCurrentUserInAnyRole(java.util.List<RMRole> roles)
      Indicates whether the current user is a member of any of the specified RMRole instances.
      java.util.Iterator<RMRole> iterator()
      Returns an Iterator for this collection.
      int size()
      Returns the count of the number of roles in this collection.
    • Method Detail

      • getApplicationName

        java.lang.String getApplicationName()
        Returns the application name String, if any, that was originally used to fetch this RMRoles collection; see RMDomain.fetchRMRoles(Repository, String).
        Returns:
        A String value. This entry can be null.
      • isCurrentUserInAnyRole

        boolean isCurrentUserInAnyRole(java.util.List<RMRole> roles)
        Indicates whether the current user is a member of any of the specified RMRole instances. The current user is defined as the javax.security.auth.Subject instance associated with the current thread.
        Parameters:
        roles - a Collection of RMRole instances in question. Each instance must be a member of this RMRoles collection.
        Returns:
        true if the current user is a member of the one or more of the specified roles, false otherwise.
      • addNewRole

        RMRole addNewRole(java.lang.String roleName,
                        java.lang.String roleType,
                        java.lang.String applicationName,
                        java.lang.String description)
        Creates a new RMRole member for this collection and saves it to the corresponding repository from which this collection originated.
        Parameters:
        roleName - the name to assign to the new role. Must be unique within the subset of roles having the same applicationName value. This entry cannot be null or blank.
        roleType - a String providing an indication of the type of role the new instance represents. This entry cannot be null or blank.
        applicationName - the name of the application responsible for the creation of the new role instance. This entry cannot be null or blank.
        description - an optional String providing descriptive text. This entry can be null.
        Returns:
        A new RMRole instance.
        Throws:
        RAL_ROLE_ALREADY_EXISTS - if a existing role with matching values for the specified applicationName and either roleName or roleType parameters was found.
        RAL_RETRIEVING_SECURED_ACCESS_ROLE_FAILED - if an unexpected retrieval error occurred.
      • getRoleByNames

        RMRole getRoleByNames(java.lang.String roleName,
                            java.lang.String applicationName)
        Retrieves a RMRole instance from the repository based upon the specified role name and application name values.
        Parameters:
        roleName - the role name String of the desired role. This entry cannot be null.
        applicationName - the application name String of the desired role. This entry cannot be null.
        Returns:
        The matching RMRole, or null if none found.
        Throws:
        RAL_RETRIEVING_SECURED_ACCESS_ROLE_FAILED - if an unexpected retrieval error occurred.
      • getRoleById

        RMRole getRoleById(java.lang.String id)
        Retrieves a RMRole instance from the repository based upon its ID string.
        Parameters:
        id - the object ID String used to look up the desired role.
        Returns:
        The matching RMRole, or null if none found.
        Throws:
        RAL_RETRIEVING_SECURED_ACCESS_ROLE_FAILED - if an unexpected retrieval error occurred.
      • iterator

        java.util.Iterator<RMRole> iterator()
        Returns an Iterator for this collection.
        Specified by:
        iterator in interface java.lang.Iterable<RMRole>
        Returns:
        An Iterator<RMRole> instance.
      • size

        int size()
        Returns the count of the number of roles in this collection.
        Returns:
        An int value.

© Copyright IBM Corp. 2010, 2013. All Rights Reserved.