org.fcrepo.server.storage
Interface DOWriter

All Superinterfaces:
DOReader
All Known Implementing Classes:
SimpleDOWriter

public interface DOWriter
extends DOReader

The standard interface for write operations on a digital object.

A DOWriter instance is a handle on a Fedora digital object, and is obtained via a getWriter(String) call on a DOManager.

Work with a DOWriter ends with either commit() or cancel().

Author:
Chris Wilper

Method Summary
 void addDatastream(Datastream datastream, boolean addNewVersion)
          Adds a datastream to the object.
 boolean addRelationship(String subject, String relationship, String object, boolean isLiteral, String datatype)
          Adds a RDF triple to a reserved datastream (based on the subject)
 boolean addRelationship(String dsId, String subject, String relationship, String object, boolean isLiteral, String datatype)
          Adds a RDF triple to the specified (RDF) datastream
 void commit(String logMessage)
          Saves the changes thus far to the permanent copy of the digital object.
 void invalidate()
          Marks this DOWriter handle invalid (unusable).
 boolean isCommitted()
          Marks whether the object has been successfully committed.
 boolean isNew()
          Marks whether the object is new.
 String newAuditRecordID()
          Generate a unique id for an audit record.
 String newDatastreamID()
          Generate a unique id for a datastream.
 String newDatastreamID(String dsID)
          Generate a unique id for a datastream version.
 boolean purgeRelationship(String subject, String relationship, String object, boolean isLiteral, String datatype)
          Purges a RDF triple from a reserved datastream (based on the subject)
 boolean purgeRelationship(String dsId, String subject, String relationship, String object, boolean isLiteral, String datatype)
          Purges a RDF triple from the specified (RDF) datastream
 void remove()
          Removes the entire digital object.
 Date[] removeDatastream(String id, Date start, Date end)
          Removes a range of datastream versions from an object without leaving anything behind.
 void setDatastreamState(String id, String state)
          Sets the state for all versions of the specified datastream.
 void setDatastreamVersionable(String id, boolean versionable)
          Sets the indicator as to whether the datastream is subject to versioning.
 void setLabel(String label)
          Sets the label of the digital object.
 void setOwnerId(String ownerId)
          Sets the ownerId for the digital object.
 void setState(String state)
          Sets the state of the entire digital object.
 
Methods inherited from interface org.fcrepo.server.storage.DOReader
Export, ExportObject, getAuditRecords, getContentModels, getCreateDate, GetDatastream, getDatastream, GetDatastreams, getDatastreamVersions, getLastModDate, getObject, getObjectHistory, GetObjectLabel, GetObjectPID, GetObjectState, GetObjectXML, getOwnerId, getRelationships, getRelationships, getRelationships, hasContentModel, hasRelationship, hasRelationship, ListDatastreamIDs, listMethods
 

Method Detail

setState

void setState(String state)
              throws ServerException
Sets the state of the entire digital object.

Parameters:
state - The state.
Throws:
ServerException - If any type of error occurred fulfilling the request.

setOwnerId

void setOwnerId(String ownerId)
                throws ServerException
Sets the ownerId for the digital object.

Parameters:
ownerId - The ownerId.
Throws:
ServerException - If any type of error occurred fulfilling the request.

setDatastreamState

void setDatastreamState(String id,
                        String state)
                        throws ServerException
Sets the state for all versions of the specified datastream.

Parameters:
id - The datastream id.
state - The state.
Throws:
ServerException - If any type of error occurred fulfilling the request.

setDatastreamVersionable

void setDatastreamVersionable(String id,
                              boolean versionable)
                              throws ServerException
Sets the indicator as to whether the datastream is subject to versioning. In Fedora 2.0, the system will not operate on this indicator and all datastreams will be versioned by default.

Parameters:
id - The datastream id.
versionable - a boolean indicating if versionable
Throws:
ServerException - If any type of error occurred fulfilling the request.

setLabel

void setLabel(String label)
              throws ServerException
Sets the label of the digital object.

Parameters:
label - The label.
Throws:
ServerException - If any type of error occurred fulfilling the request.

remove

void remove()
            throws ServerException
Removes the entire digital object.

Throws:
ServerException - If any type of error occurred fulfilling the request.

addDatastream

void addDatastream(Datastream datastream,
                   boolean addNewVersion)
                   throws ServerException
Adds a datastream to the object.

Parameters:
datastream - The datastream.
Throws:
ServerException - If any type of error occurred fulfilling the request.

removeDatastream

Date[] removeDatastream(String id,
                        Date start,
                        Date end)
                        throws ServerException
Removes a range of datastream versions from an object without leaving anything behind. If any integrity checks need to be done, they should be done outside of this code.

Parameters:
id - The id of the datastream.
start - The start date (inclusive) of versions to remove. If null, this is taken to be the smallest possible value.
end - The end date (inclusive) of versions to remove. If null, this is taken to be the greatest possible value.
Throws:
ServerException - If any type of error occurred fulfilling the request.

commit

void commit(String logMessage)
            throws ServerException
Saves the changes thus far to the permanent copy of the digital object.

Parameters:
logMessage - An explanation of the change(s).
Throws:
ServerException - If any type of error occurred fulfilling the request.

invalidate

void invalidate()
Marks this DOWriter handle invalid (unusable).


newDatastreamID

String newDatastreamID()
Generate a unique id for a datastream.


newDatastreamID

String newDatastreamID(String dsID)
Generate a unique id for a datastream version.


newAuditRecordID

String newAuditRecordID()
Generate a unique id for an audit record.


isCommitted

boolean isCommitted()
Marks whether the object has been successfully committed.


isNew

boolean isNew()
Marks whether the object is new.


addRelationship

boolean addRelationship(String subject,
                        String relationship,
                        String object,
                        boolean isLiteral,
                        String datatype)
                        throws ServerException
Adds a RDF triple to a reserved datastream (based on the subject)

Throws:
ServerException

addRelationship

boolean addRelationship(String dsId,
                        String subject,
                        String relationship,
                        String object,
                        boolean isLiteral,
                        String datatype)
                        throws ServerException
Adds a RDF triple to the specified (RDF) datastream

Throws:
ServerException

purgeRelationship

boolean purgeRelationship(String subject,
                          String relationship,
                          String object,
                          boolean isLiteral,
                          String datatype)
                          throws ServerException
Purges a RDF triple from a reserved datastream (based on the subject)

Throws:
ServerException

purgeRelationship

boolean purgeRelationship(String dsId,
                          String subject,
                          String relationship,
                          String object,
                          boolean isLiteral,
                          String datatype)
                          throws ServerException
Purges a RDF triple from the specified (RDF) datastream

Throws:
ServerException


Copyright © 2011 DuraSpace. All Rights Reserved.