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

com.sas.services.information.metadata.dav
Class DAVItem

com.sas.services.information.metadata.dav.DAVItem
All Implemented Interfaces:
AttributesInterface, DAVEntityInterface, DAVItemInterface, java.io.Serializable
Direct Known Subclasses:
DAVApplitem, DAVBinarypackage, DAVEvent

public class DAVItem
implements DAVItemInterface

DAVItem represents a non-collection resource in a DAV Store. DAVEntity provides the common functionality and DAVItem only the resource specific characteristics (eg. content manipulation).

Since:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.sas.services.information.metadata.dav.DAVEntity
_acl, _descAttribute, _fullUrl, _name, _nameAttribute, _objectClass, _properties, _repos, _reposId, _resource, _schemaProperties, aclList, content, hasBeenFetched, LOCAL, STORE, UNSET
 
Constructor Summary
DAVItem(com.sas.services.information.RepositoryData entity)
          Creates a new DAVFolder from the information in the entity
DAVItem(RepositoryInterface repos, java.lang.String reposId)
          Creates a new DAVItem for the entity with a repository id reposId in the repository repos
DAVItem(java.lang.String url, java.util.Map properties)
          Creates a new DAVItem from the url and a property map
 
Method Summary
 void checkin()
          Check in the item
 void checkout()
          Check out the item
 void clearLocalLists()
          Clear local lists as for DAVEntity and then reset the contentsStatus for this resource to reflect the fact that the content is the same as in the DAV store
protected  void finalize()
           
 int getContentLength()
          Get the length of the content
 java.io.InputStream getContents()
          Get the contents of the item.
 byte[] getContentsAsBytes()
          Get the contents of the item as a byte array
 int getContentsStatus()
          Returns the status of the contents in the item
 java.lang.String getContentType()
          Get the content type for the item.
 boolean hasContentsUpdates()
          Does this item have any new content that should be updated/persisted ?
 boolean isUpdatePending()
          Are there any updates pending for this entity.
 void setContents(byte[] contents)
          Set the contents of the item.
 void setContents(java.io.InputStream contents)
          Set the contents of the item from an input stream.
 void setContentsfromStore(DAVResourceInterface r)
          Set the contents of the item from store
 void setContentsStatus(int contentsStatus)
          Set the content status field.
 void setContentType(java.lang.String contentType)
          Sets the content type for the item.
 java.lang.String toString()
           
 void uncheckout()
          Uncheckout the item
 
Methods inherited from class com.sas.services.information.metadata.dav.DAVEntity
addAccessControlEntry, addAttribute, addAttributes, addUpdateMultiple, addUpdateSingle, commitUpdates, copy, delete, deleteAttribute, deleteAttributes, fetchEntity, getAccessControlList, getACL, getAttribute, getAttributes, getCreateDate, getDAVResource, getDescription, getFolder, getGUID, getModifyDate, getName, getObjectClass, getProperties, getRemarksKeys, getRemoveUpdates, getReposId, getRepository, getSetUpdates, getType, getUpdateableACL, getUrl, getURL, isCollection, isDeleted, move, refresh, refresh, removeAccessControlEntry, setAccessControls, setACL, setAttribute, setAttributes, setContentClass, setDeleted, setDescription, setGUID, setName, setRemarksKeys, setReposId, setRepository, update
 
Methods inherited from interface com.sas.services.information.metadata.dav.DAVEntityInterface
addAccessControlEntry, copy, delete, getAccessControlList, getACL, getCreateDate, getDAVResource, getDescription, getFolder, getGUID, getModifyDate, getName, getProperties, getRemarksKeys, getRemoveUpdates, getReposId, getRepository, getSetUpdates, getType, getUpdateableACL, getUrl, getURL, isCollection, isDeleted, move, refresh, refresh, removeAccessControlEntry, setACL, setContentClass, setDeleted, setDescription, setGUID, setName, setRemarksKeys, setReposId, update
 
