com.ibm.itim.dataservices.model.domain
Class PersonEntity

java.lang.Object
  extended by com.ibm.itim.dataservices.model.DirectoryObjectEntity
      extended by com.ibm.itim.dataservices.model.domain.PersonEntity
All Implemented Interfaces:
com.ibm.itim.util.Sortable, java.io.Serializable
Direct Known Subclasses:
BusinessPartnerEntity

public class PersonEntity
extends DirectoryObjectEntity

Represents a person (identity) in the data model. This class provides business methods that operate on a person such as change role, suspend, restore, and transfer (move) from one business unit to another. Although the class name indicates human representation, this class could be used to represent any type of identity, even a computing system, which can be provisioned accounts.

See Also:
Serialized Form

Field Summary
static java.lang.String ORGANIZATION
          Constant (String) for organization relationship name.
static java.lang.String PARENT
          Constant (String) for parent relationship name.
static java.lang.String ROLE
          Constant (String) for role relationship name.
static java.lang.String SUPERVISOR
          Constant (String) for supervisor relationship name.
 
Fields inherited from interface com.ibm.itim.util.Sortable
ATTR_NAME
 
Constructor Summary
PersonEntity(DirectoryObject person)
          Constructs a PersonEntity, taking a DirectoryObject as the parameter.
PersonEntity(ObjectProfile profile, Person person)
          Constructs a PersonEntity with a profile and value object.
PersonEntity(Person person)
          Constructs a PersonEntity with a value object.
 
Method Summary
 void addRole(RoleEntity role)
          Adds the given role to the person's role memberships.
 java.util.Collection getAccounts()
          Deprecated. Use AccountSearch class in provisioning package instead.
 PersonEntity getImmediateSupervisor()
          Returns the Person's immediate supervisor (if any).
 OrganizationEntity getOrganization()
          Returns the organization containing the person.
 java.util.Collection getRoles()
          Returns the roles the person is a member of.
 java.util.Collection<RoleEntity> getRolesChanges(int changeAction)
          Returns the role chages for the person based on the change action, which can be either Add or Remove
 PersonEntity getSupervisor()
          Returns the Person's supervisor (if any).
 boolean isComparableTo(java.lang.String filter)
          Compares the entity against the given filter.
 boolean isMemberOfRole(RoleEntity role)
          Retuns true if the Person is a member of the given role.
 void move(OrganizationalContainerEntity container)
          "Moves" the Person into the given organizational container.
 void removeRole(RoleEntity role)
          Removes the given role from the person's role memberships.
 void setImmediateSupervisor(PersonEntity supervisor)
          Changes the Person's immediate supervisor to the given person.
 void setRoles(java.util.Collection roles)
          Changes the person's role memberships.
 void update()
          Updates the attributes of the entity in the data store.
 
Methods inherited from class com.ibm.itim.dataservices.model.DirectoryObjectEntity
equals, getDirectoryObject, getDistinguishedName, getEntity, getLifecycle, getObjectCategory, getParent, getParentDN, getProfile, getRelationship, getSortValue, getSupportedRelationships, hashCode, initialize, initialize, isSupportedRelationship, remove, remove, setLifecycle, toString, update
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ORGANIZATION

public static final java.lang.String ORGANIZATION
Constant (String) for organization relationship name.

See Also:
Constant Field Values

PARENT

public static final java.lang.String PARENT
Constant (String) for parent relationship name.

See Also:
Constant Field Values

SUPERVISOR

public static final java.lang.String SUPERVISOR
Constant (String) for supervisor relationship name.

See Also:
Constant Field Values

ROLE

public static final java.lang.String ROLE
Constant (String) for role relationship name.

See Also:
Constant Field Values
Constructor Detail

PersonEntity

public PersonEntity(ObjectProfile profile,
                    Person person)
Constructs a PersonEntity with a profile and value object.

Parameters:
profile - Profile identifying the type of this person.
person - Person object holding the attributes of the person.

PersonEntity

public PersonEntity(Person person)
Constructs a PersonEntity with a value object.

Parameters:
person - Person object holding the attributes of the person. Note: the object must have the name of the profile identifying the type of this person (i.e., Employee, Contractor, etc.)

PersonEntity

public PersonEntity(DirectoryObject person)
Constructs a PersonEntity, taking a DirectoryObject as the parameter.

Parameters:
person - DirectoryObject holding the attributes of the person. Note: the object must have the name of the profile identifying the type of this person (i.e., Employee, Contractor, etc.)
Method Detail

getRoles

public java.util.Collection getRoles()
                              throws ModelCommunicationException,
                                     ModelIntegrityException
Returns the roles the person is a member of.

Returns:
Collection of RoleEntities.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if a problem exists with the consistency of the data model preventing the location of the person's roles. This is most likely due to the removal of a role from the data store that is identified as one of the person's roles.

getRolesChanges

public java.util.Collection<RoleEntity> getRolesChanges(int changeAction)
                                                 throws ModelCommunicationException,
                                                        ObjectNotFoundException
Returns the role chages for the person based on the change action, which can be either Add or Remove

Returns:
Collection of RoleEntities.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if a problem exists with the consistency of the data model preventing the location of the person's roles. This is most likely due to the removal of a role from the data store that is identified as one of the person's roles.
ObjectNotFoundException
Since:
TIM 5.0

setRoles

public void setRoles(java.util.Collection roles)
              throws ModelCommunicationException,
                     ObjectNotFoundException
Changes the person's role memberships.

Parameters:
roles - Collection of RoleEntities representing the person's roles.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.

addRole

public void addRole(RoleEntity role)
             throws ModelCommunicationException,
                    ObjectNotFoundException
Adds the given role to the person's role memberships.

Parameters:
role - RoleEntity representing the role to add.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.

removeRole

public void removeRole(RoleEntity role)
                throws ModelCommunicationException,
                       ObjectNotFoundException
Removes the given role from the person's role memberships.

Parameters:
role - RoleEntity representing the role to remove.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.

isMemberOfRole

public boolean isMemberOfRole(RoleEntity role)
Retuns true if the Person is a member of the given role.

Parameters:
role - Role in question.
Returns:
True if member, false if not.

getSupervisor

public PersonEntity getSupervisor()
                           throws ModelCommunicationException,
                                  ModelIntegrityException
Returns the Person's supervisor (if any).

Returns:
PersonEntity representing the person's supervisor, null if none defined.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if a problem exists with the consistency of the data model preventing the evaluation of the relationship.

getImmediateSupervisor

public PersonEntity getImmediateSupervisor()
                                    throws ModelCommunicationException,
                                           ModelIntegrityException
Returns the Person's immediate supervisor (if any).

Returns:
PersonEntity representing the person's immediate supervisor, null if none defined.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if a problem exists with the consistency of the data model preventing the evaluation of the relationship.

setImmediateSupervisor

public void setImmediateSupervisor(PersonEntity supervisor)
                            throws ModelCommunicationException,
                                   ObjectNotFoundException
Changes the Person's immediate supervisor to the given person.

Parameters:
supervisor - PersonEntity representing the new immediate supervisor.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.

move

public void move(OrganizationalContainerEntity container)
          throws ModelCommunicationException,
                 ObjectNotFoundException
"Moves" the Person into the given organizational container.

Parameters:
container - Person's new parent container (OrganizationalContainerEntity).
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.

getAccounts

public java.util.Collection getAccounts()
                                 throws ModelCommunicationException,
                                        ObjectNotFoundException
Deprecated. Use AccountSearch class in provisioning package instead.

Returns the person's accounts.

Returns:
Collection of AccountEntities that this person owns.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.

isComparableTo

public boolean isComparableTo(java.lang.String filter)
                       throws ModelCommunicationException,
                              ObjectNotFoundException
Compares the entity against the given filter. If the entity matches the given filter, a value of true is returned. Note, this filter should only be constructed using attributes of the entity, not relationships.

Parameters:
filter - Filter that defines the criteria for returned DynamicRoleEntities to meet. The filter must be in the format defined by RFC2254.
Returns:
True if the entity matches the given filter, false if not.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.

getOrganization

public OrganizationEntity getOrganization()
                                   throws ModelCommunicationException,
                                          ModelIntegrityException
Returns the organization containing the person.

Returns:
OrganizationEntity representing the person's organization.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if a problem exists with the consistency of the data model preventing the evaluation of the relationship.

update

public void update()
            throws ModelCommunicationException,
                   ObjectNotFoundException
Updates the attributes of the entity in the data store. An DirectoryObject value object is used to obtain the changes that need to be made.

Overrides:
update in class DirectoryObjectEntity
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to a data integrity problem, or the entity may have been removed by another client.


IBM Tivoli Identity Manager 5.1
© Copyright International Business Machines Corporation 2007, 2009. All rightsreserved. US Government Users Restricited RightsUse, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Corp.