|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StorableDocument
Generic storable repository document.
This interface extends Document
by adding methods that allow
a document to be created and modified. This is necessary for applications
that create document objects, allowing them to set the document properties,
data contents, etc., prior to storing it into a repository system.
Note that subclasses of this interface should not provide a public
constructor, since document objects are meant to be created using the
RepositoryWriter.createDocument()
method instead. This is so that document IDs and default document properties
can be established for newly created documents by the RepositoryWriter
implementation as soon as possible, at the time that the document objects are
created.
RepositoryWriter
,
AbstractStorableDocument
Field Summary | |
---|---|
static java.lang.String |
REV
|
Method Summary | |
---|---|
void |
addProperty(DocumentProperty prop)
Add a property to this repository document. |
void |
doneReading()
Indicate that reading of the input data stream for this repository document is complete. |
void |
setDataStream(java.io.InputStream in)
Establish the input data stream containing the contents of this repository document. |
void |
setID(java.lang.String id)
Establish the ID of this repository document. |
void |
setProperty(java.lang.String prop,
java.lang.Object val)
Establish the value of a property in this repository document. |
void |
setSize(long len)
Establish the data size for this repository document. |
Methods inherited from interface tribble.repository.Document |
---|
close, getDataStream, getID, getProperties, getProperty, getSize |
Field Detail |
---|
static final java.lang.String REV
Method Detail |
---|
void setID(java.lang.String id) throws java.io.IOException, java.lang.UnsupportedOperationException
id
- A name that identifies the document within the repository.
Whether or not this name must be unique depends on the implementation.
java.io.IOException
- Thrown if an error occurred while accessing the document.
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if this operation is not allowed by the implementation, i.e.,
if IDs are assigned to repository documents by some other means.void setSize(long len) throws java.io.IOException, java.lang.UnsupportedOperationException
len
- The size (typically in bytes) of the document data, or -1 if the size is
indeterminate.
java.io.IOException
- Thrown if an error occurred while modifying the document.
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if this operation is not allowed by the implementation, i.e.,
if sizes are assigned to repository documents by some other means.void setProperty(java.lang.String prop, java.lang.Object val) throws java.io.IOException
prop
- The name of the document property to set.val
- The new property value.
java.io.IOException
- Thrown if an error occurred while modifying the document, or
if the document does not have the specified property.void addProperty(DocumentProperty prop) throws java.lang.UnsupportedOperationException, java.io.IOException
prop
- A property to associate with this document.
java.io.IOException
- Thrown if an error occurred while modifying the document.
java.lang.UnsupportedOperationException
- (unchecked)
Thrown if this method is not supported by the implementation of this
interface, i.e., the implementation assigns properties to documents by
some other means.void setDataStream(java.io.InputStream in) throws java.io.IOException
in
- A binary data stream from which the contents of the document are to be
read. The reading occurs when the
RepositoryWriter.storeDocument()
method is called and passed this document object. The stream will be
closed (by calling its close() method) after the data is
completely read from the stream (i.e., its read() method returns
-1). The stream will also be closed (if it is still open) when this
document object's close()
method is called.
java.io.IOException
- Thrown if an error occurred while accessing the document.
java.lang.NullPointerException
- (unchecked)
Thrown if in is null.void doneReading()
This method is called when the
RepositoryWriter.storeDocument()
method is called and passed this document object, once all of the content
data for the document has been read. The input stream is closed (by
calling its close()
method), and then this method is
called. Any other resources associated with this document should then be
deallocated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |