com.sun.identity.um
Class Role

java.lang.Object
  |
  +--com.sun.identity.um.Common
        |
        +--com.sun.identity.um.Role

public final class Role
extends Common

The Role interface provides methods to manage role


Method Summary
 void addUsers(java.util.Set users)
          Adds users to the role.
 long getNumberOfUsers()
          Gets number of users in the role.
 int getRoleType()
          Gets the type of the role.
 java.util.Set getUserDNs()
          Gets the DNs of users in the role.
 void removeUsers(java.util.Set users)
          Removes users from the role.
 java.util.Set searchUsers(java.lang.String wildcard, int level)
          Searches for users in this role using wildcards and attribute values.
 java.util.Set searchUsers(java.lang.String wildcard, java.util.Map avPairs, int level)
          Searches for users in this role using wildcards and attribute values.
 void setRoleType(int roleType)
          Sets the type of the role.
 
Methods inherited from class com.sun.identity.um.Common
assignServices, delete, delete, getAssignedServices, getAttributes, getAttributes, getDN, getOrganizationDN, getParentDN, getServiceAttributes, getServiceStatus, isExists, modifyService, removeAttributes, setAttributes, setServiceStatus, store, unassignServices
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRoleType

public int getRoleType()
                throws UMException,
                       SSOException
Gets the type of the role.
Returns:
One of the possible values:
  • USER_ROLE
  • GENERAL_ADMIN_ROLE
  • TOP_LEVEL_ADMIN_ROLE
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid

  • setRoleType

    public void setRoleType(int roleType)
                     throws UMException,
                            SSOException
    Sets the type of the role.
    Parameters:
    roleType - The type of the role.
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid

    addUsers

    public void addUsers(java.util.Set users)
                  throws UMException,
                         SSOException
    Adds users to the role.
    Parameters:
    users - The set of user DN's to be added to the role.
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid

    removeUsers

    public void removeUsers(java.util.Set users)
                     throws UMException,
                            SSOException
    Removes users from the role.
    Parameters:
    users - The set of user DN's to be removed from the role.
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid

    getNumberOfUsers

    public long getNumberOfUsers()
                          throws UMException,
                                 SSOException
    Gets number of users in the role.
    Returns:
    Number of users in the role.
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid

    getUserDNs

    public java.util.Set getUserDNs()
                             throws UMException,
                                    SSOException
    Gets the DNs of users in the role.
    Returns:
    The DNs of users in the role.
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid

    searchUsers

    public java.util.Set searchUsers(java.lang.String wildcard,
                                     int level)
                              throws UMException,
                                     SSOException
    Searches for users in this role using wildcards and attribute values. Wildcards can be specified such as a*, *, *a.
    Parameters:
    wildcard - wildcard pattern to be used in the search
    level - the search level that needs to be used (AMConstants.SCOPE_ONE or AMConstants.SCOPE_SUB)
    Returns:
    Set DNs of Users matching the search
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid

    searchUsers

    public java.util.Set searchUsers(java.lang.String wildcard,
                                     java.util.Map avPairs,
                                     int level)
                              throws UMException,
                                     SSOException
    Searches for users in this role using wildcards and attribute values. Wildcards can be specified such as a*, *, *a. To further refine the search, attribute-value pairs can be specifed so that DNs of users with matching attribute-value pairs will be returned.
    Parameters:
    wildcard - wildcard pattern to be used in the search
    avPairs - attribute-value pairs to match when searching users
    level - the search level that needs to be used (AMConstants.SCOPE_ONE or AMConstants.SCOPE_SUB)
    Returns:
    Set DNs of Users matching the search
    Throws:
    UMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign on is no longer valid