fedora.server.storage
Interface DOWriter

All Superinterfaces:
DOReader
All Known Implementing Classes:
SimpleDOWriter

public interface DOWriter
extends DOReader

Title: DOWriter.java

Description: 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.

Call save() to save changes while working with a DOWriter, where the DOWriter handle may be lost but the changes need to be remembered.

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

Version:
$Id: DOWriter.java 5351 2006-12-07 13:04:02Z rlw $
Author:
cwilper@cs.cornell.edu

Method Summary
 void addDatastream(Datastream datastream, boolean addNewVersion)
          Adds a datastream to the object.
 void addDisseminator(Disseminator disseminator)
          Adds a disseminator to the object.
 void commit(java.lang.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.
 java.lang.String newAuditRecordID()
          Generate a unique id for an audit record.
 java.lang.String newDatastreamBindingMapID()
          Generate a unique id for a datastreamBindingMap.
 java.lang.String newDatastreamID()
          Generate a unique id for a datastream.
 java.lang.String newDatastreamID(java.lang.String dsID)
          Generate a unique id for a datastream version.
 java.lang.String newDisseminatorID()
          Generate a unique id for a disseminator.
 java.lang.String newDisseminatorID(java.lang.String dissID)
          Generate a unique id for a disseminator version.
 void remove()
          Removes the entire digital object.
 java.util.Date[] removeDatastream(java.lang.String id, java.util.Date start, java.util.Date end)
          Removes a range of datastream versions from an object without leaving anything behind.
 java.util.Date[] removeDisseminator(java.lang.String id, java.util.Date start, java.util.Date end)
          Removes a range of disseminator versions from an object without leaving anything behind.
 void setDatastreamState(java.lang.String id, java.lang.String state)
          Sets the state for all versions of the specified datastream.
 void setDatastreamVersionable(java.lang.String id, boolean versionable)
          Sets the indicator as to whether the datastream is subject to versioning.
 void setDisseminatorState(java.lang.String id, java.lang.String state)
          Sets the state for all versions of the specified disseminator.
 void setLabel(java.lang.String label)
          Sets the label of the digital object.
 void setOwnerId(java.lang.String ownerId)
          Sets the ownerId for the digital object.
 void setState(java.lang.String state)
          Sets the state of the entire digital object.
 
Methods inherited from interface fedora.server.storage.DOReader
ExportObject, getAuditRecords, GetBehaviorDefs, getContentModelId, getCreateDate, GetDatastream, getDatastream, GetDatastreams, getDatastreamVersions, getDisseminationBindingInfo, GetDisseminator, GetDisseminators, getDisseminatorVersions, GetDSBindingMaps, getFedoraObjectType, getLastModDate, getObjectHistory, GetObjectLabel, getObjectMethodParms, GetObjectPID, GetObjectState, GetObjectXML, getOwnerId, ListDatastreamIDs, ListDisseminatorIDs, listMethods, listMethods
 

Method Detail

setState

void setState(java.lang.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(java.lang.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(java.lang.String id,
                        java.lang.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(java.lang.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.

setDisseminatorState

void setDisseminatorState(java.lang.String id,
                          java.lang.String state)
                          throws ServerException
Sets the state for all versions of the specified disseminator.

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

setLabel

void setLabel(java.lang.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.

addDisseminator

void addDisseminator(Disseminator disseminator)
                     throws ServerException
Adds a disseminator to the object.

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

removeDatastream

java.util.Date[] removeDatastream(java.lang.String id,
                                  java.util.Date start,
                                  java.util.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.

removeDisseminator

java.util.Date[] removeDisseminator(java.lang.String id,
                                    java.util.Date start,
                                    java.util.Date end)
                                    throws ServerException
Removes a range of disseminator 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(java.lang.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

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


newDatastreamID

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


newDisseminatorID

java.lang.String newDisseminatorID()
Generate a unique id for a disseminator.


newDisseminatorID

java.lang.String newDisseminatorID(java.lang.String dissID)
Generate a unique id for a disseminator version.


newDatastreamBindingMapID

java.lang.String newDatastreamBindingMapID()
Generate a unique id for a datastreamBindingMap.


newAuditRecordID

java.lang.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.