com.ibm.itim.dataservices.model
Class DirectoryObjectEntity

java.lang.Object
  extended by com.ibm.itim.dataservices.model.DirectoryObjectEntity
All Implemented Interfaces:
com.ibm.itim.util.Sortable, java.io.Serializable
Direct Known Subclasses:
AccountEntity, GroupEntity, OrganizationalContainerEntity, PersonEntity, RoleEntity, ServiceEntity, SystemRoleEntity

public class DirectoryObjectEntity
extends java.lang.Object
implements com.ibm.itim.util.Sortable, java.io.Serializable

Class that represents an entry in the directory. The most general relationships that entry has in the data model can be traversed through the interface of this class. The ability to update and remove an entry in the data store is also provided.

See Also:
Serialized Form

Field Summary
static java.lang.String ORGANIZATION
          Constant (String) for the organization relationship name
static java.lang.String PARENT
          Constant (String) for the parent relationship name.
 
Fields inherited from interface com.ibm.itim.util.Sortable
ATTR_NAME
 
Constructor Summary
DirectoryObjectEntity(DirectoryObject dirObject)
          Creates a DirectoryObjectEntity representing an entity in directory server.
DirectoryObjectEntity(ObjectProfile profile, DirectoryObject dirObject)
          Creates a DirectoryObjectEntity representing an entity in directory server.
 
Method Summary
 boolean equals(java.lang.Object dirEntity)
          Determine whether the two object reference the same entity in term of Distinguished name.
 DirectoryObject getDirectoryObject()
          Returns the DirectoryObject value object that holds the attributes of this object.
 DistinguishedName getDistinguishedName()
          Returns the distinguished name of the object.
static DirectoryObjectEntity getEntity(DirectoryObject dirObject)
          Returns the parent of the current object.
 EntityLifecycleProfile getLifecycle()
          Returns the EntityLifecycleProfile holding all lifecycle characteristics of the entity (if defined).
static java.lang.String getObjectCategory(DistinguishedName dn)
          Returns the object category for a given distinguished name.
 DirectoryObjectEntity getParent()
          Returns the parent of the current object.
 DistinguishedName getParentDN()
          Retrieve the DistinguishedName of the parent of the current object.
 ObjectProfile getProfile()
          Returns the profile of the object.
 Relationship getRelationship(java.lang.String name)
          Returns a relationship with the given name, if any.
 java.lang.Object getSortValue(java.lang.String attributeName)
           
 java.util.Collection<java.lang.String> getSupportedRelationships()
          Returns a list of relationship names this entity supports.
 int hashCode()
          Create hash code based on raw distinguished name string
 void initialize(DirectoryObject dirObject)
           
 void initialize(ObjectProfile profile, DirectoryObject dirObject)
           
 boolean isSupportedRelationship(java.lang.String name)
          Returns whether the relationship with the given name is supported by this entity.
 void remove()
          Removes the entity from the data store.
 void remove(boolean copyToRecycle)
          Removes the entity from the data store.
 void setLifecycle(EntityLifecycleProfile profile)
          Changes the EntityLifecycleProfile holding all lifecycle characteristics of the entity (if defined).
 java.lang.String toString()
          Returns a string representation of the object.
 void update()
          Updates the attributes of the entity in the data store.
 void update(DirectoryObject updObject)
          Deprecated. since 5.0, please use update()
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PARENT

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

See Also:
Constant Field Values

ORGANIZATION

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

See Also:
Constant Field Values
Constructor Detail

DirectoryObjectEntity

public DirectoryObjectEntity(ObjectProfile profile,
                             DirectoryObject dirObject)
Creates a DirectoryObjectEntity representing an entity in directory server.

Parameters:
profile - profile describing a type of an entity object.
dirObject - directory object contains data of an entity

DirectoryObjectEntity

public DirectoryObjectEntity(DirectoryObject dirObject)
Creates a DirectoryObjectEntity representing an entity in directory server.

Parameters:
dirObject - directory object contains data of an entity
Method Detail

initialize

public void initialize(ObjectProfile profile,
                       DirectoryObject dirObject)

initialize

public void initialize(DirectoryObject dirObject)

getDistinguishedName

public DistinguishedName getDistinguishedName()
Returns the distinguished name of the object.

Returns:
DistinguishedName of the object.

getDirectoryObject

public DirectoryObject getDirectoryObject()
Returns the DirectoryObject value object that holds the attributes of this object.

Returns:
DirectoryObject holding the attributes of the object.

getProfile

public ObjectProfile getProfile()
                         throws ModelCommunicationException,
                                ObjectNotFoundException
Returns the profile of the object. This profile defines the semantic mappings that may need to be applied.

Returns:
ObjectProfile object.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ObjectNotFoundException - Thrown if unable to locate the related profile. This may be due to a data integrity problem.

getParent

public DirectoryObjectEntity getParent()
                                throws ModelCommunicationException,
                                       ModelIntegrityException
Returns the parent of the current object. The determination of what entity is the parent will be an implementing class's decision, but the purpose of identifying a parent is to present a logical hierarchy of objects. This hierarchy is used for determining authorization, as well as possible other features that may be based on object hierarchy.

Returns:
DirectoryObjectEntity representing the object's parent.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if unable to locate the related parent due to a data integrity problem.

getParentDN

public DistinguishedName getParentDN()
                              throws ModelCommunicationException,
                                     ModelIntegrityException
