com.ibm.itim.dataservices.model

Class DirectoryObjectEntity

  • java.lang.Object
    • 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 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

      • 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.
      • 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.
      • 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.
      • 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.
      • 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