com.ibm.pim.organization
Interface OrganizationManager

All Superinterfaces:
Manager

public interface OrganizationManager
extends Manager

Manager for organizations, organization hierarchies, access control groups, roles, users and companies.

Since:
6.0.0

Field Summary
static java.lang.String copyright
           
 
Method Summary
 AccessControlGroup createAccessControlGroup(java.lang.String acgName, java.lang.String description, Role role, java.util.EnumSet<Permission> permissions)
          Creates an access control group object with the specified acg name and acg description.
 OrganizationHierarchy createOrganizationHierarchy(PrimarySpec spec, java.lang.String name)
          Creates a new organization hierarchy object.
 OrganizationHierarchy createOrganizationHierarchy(PrimarySpec spec, java.lang.String name, AttributeDefinition pathAttribute, AccessControlGroup accessControlGroup, AttributeDefinition displayAttribute)
          Create a new organization hierarchy object.
 Role createRole(java.lang.String roleName, java.lang.String description)
          Creates a role with the specified parameters.
 User createUser(java.lang.String userName, java.lang.String firstName, java.lang.String lastName, java.lang.String email, boolean enabled, java.lang.String password, java.util.List<Role> roles, Organization organization, boolean encryptPassword)
          Creates a user with the specified parameters.
 AccessControlGroup getAccessControlGroup(java.lang.String name)
          Returns an access control group object for the specified acg name
 java.util.Collection<OrganizationHierarchy> getOrganizationHierarchies()
          Retrieves all Organization Hierarchies available in the current context As prescribed via Permission.HIERARCHY_LIST
 OrganizationHierarchy getOrganizationHierarchy(java.lang.String name)
          Retrieves a specific organization hierarchy by name.
 Role getRole(java.lang.String name)
          Retrieves a role based upon a name
 User getUser(java.lang.String name)
          Returns a specific User based upon name.
 
Methods inherited from interface com.ibm.pim.common.Manager
getManagerName
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

createAccessControlGroup

AccessControlGroup createAccessControlGroup(java.lang.String acgName,
                                            java.lang.String description,
                                            Role role,
                                            java.util.EnumSet<Permission> permissions)
Creates an access control group object with the specified acg name and acg description. Set the specified permissions for the given role for the newly created access control group. AccessControlGroup is not persisted until AccessControlGroup.save() is called on it.

Parameters:
acgName - The name to give the newly created access control group.
description - The description to add to the newly created access control group.
role - The role object for which the given set of permissions shall be assigned corresponding to this ACG.
permissions - The permissions to be assigned for the given role.
Returns:
The newly created access control group.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If any of the input parameters are null or name is null or empty.
java.lang.IllegalStateException - if any API object passed as a parameter that has not yet been persisted.

createOrganizationHierarchy

OrganizationHierarchy createOrganizationHierarchy(PrimarySpec spec,
                                                  java.lang.String name)
Creates a new organization hierarchy object. Organization Hierarchy is not persisted until save() is called on it. The path attribute for the organization hierarchy is set to the primary key attribute in the spec. The display attribute for the organization hierarchy is set to the path attribute. The access control group for the organization hierarchy is set to default access control group.

Parameters:
spec - The primary spec for the organization hierarchy.
name - A name to be given to the organization hierarchy.
Returns:
New OrganizationHierarchy object
Throws:
PIMInternalException - if an internal exception occurs
PIMAuthorizationException - reserved for future use
java.lang.IllegalArgumentException - if any of the parameters is null or if name is empty
java.lang.IllegalStateException - if any API object passed as a parameter that has not yet been persisted.

createOrganizationHierarchy

OrganizationHierarchy createOrganizationHierarchy(PrimarySpec spec,
                                                  java.lang.String name,
                                                  AttributeDefinition pathAttribute,
                                                  AccessControlGroup accessControlGroup,
                                                  AttributeDefinition displayAttribute)