Methods inherited from interface com.sas.services.information.metadata.dav.AttributesInterface
addAttribute, addAttributes, deleteAttribute, deleteAttributes, getAttribute, getAttributes, setAttribute, setAttributes
 

Constructor Detail

DAVItem

public DAVItem(RepositoryInterface repos,
               java.lang.String reposId)
Creates a new DAVItem for the entity with a repository id reposId in the repository repos


DAVItem

public DAVItem(java.lang.String url,
               java.util.Map properties)
Creates a new DAVItem from the url and a property map


DAVItem

public DAVItem(com.sas.services.information.RepositoryData entity)
Creates a new DAVFolder from the information in the entity

Method Detail

setContentType

public void setContentType(java.lang.String contentType)
Sets the content type for the item.

Specified by:
setContentType in interface DAVItemInterface
Parameters:
contentType - A string that represents the media type for the item

getContentType

public java.lang.String getContentType()
Get the content type for the item.

Specified by:
getContentType in interface DAVItemInterface
Returns:
String The media type for the item's content

getContents

public java.io.InputStream getContents()
                                throws java.rmi.RemoteException
Get the contents of the item.

Specified by:
getContents in interface DAVItemInterface
Returns:
InputStream An input stream that represents the item's contents
Throws:
java.rmi.RemoteException - in the case of network failure

setContents

public void setContents(byte[] contents)
Set the contents of the item.

Specified by:
setContents in interface DAVItemInterface
Parameters:
contents - A byte array that represents the item's content

setContents

public void setContents(java.io.InputStream contents)
Set the contents of the item from an input stream. For remote deployment the InputStream should be wrapped in an InputStreamAdapter

Specified by:
setContents in interface DAVItemInterface
Parameters:
contents - An input stream containing the contents

setContentsfromStore

public void setContentsfromStore(DAVResourceInterface r)
Set the contents of the item from store

Specified by:
setContentsfromStore in interface DAVItemInterface
Parameters:
r - A byte array that represents the item's content

getContentLength

public int getContentLength()
Get the length of the content

Specified by:
getContentLength in interface DAVItemInterface
Returns:
int The length of the content

getContentsAsBytes

public byte[] getContentsAsBytes()
Get the contents of the item as a byte array

Specified by:
getContentsAsBytes in interface DAVItemInterface
Returns:
byte[] A byte array with the contents of the item

toString

public java.lang.String toString()
Overrides:
toString in class DAVEntity

clearLocalLists

public void clearLocalLists()
Clear local lists as for DAVEntity and then reset the contentsStatus for this resource to reflect the fact that the content is the same as in the DAV store

Overrides:
clearLocalLists in class DAVEntity

hasContentsUpdates

public boolean hasContentsUpdates()
Does this item have any new content that should be updated/persisted ?

Specified by:
hasContentsUpdates in interface DAVItemInterface
Returns:
boolean Whether content has changed since the last update

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setContentsStatus

public void setContentsStatus(int contentsStatus)
Description copied from interface: DAVItemInterface
Set the content status field.

Specified by:
setContentsStatus in interface DAVItemInterface
Parameters:
contentsStatus - The content status to be set

getContentsStatus

public int getContentsStatus()
Returns the status of the contents in the item

Specified by:
getContentsStatus in interface DAVItemInterface
Returns:
int The status of the content

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
Overrides:
isUpdatePending in class DAVEntity
Returns:
boolean true is there are updates pending, false otherwise

checkout

public void checkout()
              throws java.rmi.RemoteException
Check out the item

Specified by:
checkout in interface DAVItemInterface
Throws:
java.rmi.RemoteException

checkin

public void checkin()
             throws java.rmi.RemoteException
Check in the item

Specified by:
checkin in interface DAVItemInterface
Throws:
java.rmi.RemoteException

uncheckout

public void uncheckout()
                throws java.rmi.RemoteException
Uncheckout the item

Specified by:
uncheckout in interface DAVItemInterface
Throws:
java.rmi.RemoteException

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




Copyright © 2009 SAS Institute Inc. All Rights Reserved.