com.iplanet.am.sdk
Interface AMRole

All Superinterfaces:
AMConstants, AMObject

public interface AMRole
extends AMObject

The Role interface provides methods to manage role


Field Summary
static int GENERAL_ADMIN_ROLE
          Represents a General Admin Role
static int TOP_LEVEL_ADMIN_ROLE
          Represents a Top Level Admin Role
static int USER_ROLE
          Represents a User Role
 
Fields inherited from interface com.iplanet.am.sdk.AMObject
ASSIGNABLE_DYNAMIC_GROUP, DYNAMIC_GROUP, FILTERED_ROLE, GROUP, GROUP_CONTAINER, GROUP_PROFILE, MANAGED_ROLE, ORGANIZATION, ORGANIZATIONAL_UNIT, PEOPLE_CONTAINER, POLICY, ROLE, ROLE_PROFILE, SERVICE, STATIC_GROUP, TEMPLATE, UNKNOWN_OBJECT_TYPE, USER
 
Fields inherited from interface com.iplanet.am.sdk.AMConstants
SCOPE_BASE, SCOPE_ONE, SCOPE_SUB, SUBSCRIBABLE_ATTRIBUTE, UNIQUE_MEMBER_ATTRIBUTE
 
Method Summary
 void addUsers(java.util.Set users)
          Adds users to the role.
 java.util.Set getAssignedPolicyDNs()
          Gets all the assigned policies created for this role
 long getNumberOfUsers()
          Gets number of users in the role.
 java.util.Set getPolicyTemplates(java.util.Set serviceNames)
          Get requested policy templates defined for this role.
 int getRoleType()
          Gets the type of the role.
 java.util.Set getTemplates(java.util.Map templateReqs)
          Get requested templates defined for this role.
 java.util.Set getUserDNs()
          Gets the DNs of users in the role.
 void removeUsers(java.util.Set users)
          Removes users from the role.
 AMSearchResults searchUsers(com.iplanet.am.sdk.AMSearchControl searchControl, java.lang.String avfilter)
          Searches for users in this role using attribute values.
 AMSearchResults searchUsers(java.lang.String wildcard, com.iplanet.am.sdk.AMSearchControl searchControl)
          Searches for users in this people container using wildcards and attribute values.
 java.util.Set searchUsers(java.lang.String wildcard, int level)
          Searches for users in this role using wildcards and attribute values.
 AMSearchResults searchUsers(java.lang.String wildcard, java.util.Map avPairs, com.iplanet.am.sdk.AMSearchControl searchControl)
          Searches for users in this group 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 interface com.iplanet.am.sdk.AMObject
addEventListener, assignPolicies, createPolicyTemplate, createPolicyTemplate, createTemplate, createTemplate, delete, delete, getAttribute, getAttributeByteArray, getAttributes, getAttributes, getAttributesByteArray, getAttributesByteArray, getDN, getOrganizationDN, getParentDN, getPolicy, getPolicyTemplate, getServiceAttributes, getStringAttribute, getTemplate, isExists, removeAttributes, removeEventListener, search, setAttributes, setStringAttribute, store, unassignPolicies
 

Field Detail

TOP_LEVEL_ADMIN_ROLE

public static final int TOP_LEVEL_ADMIN_ROLE
Represents a Top Level Admin Role

GENERAL_ADMIN_ROLE

public static final int GENERAL_ADMIN_ROLE
Represents a General Admin Role

USER_ROLE

public static final int USER_ROLE
Represents a User Role
Method Detail

getRoleType

public int getRoleType()
                throws AMException,
                       SSOException
Gets the type of the role.
Returns:
One of the possible values:
  • USER_ROLE
  • GENERAL_ADMIN_ROLE
  • TOP_LEVEL_ADMIN_ROLE
    Throws:
    AMException - 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 AMException,
                            SSOException
    Sets the type of the role.
    Parameters:
    roleType - The type of the role.
    Throws:
    AMException - 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 AMException,
                         SSOException
    Adds users to the role.
    Parameters:
    users - The set of user DN's to be added to the role.
    Throws:
    AMException - 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 AMException,
                            SSOException
    Removes users from the role.
    Parameters:
    users - The set of user DN's to be removed from the role.
    Throws:
    AMException - 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 AMException,
                                 SSOException
    Gets number of users in the role.
    Returns:
    Number of users in the role.
    Throws:
    AMException - 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 AMException,
                                    SSOException
    Gets the DNs of users in the role.
    Returns:
    The DNs of users in the role.
    Throws:
    AMException - 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 AMException,
                                     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:
    AMException - 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 AMSearchResults searchUsers(java.lang.String wildcard,
                                       com.iplanet.am.sdk.AMSearchControl searchControl)
                                throws AMException,
                                       SSOException
    Searches for users in this people container using wildcards and attribute values. Wildcards can be specified such as a*, *, *a.
    Parameters:
    wildcard - wildcard pattern to be used in the search
    searchControl - specifies the search scope to be used, VLV ranges etc.,
    Returns:
    AMSearchResults which contains a Set DNs of Users matching the search
    Throws:
    AMException - 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 AMException,
                                     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:
    AMException - 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 AMSearchResults searchUsers(java.lang.String wildcard,
                                       java.util.Map avPairs,
                                       com.iplanet.am.sdk.AMSearchControl searchControl)
                                throws AMException,
                                       SSOException
    Searches for users in this group 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
    searchControl - specifies the search scope to be used, VLV ranges etc.,
    Returns:
    AMSearchResults which contains a DNs of Users matching the search
    Throws:
    AMException - 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 AMSearchResults searchUsers(com.iplanet.am.sdk.AMSearchControl searchControl,
                                       java.lang.String avfilter)
                                throws AMException,
                                       SSOException
    Searches for users in this role using attribute values. Wildcards such as a*, *, *a can be specified for the attribute values. The DNs of users with matching attribute-value pairs will be returned.
    Parameters:
    searchControl - specifies the search scope to be used, VLV ranges etc.,
    avfilter - this attribute-value pairs filter will be & with user search filter
    Returns:
    AMSearchResults which contains a Set DNs of Users matching the search
    Throws:
    AMException - if there is an internal error in the AM Store
    SSOException - if the sign on is no longer valid

    getTemplates

    public java.util.Set getTemplates(java.util.Map templateReqs)
                               throws AMException,
                                      SSOException
    Get requested templates defined for this role.
    Parameters:
    templateReqs - a Map of services names and template types. The key in the Map entry is the service name as a String, and the value of the Map entry is a java.lang.Integer whose int value is one of AMTemplate.DYNAMIC_TEMPLATE AMTemplate.POLICY_TEMPLATE AMTemplate.ORGANIZATION_TEMPLATE AMTemplate.ALL_TEMPLATES
    Returns:
    Set a Set of AMTemplate objects representing the templates requested. If the templateReqs argument is null or empty, the returned set will contain the AMTemplates for each registered service which has a template defined. If there is no template defined for any registered services for this role, an empty Set will be returned.
    Throws:
    AMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign-on is no longer valid.

    getPolicyTemplates

    public java.util.Set getPolicyTemplates(java.util.Set serviceNames)
                                     throws AMException,
                                            SSOException
    Get requested policy templates defined for this role.
    Parameters:
    serviceNames - a Set of services names, each specified as a java.lang.String.
    Returns:
    Set a Set of AMTemplate objects representing the policy templates requested. If the serviceNames argument is null or empty, the returned set will contain the AMTemplates for each registered service which has a policy template defined. If there is no policy template defined for any registered services for this role, an empty Set will be returned.
    Throws:
    AMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign-on is no longer valid.

    getAssignedPolicyDNs

    public java.util.Set getAssignedPolicyDNs()
                                       throws AMException,
                                              SSOException
    Gets all the assigned policies created for this role
    Returns:
    Set a set of assigned policy DNs
    Throws:
    AMException - if an error is encountered when trying to access/retrieve data from the data store
    SSOException - if the sign-on is no longer valid.