Create a new organization hierarchy object. Organization Hierarchy is not persisted until save() is called on it.

Parameters:
spec - The primary spec for the organization hierarchy.
name - A name to be given to the organization hierarchy.
pathAttribute - The spec node to be used as the path attribute for the objects in the organization hierarchy.
accessControlGroup - The Access Control Group for the organization hierarchy.
displayAttribute - The spec node to be used as the display attribute for the objects in the organization hierarchy.
Returns:
OrganizationHierarchy object
Throws:
PIMInternalException - if an internal exception occurs
PIMAuthorizationException - reserved for future use
java.lang.IllegalArgumentException - if any of the parameters is null or if name is empty
java.lang.IllegalStateException - if any API object passed as a parameter that has not yet been persisted.

createRole

Role createRole(java.lang.String roleName,
                java.lang.String description)
Creates a role with the specified parameters. Role is not persisted until Role.save() is called on it.

Parameters:
roleName - The name of the user to create
description - A description of this role.
Returns:
A role object representing the newly created role.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_ROLES_ACCESS
java.lang.IllegalArgumentException - If the roleName is null or empty or description is null.

createUser

User createUser(java.lang.String userName,
                java.lang.String firstName,
                java.lang.String lastName,
                java.lang.String email,
                boolean enabled,
                java.lang.String password,
                java.util.List<Role> roles,
                Organization organization,
                boolean encryptPassword)
Creates a user with the specified parameters. User is not persisted until User.save() is called on it.

Parameters:
userName - The name of the user to create
firstName - The first name of the user.
lastName - The family name of the user.
email - The user's email address.
enabled - Indicates if the user is to be created enabled or not.
password - The initial password for the user.
roles - The roles the user is to have associated.
organization - The organization the user is to belong to.
encryptPassword - A boolean value which determines whether the password string needs to be encrypted. encryptPassword exists for the purpose of migrating environments so that encrypted passwords exported from one environment can be loaded into another environment without encrypting them again and that there is no possibility of knowing what the password was. The value should always be set to true except during environment migration.
Returns:
A user object representing the user.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the current user does not have the equivalent of SystemWideAccessPrivilege.SECURITY_MODIFY_USERS
java.lang.IllegalArgumentException - If any of the input parameters is null or userName, firstName, lastName, email or password is null or empty.
java.lang.IllegalStateException - If any of the API objects passed as a parameter has not been persisted.

getAccessControlGroup

AccessControlGroup getAccessControlGroup(java.lang.String name)
Returns an access control group object for the specified acg name

Parameters:
name - The access control group name for which an acg object is to be returned.
Returns:
The access control group object. Returns null if an access control group with the given name does not exist.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If name is null or empty

getOrganizationHierarchies

java.util.Collection<OrganizationHierarchy> getOrganizationHierarchies()
Retrieves all Organization Hierarchies available in the current context As prescribed via Permission.HIERARCHY_LIST

Returns:
A Collection of Organization Hierarchies.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - reserved for future use

getOrganizationHierarchy

OrganizationHierarchy getOrganizationHierarchy(java.lang.String name)
Retrieves a specific organization hierarchy by name.

Parameters:
name - The name of the Organization hierarchy to be retrieved
Returns:
The Organization hierarchy matching the given name. Returns null if an organization hierarchy with the given name does not exist.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - If the user does not have the equivalent of Permission.HIERARCHY_LIST
java.lang.IllegalArgumentException - if name is null or empty

getRole

Role getRole(java.lang.String name)
Retrieves a role based upon a name

Parameters:
name - The role name
Returns:
a Role. Returns null if a role with the given name does not exist.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If name is null or empty.

getUser

User getUser(java.lang.String name)
Returns a specific User based upon name.

Parameters:
name - Users name
Returns:
A particular User object. Returns null if a user with the given name does not exist.
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use.
java.lang.IllegalArgumentException - If name is null or empty.