org.progeeks.repository
Interface RepositoryItem

All Superinterfaces:
Identifiable
All Known Implementing Classes:
Repository.ReadLockedItem, Repository.WriteLockedItem

public interface RepositoryItem
extends Identifiable

Interface representing a handle to a document in the content repository.

Version:
$Revision: 1.2 $
Author:
Paul Wisneskey

Method Summary
 void delete()
          Deletes the item and its meta-data from the repository.
 java.io.File getDataFile()
          Returns the file object for the item's data.
 java.lang.String getId()
          Returns the id string that unique identifies the item in the repository.
 Lock getLock()
          Returns the unique identifier for the lock that the repository item was obtained with.
 MetaObject getMetaData()
          Returns the meta-data for the file.
 void release()
          Releases the lock held on an item.
 void setMetaData(MetaObject metaData)
          Sets the meta-data for a file, replacing any existing meta-data it had.
 

Method Detail

getId

java.lang.String getId()
Returns the id string that unique identifies the item in the repository.

Specified by:
getId in interface Identifiable

getLock

Lock getLock()
Returns the unique identifier for the lock that the repository item was obtained with.


getMetaData

MetaObject getMetaData()
Returns the meta-data for the file.


setMetaData

void setMetaData(MetaObject metaData)
Sets the meta-data for a file, replacing any existing meta-data it had. This can only be done if the item was obtained with a write lock.


getDataFile

java.io.File getDataFile()
Returns the file object for the item's data. It is up to the caller to not abuse this. No attempt is made to prevent changes to an item's data if the item was not obtained with a write lock.


delete

void delete()
Deletes the item and its meta-data from the repository. This can only be done if the item was obtained with a write lock.


release

void release()
Releases the lock held on an item. After this is called, the repository item object will no longer be usable. It is up to the caller to ensure that no one is using any data file objects returned for this item.



Copyright © 2002-2003 Paul Speed. All Rights Reserved.