### *** This class provides Binary Compatibility only, not Source Compatibility ***

Package com.sas.services.information.metadata.dav

# Class DAVEntity

java.lang.Object
com.sas.services.information.metadata.dav.DAVEntity

All Implemented Interfaces:
  `AttributesInterface`, `DAVEntityInterface`, `Serializable`

Direct Known Subclasses:
  `DAVFolder`, `DAVItem`

@SASScope("ALL") @BinaryCompatibilityOnly public class DAVEntity extends Object implements DAVEntityInterface, Serializable
DAVEntity is a common class for DAVFolder and DAVItem. It implements the functions that are common to both sub-classes. In addition to these functions, a DAV entity has a set of properties, manipulated through the AttributesInterface.

Since:
  1.0
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `_acl`
  A serialized XML string from the ACL property on the resource
  `protected String`
  `_descAttribute`
  `protected String`
  `_fullUrl`
  `protected String`
  `_name`
  `protected String`
  `_nameAttribute`
  `protected String`
  `_objectClass`
  `protected Map`
  `_properties`
  `protected RepositoryInterface`
  `_repos`
  `protected String`
  `_reposId`
  `protected DAVResource`
  `_resource`
  `protected Map`
  `_schemaProperties`
  `protected List`
  `aclList`
  A list containing the access control entries from the ACL property on the resource.
  `protected byte[]`
  `content`
  `protected boolean`
  `hasBeenFetched`
  `static final int`
  `LOCAL`
  The variable has been set by the local client, and has not been saved in the persisten store.
  `static final int`
  `STORE`
  The value reflects the current value from the persistent store.
  `static final int`
  `UNSET`
  A variable is unset from either the persistent store or locally from the client.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DAVEntity(RepositoryData entity)`
  Creates a new DAVEntity from the entity (property map)
  `DAVEntity(RepositoryInterface repos, String reposId)`
  Creates a new DAVEntity for the entity with a repository id `reposId` in the repository `repos`
  `DAVEntity(String url, Map properties)`
  Creates a new DAVEntity from the url and a property map

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addAccessControlEntry(AccessControlEntryInterface ace)`
  Add an access control entry to the ACL
  `void`
  `addAttribute(String key, Object value)`
  Add an attribute with the given name and value
  `void`
  `addAttributes(Map attributeMap)`
  Add a number of attributes - names and values are given in the map.
  `protected void`
  `addUpdateMultiple(String attributeName, ArrayList newValue)`
  Add a multivalued property update.
  `protected void`
  `addUpdateSingle(String attributeName, String newValue)`
  Add a single valued property update
  `void`
  `clearLocalLists()`
  Clear the set and remove update lists.
  `void`
  `commitUpdates()`
  Commit the pending updates to the repository (setting or removing properties)
  `DAVEntityInterface`
  `copy(DAVFolderInterface folder)`
  Copy the entity to another folder.
  `void`
  `delete()`
  Delete this entity
  `void`
  `deleteAttribute(String key)`
  Delete a specific attribute
  `void`
  `deleteAttributes(List attributes)`
  Delete a list of attributes.
  `void`
  `fetchEntity()`
  Physically retrieve the entity from the repository and update the properties.
  `List`
  `getAccessControlList()`
  `String`
  `getACL()`
  Get the ACL for this entity
  `String`
  `getAttribute(String key)`
  Get the value of the attribute with the given key/name.
  `Map`
  `getAttributes()`
  Get a list of all the attributes.
  `String`
  `getCreateDate()`
  Returns the creation date, if it exists, `null` otherwise
  `DAVResource`
  `getDAVResource()`
  Return the underlying DAVResource for this entity, if it exists (that is if it has been fetched)
  `String`
  `getDescription()`
  Return the entity's description property
  `DAVFolderInterface`
  `getFolder()`
  Get the folder that contains this entity.
  `String`
  `getGUID()`
  Return the GUID for this entity, if one has been set.
  `String`
  `getModifyDate()`
  Returns the last modified date, if it exists, `null` otherwise
  `String`
  `getName()`
  Get the name of the entity.
  `String`
  `getObjectClass()`
  Return the type (object class) of this entity.
  `Map`
  `getProperties()`
  Get properties/attributes for this entity
  `String[]`
  `getRemarksKeys()`
  Get a list of entity keys for the remarks or dicussion threads relating to this object.
  `Map`
  `getRemoveUpdates()`
  If there are any updates to remove properties, then return this list
  `String`
  `getReposId()`
  Get the repository identifier for this entity.
  `RepositoryInterface`
  `getRepository()`
  Get the repository associated with this entity
  `Map`
  `getSetUpdates()`
  If there are any updates to set property values, then return this list
  `String`
  `getType()`
  Get the entity's object type.
  `String`
  `getUpdateableACL()`
  `String`
  `getUrl()`
  Get the url for this entity.
  `String`
  `getURL()`
  Return the full url as represented in a repository for this entity
  `boolean`
  `isCollection()`
  Is this DAVEntity a collection (folder) or not?
  `boolean`
  `isDeleted()`
  Has this entity been deleted?
  `boolean`
  `isUpdatePending()`
  Are there any updates pending for this entity.
  `DAVEntityInterface`
  `move(DAVFolderInterface folder)`
  Move the entity to another folder.
  `void`
  `refresh()`
  Refresh this entity.
  `void`
  `refresh(DAVEntityInterface entity)`
  Refresh this entity from the parameter.
  `void`
  `removeAccessControlEntry(AccessControlEntryInterface ace)`
  Remove an access control entry from the ACL
  `void`
  `setAccessControls(List aclList)`
  `void`
  `setACL(String acl)`
  Set the ACL for this entity
  `void`
  `setAttribute(String key, Object value)`
  Set the value of an attribute to the given value
  `void`
  `setAttributes(Map attributeMap)`
  Set a number of attributes - names and values are given in the map
  `void`
  `setContentClass(String contentClass)`
  Set the contentClass for a paricular resource.
  `void`
  `setDeleted()`
  Mark the entity as having been deleted.
  `void`
  `setDescription(String desc)`
  Set the entity's description property
  `void`
  `setGUID(String guid)`
  Set the GUID on this entity.
  `void`
  `setName(String name)`
  Set the name attribute
  `void`
  `setRemarksKeys(String[] keys)`
  Set the remarks or discussion threads relating to this object
  `void`
  `setReposId(String reposId)`
  Set the repository identifier for this entity.
  `void`
  `setRepository(RepositoryInterface repos)`
  Set the repository associated with this entity.
  `String`
  `toString()`
  `void`
  `update()`
  Persist any changes to the metadata back to the backing store.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### _properties

    protected Map _properties

  - ### _schemaProperties

    protected Map _schemaProperties

  - ### _repos

    protected RepositoryInterface _repos

  - ### _resource

    protected DAVResource _resource

  - ### _name

    protected String _name

  - ### _fullUrl

    protected String _fullUrl

  - ### _reposId

    protected String _reposId

  - ### content

    protected byte[] content

  - ### _acl

    protected String _acl
    A serialized XML string from the ACL property on the resource

  - ### aclList

    protected List aclList
    A list containing the access control entries from the ACL property on the resource. This format is easier to manipulate and is then converted to and from the serialized XML string when necessary

  - ### hasBeenFetched

    protected boolean hasBeenFetched

  - ### UNSET

    public static final int UNSET
    A variable is unset from either the persistent store or locally from the client.
    See Also:
      - Constant Field Values

  - ### LOCAL

    public static final int LOCAL
    The variable has been set by the local client, and has not been saved in the persisten store.
    See Also:
      - Constant Field Values

  - ### STORE

    public static final int STORE
    The value reflects the current value from the persistent store.
    See Also:
      - Constant Field Values

  - ### _nameAttribute

    protected String _nameAttribute

  - ### _descAttribute

    protected String _descAttribute

  - ### _objectClass

    protected String _objectClass

