com.sun.identity.um
Class Organization

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

public final class Organization
extends Common

The AMOrganization interface provides methods to manage organization


Method Summary
 java.lang.String createAssignableDynamicGroup(java.lang.String name, java.util.Map attributes, java.util.Map serviceNameAndAttrs)
          Creates assignable dynamic group.
 java.lang.String createDynamicGroup(java.lang.String name, java.util.Map attributes, java.util.Map serviceNameAndAttrs)
          Creates dynamic group.
 java.util.Set createRoles(java.util.Map roles)
          Creates roles.
 java.util.Set createRoles(java.util.Set roleNames)
          Creates roles.
 java.lang.String createStaticGroup(java.lang.String name, java.util.Map attributes, java.util.Map serviceNameAndAttrs)
          Creates static group.
 java.lang.String createUser(java.lang.String uid, java.util.Map attrMap, java.util.Map serviceNameAndAttrs)
          Create user and initializes the attributes.
 void deleteAssignableDynamicGroups(java.util.Set assignableDynamicGroupDNs)
          Deletes assignable dynamic groups.
 void deleteDynamicGroups(java.util.Set dynamicGroupDNs)
          Deletes dynamic groups.
 void deleteRoles(java.util.Set roleDNs)
          Deletes roles.
 void deleteStaticGroups(java.util.Set groupDNs)
          Deletes static groups.
 void deleteUsers(java.util.Set users)
          Removes users from the organization.
 long getNumberOfRoles(int level)
          Gets number of roles within the specified level.
 java.util.Set getRoles(int level)
          Gets the roles within the specified level.
 java.lang.String getUser(java.lang.String uid, java.lang.String userSearchTemplate)
          Returns DN of user in this organization (or in subrogs), whose naming attribute exactly matches with uid.
 java.util.Set searchAssignableDynamicGroups(java.lang.String wildcard, int level, java.lang.String groupSearchTemplate, java.util.Map avPairs)
          Searches for assignable dynamic groups in this organization using wildcards.
 java.util.Set searchDynamicGroups(java.lang.String wildcard, int level, java.lang.String groupSearchTemplate, java.util.Map avPairs)
          Searches for dynamic groups in this organization using wildcards.
 java.util.Set searchRoles(java.lang.String wildcard, int level)
          Searches for roles in this organization using wildcards.
 java.util.Set searchRoles(java.lang.String wildcard, java.util.Map avPairs, int level)
          Searches for roles in this organization using wildcards and attribute values.
 java.util.Set searchStaticGroups(java.lang.String wildcard, int level, java.lang.String groupSearchTemplate, java.util.Map avPairs)
          Searches for static groups in this organization using wildcards.
 java.util.Set searchUsers(java.lang.String wildcard, int level, java.lang.String userSearchTemplate, java.util.Map avPairs)
          Searches for users in this organization using wildcards and attribute values.
 
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

createRoles

public java.util.Set createRoles(java.util.Set roleNames)
                          throws UMException,
                                 SSOException
Creates roles.
Parameters:
roles - The set of Roles' names to be created.
Returns:
Set set of Role DNs created.
Throws:
UMException - if there is an internal error in the AM Store
SSOException - if the sign on is no longer valid

createRoles

public java.util.Set createRoles(java.util.Map roles)
                          throws UMException,
                                 SSOException
Creates roles.
Parameters:
roles - Map where the key is the name of the role, and the value is a Map to represent Attribute-Value Pairs
Returns:
Set set of Role DNs created.
Throws:
UMException - if there is an internal error in the AM Store
SSOException - if the sign on is no longer valid

deleteRoles

public void deleteRoles(java.util.Set roleDNs)
                 throws UMException,
                        SSOException
Deletes roles.
Parameters:
roles - The set of roles' DNs to be deleted.
Throws:
UMException - if there is an internal error in the AM Store
SSOException - if the sign on is no longer valid

getRoles

public java.util.Set getRoles(int level)
                       throws UMException,
                              SSOException
Gets the roles within the specified level.
Parameters:
level - The search level starting from the organization.
Returns:
The Set of role DN's within the specified level.

getNumberOfRoles

public long getNumberOfRoles(int level)
                      throws UMException,
                             SSOException
Gets number of roles within the specified level.
Parameters:
level - The search level starting from the organization.
Returns:
Number of roles within the specified level.

searchRoles

public java.util.Set searchRoles(java.lang.String wildcard,
                                 int level)
                          throws UMException,
                                 SSOException
Searches for roles in this organization using wildcards. 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 AMConstansts.SCOPE_SUB)
Returns:
Set Set of DNs of roles matching the search
Throws:
UMException - if there is an internal error in the AM Store
SSOException - if the sign on is no longer valid

searchRoles

public java.util.Set searchRoles(java.lang.String wildcard,
                                 java.util.Map avPairs,
                                 int level)
                          throws UMException,
                                 SSOException
Searches for roles in this organization 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 roles 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 AMConstansts.SCOPE_SUB)
Returns:
Set Set of DNs of roles matching the search
Throws:
UMException - if there is an internal error in the AM Store
SSOException - if the sign on is no longer valid

createAssignableDynamicGroup

public java.lang.String createAssignableDynamicGroup(java.lang.String name,
                                                     java.util.Map attributes,
                                                     java.util.Map serviceNameAndAttrs)
                                              throws UMException,
                                                     SSOException
Creates assignable dynamic group. Takes serviceNameAndAttr map so that services can be assigned to the group which is just created.
Parameters:
Name - of group to be created
ServiceName - and attrsMap where the map is like this: (attrMap=)
Returns:
groupDN of newly created group.
Throws:
UMException -  
SSOException - if the SSOtoken is no longer valid

deleteAssignableDynamicGroups

public void deleteAssignableDynamicGroups(java.util.Set assignableDynamicGroupDNs)
                                   throws UMException,
                                          SSOException
Deletes assignable dynamic groups.
Parameters:
assignableDynamicGroupDNs - The set of assignable dynamic groups's DNs to be deleted.
Throws:
UMException - if there is an internal error in the AM Store
SSOException - if the sign on is no longer valid

searchAssignableDynamicGroups

public java.util.Set searchAssignableDynamicGroups(java.lang.String wildcard,
                                                   int level,
                                                   java.lang.String groupSearchTemplate,
                                                   java.util.Map avPairs)
                                            throws UMException,
                                                   SSOException
Searches for assignable dynamic groups in this organization using wildcards. Wildcards can be specified such as a*, *, *a. Uses the groupSearchTemplate, if provided. Otherwise the default search template is used.
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)
groupSearchTemplate - template to be used to search for groups.
avPairs - This option can be used to further qualify the search filter. The attribute-value pairs provided by this map are appended to the search filter.
Returns:
Set Set of DNs of assignable dynamic groups 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

createDynamicGroup

public java.lang.String createDynamicGroup(java.lang.String name,
                                           java.util.Map attributes,
                                           java.util.Map serviceNameAndAttrs)
                                    throws UMException,
                                           SSOException
Creates dynamic group. Takes serviceNameAndAttr map so that services can be assigned to the group which is just created.
Parameters:
Name - of group to be created
ServiceName - and attrsMap where the map is like this: (attrMap=)
Returns:
groupDN of newly created group.
Throws:
UMException -  
SSOException - if the SSOtoken is no longer valid

deleteDynamicGroups

public void deleteDynamicGroups(java.util.Set dynamicGroupDNs)
                         throws UMException,
                                SSOException
Deletes dynamic groups.
Parameters:
dynamicGroupDNs - The set of dynamic groups's DNs to be deleted.
Throws:
UMException - if there is an internal error in the AM Store
SSOException - if the sign on is no longer valid

searchDynamicGroups

public java.util.Set searchDynamicGroups(java.lang.String wildcard,
                                         int level,
                                         java.lang.String groupSearchTemplate,
                                         java.util.Map avPairs)
                                  throws UMException,
                                         SSOException
Searches for dynamic groups in this organization using wildcards. Wildcards can be specified such as a*, *, *a. Uses the groupSearchTemplate, if provided. Otherwise uses the the default GroupSearch template.
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)
groupSearchTemplate - template to be used to search for groups.
avPairs - This option can be used to further qualify the search filter. The attribute-value pairs provided by this map are appended to the search filter.
Returns:
Set Set of DNs of dynamic groups 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

createStaticGroup

public java.lang.String createStaticGroup(java.lang.String name,
                                          java.util.Map attributes,
                                          java.util.Map serviceNameAndAttrs)
                                   throws UMException,
                                          SSOException
Creates static group. Takes serviceNameAndAttr map so that services can be assigned to the group which is just created.
Parameters:
Name - of group to be created
ServiceName - and attrsMap where the map is like this: (attrMap=)
Returns:
groupDN of newly created group.
Throws:
UMException -  
SSOException - if the SSOtoken is no longer valid

deleteStaticGroups

public void deleteStaticGroups(java.util.Set groupDNs)
                        throws UMException,
                               SSOException
Deletes static groups.
Parameters:
groups - The set of static groups to be deleted.

searchStaticGroups

public java.util.Set searchStaticGroups(java.lang.String wildcard,
                                        int level,
                                        java.lang.String groupSearchTemplate,
                                        java.util.Map avPairs)
                                 throws UMException,
                                        SSOException
Searches for static groups in this organization using wildcards. Wildcards can be specified such as a*, *, *a. Uses the groupSearchTemplate, if provided. If it is null, default search templates are used.
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)
groupSearchTemplate - template to be used to search for groups.
avPairs - This option can be used to further qualify the search filter. The attribute-value pairs provided by this map are appended to the search filter.
Returns:
Set Set of DNs of static groups 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

createUser

public java.lang.String createUser(java.lang.String uid,
                                   java.util.Map attrMap,
                                   java.util.Map serviceNameAndAttrs)
                            throws UMException,
                                   SSOException
Create user and initializes the attributes. For each user the, object classes specified by organization type attribute iplanet-am-required-services of the service iPlanetAMAdminConsoleService template are added. If a corresponding template does not exist, the default values are picked up from schema. Also services as defined in the arguments, are assigned to the user, with default values being picked up from the service schema if none are provided for required attributes of the service.
Parameters:
String - uid, value of naming attribute for user.
Map - attrMap attribute-values to be set in the user entry.
Map - serviceNameAndAttr service names and attributes to be assigned to the user.
Returns:
user DN of newly created user.
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

deleteUsers

public void deleteUsers(java.util.Set users)
                 throws UMException,
                        SSOException
Removes users from the organization.
Parameters:
users - The set of user DN's to be removed from the organization.

getUser

public java.lang.String getUser(java.lang.String uid,
                                java.lang.String userSearchTemplate)
                         throws UMException,
                                SSOException
Returns DN of user in this organization (or in subrogs), whose naming attribute exactly matches with uid. If userSearchTemplate is not null, then this search template is used otherwise the BasicUserSearchTemplate is used. Any %U in the search filter are replaced with uid. If the search returns more than one user, an exception is thrown because this is a violation of the namespace constraint.
Parameters:
String - uid - namingAttribute value for user
String - userSearchTemplate
Returns:
DN of user found.
Throws:
UMException -  
SSOException -  

searchUsers

public java.util.Set searchUsers(java.lang.String wildcard,
                                 int level,
                                 java.lang.String userSearchTemplate,
                                 java.util.Map avPairs)
                          throws UMException,
                                 SSOException
Searches for users in this organization using wildcards and attribute values. Wildcards can be specified such as a*, *, *a. SDK users the userSearchTemplate, if provided. Otherwise, it uses the BasicUserSearchTemplate. Any %U in the search template are replaced with the wildcard.
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)
userSearchTemplate - template to be used to search for users.
avPairs - This option can be used to further qualify the search filter. The attribute-value pairs provided by this map are appended to the search filter.
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