Retrieve the DistinguishedName of the parent of the current object. The determination of what entity is the parent will be an implementing class's decision, but the purpose of identifying a parent is to present a logical hierarchy of objects. This hierarchy is used for determining authorization, as well as possible other features that may be based on object hierarchy.

Returns:
DirectoryObjectEntity representing the object's parent.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if unable to locate the related parent due to a data integrity problem.

getEntity

public static DirectoryObjectEntity getEntity(DirectoryObject dirObject)
                                       throws ModelIntegrityException
Returns the parent of the current object. The determination of what entity is the parent will be an implementing class's decision, but the purpose of identifying a parent is to present a logical hierarchy of objects. This hierarchy is used for determining authorization, as well as possible other features that may be based on object hierarchy.

Returns:
DirectoryObjectEntity representing the object's parent.
Throws:
ModelIntegrityException - Thrown if unable to locate the related parent due to a data integrity problem.

getObjectCategory

public static java.lang.String getObjectCategory(DistinguishedName dn)
Returns the object category for a given distinguished name. You can use category to determine the type of the object for a given DN.

Returns:
String representing the object's category. Returns empty string if there is no support category found for the DN.
Since:
5.0

update

public void update(DirectoryObject updObject)
            throws ModelCommunicationException,
                   ObjectNotFoundException
Deprecated. since 5.0, please use update()

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.

Parameters:
updObject - DirectoryObject that holds the changes.
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.

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.

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.

remove

public void remove()
            throws ModelCommunicationException,
                   ObjectNotFoundException,
                   ModelRemoveException
Removes the entity from the data store. The object is copied to the recycle bin before being deleted.

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 already been removed by another client.
ModelRemoveException - Thrown if unable to remove an object of the data store.

remove

public void remove(boolean copyToRecycle)
            throws ModelCommunicationException,
                   ObjectNotFoundException,
                   ModelRemoveException
Removes the entity from the data store.

Parameters:
copyToRecycle - If true the object will be copied to the recycle bin before being deleted
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 already been removed by another client.
ModelRemoveException - Thrown if unable to remove an object of the data store.

getRelationship

public Relationship getRelationship(java.lang.String name)
                             throws ObjectNotFoundException,
                                    ModelIntegrityException,
                                    java.lang.InstantiationException
Returns a relationship with the given name, if any.

Parameters:
name - Name of the relationship.
Returns:
Relationship object with matching name.
Throws:
ModelIntegrityException - Thrown if unable to access meta-data to find relationship.
ObjectNotFoundException - Thrown if unable to locate a relationship with the same name.
java.lang.InstantiationException - Thrown if unable to instantiate the relationship found with the same name.

getSupportedRelationships

public java.util.Collection<java.lang.String> getSupportedRelationships()
                                                                 throws ModelIntegrityException,
                                                                        ObjectNotFoundException
Returns a list of relationship names this entity supports.

Returns:
Collection of relationship names (Strings).
Throws:
ModelIntegrityException - Thrown if unable to access meta-data to find relationships.
ObjectNotFoundException - Thrown if unable to meta-data information about this class.

isSupportedRelationship

public boolean isSupportedRelationship(java.lang.String name)
                                throws ModelIntegrityException,
                                       ObjectNotFoundException
Returns whether the relationship with the given name is supported by this entity.

Parameters:
name - Name of the relationship.
Returns:
True if supported, false if not.
Throws:
ModelIntegrityException - Thrown if unable to access meta-data to find relationships.
ObjectNotFoundException - Thrown if unable to meta-data information about this class.

getLifecycle

public EntityLifecycleProfile getLifecycle()
                                    throws ModelCommunicationException,
                                           ModelIntegrityException
Returns the EntityLifecycleProfile holding all lifecycle characteristics of the entity (if defined).

Returns:
EntityLifecycleProfile with lifecycle characteristics, null if not defined or multiple is found.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if unable to access lifecycle information.

setLifecycle

public void setLifecycle(EntityLifecycleProfile profile)
                  throws ModelCommunicationException,
                         ObjectNotFoundException,
                         ModelIntegrityException
Changes the EntityLifecycleProfile holding all lifecycle characteristics of the entity (if defined).

Parameters:
profile - EntityLifecycleProfile with lifecycle characteristics. Null will remove all characteristics previously defined.
Throws:
ModelCommunicationException - Thrown if unable to communicate with the data store.
ModelIntegrityException - Thrown if unable to set lifecycle information.
ObjectNotFoundException - Thrown if unable to locate the entity in the data store. This may be due to an invalid distinguished name, or the entity may have been removed by another client.

equals

public boolean equals(java.lang.Object dirEntity)
Determine whether the two object reference the same entity in term of Distinguished name. If two objects have the same distinguished name, they are equal.

Overrides:
equals in class java.lang.Object
Parameters:
dirEntity - the target entity for comparison.
Returns:
true if the source and target entity have the same distinguished name, else false;
Throws:
java.lang.IllegalArgumentException - Thrown if dirEntity is not an instance of DirectoryObjectEntity.

hashCode

public int hashCode()
Create hash code based on raw distinguished name string

Overrides:
hashCode in class java.lang.Object
Returns:
int representing the hashcode.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the object

getSortValue

public java.lang.Object getSortValue(java.lang.String attributeName)
Specified by:
getSortValue in interface com.ibm.itim.util.Sortable


IBM Security Identity Manager 6.0.0
© Copyright International Business Machines Corporation 2007, 2012. All rights reserved. US Government Users Restricited Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.