- ## Constructor Details

  - ### DAVEntity

    public DAVEntity(String url, Map properties)
    Creates a new DAVEntity from the url and a property map
    Parameters:
      `url` -
      `properties` -

  - ### DAVEntity

    public DAVEntity(RepositoryData entity)
    Creates a new DAVEntity from the entity (property map)
    Parameters:
      `entity` -

  - ### DAVEntity

    public DAVEntity(RepositoryInterface repos, String reposId)
    Creates a new DAVEntity for the entity with a repository id `reposId` in the repository `repos`
    Parameters:
      `repos` -
      `reposId` -

- ## Method Details

  - ### delete

    public void delete() throws ServiceException, RemoteException
    Delete this entity
    Specified by:
      `delete` in interface `DAVEntityInterface`
    Throws:
      `ServiceException`
      `RemoteException`

  - ### copy

    public DAVEntityInterface copy(DAVFolderInterface folder)
    Copy the entity to another folder.

    Specified by:
      `copy` in interface `DAVEntityInterface`
    Parameters:
      `folder` - destination folder
    Returns:
      DAVEntityInterface The new DAVEntity

  - ### move

    public DAVEntityInterface move(DAVFolderInterface folder)
    Move the entity to another folder.

    Specified by:
      `move` in interface `DAVEntityInterface`
    Parameters:
      `folder` - destination folder
    Returns:
      DAVEntityInterface The new DAVEntity

  - ### getUrl

    public String getUrl()
    Get the url for this entity.

    Specified by:
      `getUrl` in interface `DAVEntityInterface`
    Returns:
      String the full url for the entity

  - ### getFolder

    public DAVFolderInterface getFolder()
    Get the folder that contains this entity.
    Specified by:
      `getFolder` in interface `DAVEntityInterface`
    Returns:
      DAVFolderInterface

  - ### getName

    public String getName()
    Get the name of the entity.

    Specified by:
      `getName` in interface `DAVEntityInterface`
    Returns:
      String The name of the entity

  - ### getAttribute

    public String getAttribute(String key)
    Get the value of the attribute with the given key/name.
    Specified by:
      `getAttribute` in interface `AttributesInterface`
    Parameters:
      `key` - The name of the attribute/property
    Returns:
      String The value of the attribute with the given name

  - ### getAttributes

    public Map getAttributes()
    Get a list of all the attributes.
    Specified by:
      `getAttributes` in interface `AttributesInterface`
    Returns:
      The map containing all the key/value name pairs

  - ### setAttribute

    public void setAttribute(String key, Object value)
    Set the value of an attribute to the given value
    Specified by:
      `setAttribute` in interface `AttributesInterface`
    Parameters:
      `key` - The key/name for this attribute
      `value` - The value of this attribute, generally a String

  - ### addAttribute

    public void addAttribute(String key, Object value)
    Add an attribute with the given name and value
    Specified by:
      `addAttribute` in interface `AttributesInterface`
    Parameters:
      `key` - The key/name for this attribute
      `value` - The value of this attribute, generally a String

  - ### deleteAttribute

    public void deleteAttribute(String key)
    Delete a specific attribute
    Specified by:
      `deleteAttribute` in interface `AttributesInterface`
    Parameters:
      `key` - The name of the attribute to delete

  - ### setAttributes

    public void setAttributes(Map attributeMap)
    Set a number of attributes - names and values are given in the map
    Specified by:
      `setAttributes` in interface `AttributesInterface`
    Parameters:
      `attributeMap` - Map containing the name/value pairs to set

  - ### addAttributes

    public void addAttributes(Map attributeMap)
    Add a number of attributes - names and values are given in the map.
    Specified by:
      `addAttributes` in interface `AttributesInterface`
    Parameters:
      `attributeMap` - Map containing the name/value pairs to add

  - ### deleteAttributes

    public void deleteAttributes(List attributes)
    Delete a list of attributes.

    Specified by:
      `deleteAttributes` in interface `AttributesInterface`
    Parameters:
      `attributes` - List (of String) property names

  - ### getType

    public String getType()
    Get the entity's object type.

    Specified by:
      `getType` in interface `DAVEntityInterface`
    Returns:
      String Entity's object type

  - ### setReposId

    public void setReposId(String reposId)
    Set the repository identifier for this entity.
    Specified by:
      `setReposId` in interface `DAVEntityInterface`
    Parameters:
      `reposId` - Repository identifier for this entity

  - ### getReposId

    public String getReposId()
    Get the repository identifier for this entity. If the repository has not been set, then use the fullurl as an identifier.

    Specified by:
      `getReposId` in interface `DAVEntityInterface`
    Returns:
      String Entity's repository identifier

  - ### setRepository

    public void setRepository(RepositoryInterface repos)
    Set the repository associated with this entity.

    Parameters:
      `repos` - The repository that holds this entity

  - ### isCollection

    public boolean isCollection()
    Is this DAVEntity a collection (folder) or not?

    Specified by:
      `isCollection` in interface `DAVEntityInterface`
    Returns:
      boolean true if this is a collection, false otherwise

  - ### isUpdatePending

    public boolean isUpdatePending()
    Are there any updates pending for this entity. Any attribute sets or removes create a pending update.

    Specified by:
      `isUpdatePending` in interface `DAVEntityInterface`
    Returns:
      boolean true is there are updates pending, false otherwise

  - ### clearLocalLists

    public void clearLocalLists()
    Clear the set and remove update lists. Usually called when the entity is persisted or the updates are no longer required/

  - ### refresh

    public void refresh(DAVEntityInterface entity)
    Refresh this entity from the parameter. Reset any pending updates as these don't apply any longer.
    Specified by:
      `refresh` in interface `DAVEntityInterface`
    Parameters:
      `entity` - A DAVEntity from which to obtain the latest properties

  - ### refresh

    public void refresh()
    Refresh this entity. This means getting a fresh copy from the repository
    Specified by:
      `refresh` in interface `DAVEntityInterface`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### addUpdateSingle

    protected void addUpdateSingle(String attributeName, String newValue)
    Add a single valued property update
    Parameters:
      `attributeName` - Attribute to be changed
      `newValue` - New atrribute value

  - ### addUpdateMultiple

    protected void addUpdateMultiple(String attributeName, ArrayList newValue)
    Add a multivalued property update. This is not supported in DAV

  - ### commitUpdates

    public void commitUpdates() throws ServiceException, RemoteException
    Commit the pending updates to the repository (setting or removing properties)
    Throws:
      `ServiceException` - If a service level error occurs.
      `RemoteException` - In the event of remote object failure.

  - ### update

    public void update() throws ServiceException, RemoteException
    Persist any changes to the metadata back to the backing store. Build an update list by checking the states of the local variables. Then commit any changes to the store, and get rid of the change list.
    Specified by:
      `update` in interface `DAVEntityInterface`
    Throws:
      `ServiceException` - in the case of a services failure
      `RemoteException` - in the case of network failures

  - ### setContentClass

    public void setContentClass(String contentClass)
    Set the contentClass for a paricular resource. This will only work once (preferably at object creation time). After that, the contentClass cannot be changed.

    Specified by:
      `setContentClass` in interface `DAVEntityInterface`
    Parameters:
      `contentClass` - The content class to set for this entity

  - ### getRepository

    public RepositoryInterface getRepository()
    Get the repository associated with this entity
    Specified by:
      `getRepository` in interface `DAVEntityInterface`
    Returns:
      RepositoryInterface The repository associated with this entity

  - ### setName

    public void setName(String name)
    Set the name attribute
    Specified by:
      `setName` in interface `DAVEntityInterface`
    Parameters:
      `name` - Value for the name attribute

  - ### getDescription

    public String getDescription()
    Return the entity's description property
    Specified by:
      `getDescription` in interface `DAVEntityInterface`
    Returns:
      String The description for the entity

  - ### setDescription

    public void setDescription(String desc)
    Set the entity's description property
    Specified by:
      `setDescription` in interface `DAVEntityInterface`
    Parameters:
      `desc` - The value for the description property of the entity

  - ### getObjectClass

    public String getObjectClass()
    Return the type (object class) of this entity.
    Returns:
      String Object class for this entity

  - ### getURL

    public String getURL()
    Return the full url as represented in a repository for this entity
    Specified by:
      `getURL` in interface `DAVEntityInterface`
    Returns:
      String The url of the entity

  - ### getProperties

    public Map getProperties()
    Get properties/attributes for this entity
    Specified by:
      `getProperties` in interface `DAVEntityInterface`
    Returns:
      Map (of properties to values) Entity's properties

  - ### getSetUpdates

    public Map getSetUpdates()
    If there are any updates to set property values, then return this list
    Specified by:
      `getSetUpdates` in interface `DAVEntityInterface`
    Returns:
      Map (of properties to property values) Properties to be set

  - ### getRemoveUpdates

    public Map getRemoveUpdates()
    If there are any updates to remove properties, then return this list
    Specified by:
      `getRemoveUpdates` in interface `DAVEntityInterface`
    Returns:
      Map (of properties to null) Properties to be removed

  - ### getDAVResource

    public DAVResource getDAVResource()
    Return the underlying DAVResource for this entity, if it exists (that is if it has been fetched)
    Specified by:
      `getDAVResource` in interface `DAVEntityInterface`

  - ### fetchEntity

    public void fetchEntity()
    Physically retrieve the entity from the repository and update the properties. The content may be fetched later when required to improve performance

  - ### getCreateDate

    public String getCreateDate()
    Description copied from interface: `DAVEntityInterface`
    Returns the creation date, if it exists, `null` otherwise
    Specified by:
      `getCreateDate` in interface `DAVEntityInterface`
    Returns:
      String The creation date

  - ### getModifyDate

    public String getModifyDate()
    Description copied from interface: `DAVEntityInterface`
    Returns the last modified date, if it exists, `null` otherwise
    Specified by:
      `getModifyDate` in interface `DAVEntityInterface`
    Returns:
      String The last modified date

  - ### getRemarksKeys

    public String[] getRemarksKeys()
    Description copied from interface: `DAVEntityInterface`
    Get a list of entity keys for the remarks or dicussion threads relating to this object.
    Specified by:
      `getRemarksKeys` in interface `DAVEntityInterface`
    Returns:
      String[] An array of entity keys

  - ### setRemarksKeys

    public void setRemarksKeys(String[] keys)
    Description copied from interface: `DAVEntityInterface`
    Set the remarks or discussion threads relating to this object
    Specified by:
      `setRemarksKeys` in interface `DAVEntityInterface`
    Parameters:
      `keys` - An array of entity keys for the remarks relating to this object.

  - ### setACL

    public void setACL(String acl)
    Description copied from interface: `DAVEntityInterface`
    Set the ACL for this entity
    Specified by:
      `setACL` in interface `DAVEntityInterface`
    Parameters:
      `acl` - An XML element string that defines the WebDAV ACL for this resource

  - ### getACL

    public String getACL()
    Description copied from interface: `DAVEntityInterface`
    Get the ACL for this entity
    Specified by:
      `getACL` in interface `DAVEntityInterface`
    Returns:
      String The ACL element that describes the WebDAV ACL for this resource

  - ### getAccessControlList

    public List getAccessControlList()
    Specified by:
      `getAccessControlList` in interface `DAVEntityInterface`

  - ### setAccessControls

    public void setAccessControls(List aclList)

  - ### getUpdateableACL

    public String getUpdateableACL()
    Specified by:
      `getUpdateableACL` in interface `DAVEntityInterface`

  - ### isDeleted

    public boolean isDeleted()
    Description copied from interface: `DAVEntityInterface`
    Has this entity been deleted?
    Specified by:
      `isDeleted` in interface `DAVEntityInterface`
    Returns:
      boolean Whether entity has been deleted or not

  - ### setDeleted

    public void setDeleted()
    Description copied from interface: `DAVEntityInterface`
    Mark the entity as having been deleted.
    Specified by:
      `setDeleted` in interface `DAVEntityInterface`

  - ### getGUID

    public String getGUID()
    Return the GUID for this entity, if one has been set.
    Specified by:
      `getGUID` in interface `DAVEntityInterface`
    Returns:
      String The GUID for this entity

  - ### setGUID

    public void setGUID(String guid)
    Set the GUID on this entity.
    Specified by:
      `setGUID` in interface `DAVEntityInterface`
    Parameters:
      `guid` - The GUID to be set on this entity

  - ### addAccessControlEntry

    public void addAccessControlEntry(AccessControlEntryInterface ace)
    Description copied from interface: `DAVEntityInterface`
    Add an access control entry to the ACL
    Specified by:
      `addAccessControlEntry` in interface `DAVEntityInterface`
    Parameters:
      `ace` - Access control entry to be added to the ACL

  - ### removeAccessControlEntry

    public void removeAccessControlEntry(AccessControlEntryInterface ace)
    Description copied from interface: `DAVEntityInterface`
    Remove an access control entry from the ACL
    Specified by:
      `removeAccessControlEntry` in interface `DAVEntityInterface`
    Parameters:
      `ace` - Access control entry to be removed from the ACL