Class PersistentObject

java.lang.Object
com.emc.documentum.rest.model.AbstractLinkable
com.emc.documentum.rest.model.PersistentObject
All Implemented Interfaces:
com.emc.documentum.rest.conditional.Digestible, Linkable
Direct Known Subclasses:
AclObject, AuditEvent, AuditTrail, ContentMetaData, Format, GroupObject, JobObject, QueryResultItem, RelationObject, RelationTypeObject, SysObject, TypeObject, UserObject

public class PersistentObject extends AbstractLinkable implements com.emc.documentum.rest.conditional.Digestible
Persistent object resource.
  • Field Details

    • type

      protected String type
      Type of persistent object
    • typeDef

      protected String typeDef
      Type definition
    • properties

      protected List<Attribute<?>> properties
      Properties of persistent object
    • mandatoryAttributes

      protected Map<String,Object> mandatoryAttributes
      Mandatory fields
    • optionalAttributes

      protected Map<String,Object> optionalAttributes
      Optional fields
    • id

      protected String id
      ID of persistent object
    • permissions

      protected Permissions permissions
      Permission of persistent object
    • versionPolicy

      protected VersionPolicy versionPolicy
      Version policy of persistent object
    • isLightweight

      protected boolean isLightweight
      whether the object is lightweight object
    • isMaterialized

      protected boolean isMaterialized
      whether the lightweight object is materialized
    • isSnapshot

      protected boolean isSnapshot
      whether the object is snapshot
    • isVirtual

      protected boolean isVirtual
      whether the object is virtual
    • parentId

      protected String parentId
      the parent object id
    • reqDigest

      protected String reqDigest
  • Constructor Details

    • PersistentObject

      public PersistentObject()
  • Method Details

    • getId

      public String getId()
      Get object ID of the persistent object
      Returns:
      ID
    • setId

      public void setId(String id)
      Set object ID of the persistent object
      Parameters:
      id - object ID
    • getType

      public String getType()
      Get object type of the persistent object; if it is not specified explicitly, return the attribute "r_object_type" by alternate.
      Returns:
      type
    • setType

      public void setType(String type)
      Set the object type of the persistent object
      Parameters:
      type - object type
    • getTypeDef

      public String getTypeDef()
      Get the type definition of the persistent object in URI
      Returns:
      type definition
    • setTypeDef

      public void setTypeDef(String typeDef)
      Set the type definition of the persistent object in URI
      Parameters:
      typeDef - type definition
    • reInitAttributes

      public void reInitAttributes()
      Reset the properties of the persistent object
    • getMandatoryAttribute

      public Object getMandatoryAttribute(String name)
      Get mandatory attribute of the persistent object by name. The mandatory attributes will not be put into the representation.
      Parameters:
      name - the attribute name
      Returns:
      mandatory attributes
    • addMandatoryAttribute

      public void addMandatoryAttribute(String name, Object value)
      Add the mandatory attribute into the persistent object
      Parameters:
      name - the attribute name
      value - the attribute value
    • getMandatoryFields

      public List<String> getMandatoryFields()
      Get mandatory attribute names
      Returns:
      mandatory fields
    • geOptionalAttribute

      public Object geOptionalAttribute(String name)
      Get optional attribute of the persistent object by name. The optional attributes will not be put into the representation.
      Parameters:
      name - the attribute name
      Returns:
      optional attribute value
    • addOptionalAttribute

      public void addOptionalAttribute(String name, Object value)
      Add the optional attribute into the persistent object
      Parameters:
      name - the attribute name
      value - the attribute value
    • getOptionalFields

      public List<String> getOptionalFields()
      Get optional attribute names
      Returns:
      optional attribute names
    • getInternalFields

      public List<String> getInternalFields()
      Get internal attribute names
      Returns:
      internal fields
    • getPermissions

      public Permissions getPermissions()
      Get permissions
      Returns:
      permissions
    • setPermissions

      public void setPermissions(int basic, String extended)
      Set permissions
      Parameters:
      basic - basic permission
      extended - extended permission
    • setVersionPolicy

      public void setVersionPolicy(VersionPolicy policy)
      Set version policy
      Parameters:
      policy - version policy
    • getVersionPolicy

      public VersionPolicy getVersionPolicy()
      Get version policy
      Returns:
      version policy
    • getAttributes

      public Collection<Attribute<?>> getAttributes()
      Get the attribute collection of the persistent object
      Returns:
      attribute collection
    • removeAttributeIfExisted

      public boolean removeAttributeIfExisted(String name)
      Remove an attribute by name if it does exist
      Parameters:
      name - the attribute name
      Returns:
      true if the specified attribute is removed
    • addAttribute

      public void addAttribute(Attribute<?> attr)
      Add attribute
      Parameters:
      attr - attribute to add
    • getAttributeByName

      public Object getAttributeByName(String name)
      Get attribute value by name
      Parameters:
      name - the attribute name to get
      Returns:
      attribute
    • hasAttribute

      public boolean hasAttribute(String name)
      Check whether the persistent object has the given attribute
      Parameters:
      name - the attribute name
      Returns:
      true if the attribute exists in the persistent object; false otherwise.
    • hasAttributeValue

      public boolean hasAttributeValue(String name)
      Check whether the attribute value is not empty
      Parameters:
      name - the attribute name
      Returns:
      true if the attribute value is not empty
    • hasOptionalAttribute

      public boolean hasOptionalAttribute(String name)
      Check whether the persistent object has the given optional attribute
      Parameters:
      name - the attribute name
      Returns:
      true if the attribute exists in the persistent object; false otherwise.
    • isLightweight

      public boolean isLightweight()
      Returns:
      whether the object is lightweight object
    • setLightweight

      public void setLightweight(boolean isLightweight)
      set whether the object is lightweight object
      Parameters:
      isLightweight - is lightweight object or not
    • isMaterialized

      public boolean isMaterialized()
      Returns:
      whether the lightweight object is materialized
    • setMaterialized

      public void setMaterialized(boolean isMaterialized)
      set whether the lightweight object is materialized
      Parameters:
      isMaterialized - is materialized or not
    • isSnapshot

      public boolean isSnapshot()
    • setIsSnapshot

      public void setIsSnapshot(boolean snapshot)
    • setIsVirtualDocument

      public void setIsVirtualDocument(boolean virtual)
    • isVirtualDocument

      public boolean isVirtualDocument()
    • getParentId

      public String getParentId()
      Returns:
      the parent object id
    • setParentId

      public void setParentId(String parentId)
      set the parent object id
      Parameters:
      parentId - the parent object id
    • convertDate

      public boolean convertDate()
      whether need convert date object to string during convert by default, PersistentObject will always convert date string
      Returns:
      convert date
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • calculatesDigest

      public String calculatesDigest()
      Specified by:
      calculatesDigest in interface com.emc.documentum.rest.conditional.Digestible
    • setReqDigest

      public void setReqDigest(String reqDigest)
      Specified by:
      setReqDigest in interface com.emc.documentum.rest.conditional.Digestible
    • getReqDigest

      public String getReqDigest()
      Specified by:
      getReqDigest in interface com.emc.documentum.rest.conditional.Digestible
    • isMatchedWithReqDigest

      public boolean isMatchedWithReqDigest(String digest)
      Specified by:
      isMatchedWithReqDigest in interface com.emc.documentum.rest.conditional.Digestible