fedora.server.storage
Interface DOReader

All Known Subinterfaces:
BDefReader, BMechReader, DOWriter
All Known Implementing Classes:
SimpleBDefReader, SimpleBMechReader, SimpleDOReader, SimpleDOWriter, SimpleServiceAwareReader

public interface DOReader

Title: DOReader.java

Description: Interface for reading Fedora digital objects from within the storage sub system.

Version:
$Id: DOReader.java 6410 2007-12-14 19:51:22Z cwilper $
Author:
payette@cs.cornell.edu

Method Summary
 java.io.InputStream ExportObject(java.lang.String format, java.lang.String exportContext)
          Gets the content of the entire digital object as XML, with public URIs as references to managed content datastreams under the custodianship of the repository.
 java.util.List<AuditRecord> getAuditRecords()
          Gets the entire list of audit records for the object.
 java.lang.String getContentModelId()
          Gets the content model of the object.
 java.util.Date getCreateDate()
          Gets the date of creation of this object.
 Datastream GetDatastream(java.lang.String datastreamID, java.util.Date versDateTime)
          Gets a particular Datastream in the digital object.
 Datastream getDatastream(java.lang.String datastreamID, java.lang.String versionID)
          Gets a particular datastream in the digital object.
 Datastream[] GetDatastreams(java.util.Date versDateTime, java.lang.String state)
          Gets all datastreams as of a certain date and in a certain state.
 java.util.Date[] getDatastreamVersions(java.lang.String datastreamID)
          Gets the creation dates of all versions of a particular datastream, in no particular order.
 java.lang.String getFedoraObjectTypes()
          Gets the type of fedora object (O=FEDORA_OBJECT, D=FEDORA_BDEF_OBJECT, M=FEDORA_BMECH_OBJECT) this is a handle on.
 java.util.Date getLastModDate()
          Gets the date of the last modification of this object.
 java.lang.String[] getObjectHistory(java.lang.String PID)
          Gets the change history of an object by returning a list of timestamps that correspond to modification dates of components.
 java.lang.String GetObjectLabel()
          Gets the label of the digital object.
 java.lang.String GetObjectPID()
          Gets the PID of the digital object.
 java.lang.String GetObjectState()
          Gets the state of the digital object.
 java.io.InputStream GetObjectXML()
          Gets the content of the entire digital object as XML.
 java.lang.String getOwnerId()
          Gets the userid of the user who owns the objects.
 RelationshipTuple[] getRelationships(java.lang.String relationship)
           
 boolean isFedoraObjectType(int type)
           
 java.lang.String[] ListDatastreamIDs(java.lang.String state)
          Gets a list of Datastream identifiers for all Datastreams in the digital object.
 ObjectMethodsDef[] listMethods(java.util.Date versDateTime)
          Gets list of ALL method definitions that are available on a particular digital object.
 

Method Detail

getFedoraObjectTypes

java.lang.String getFedoraObjectTypes()
                                      throws ServerException
Gets the type of fedora object (O=FEDORA_OBJECT, D=FEDORA_BDEF_OBJECT, M=FEDORA_BMECH_OBJECT) this is a handle on.

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

isFedoraObjectType

boolean isFedoraObjectType(int type)
                           throws ServerException
Throws:
ServerException

getContentModelId

java.lang.String getContentModelId()
                                   throws ServerException
Gets the content model of the object.

Returns:
the content model of the object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getCreateDate

java.util.Date getCreateDate()
                             throws ServerException
Gets the date of creation of this object.

Returns:
the date of creation of this object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getLastModDate

java.util.Date getLastModDate()
                              throws ServerException
Gets the date of the last modification of this object.

Returns:
the date of the last modification of this object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getOwnerId

java.lang.String getOwnerId()
                            throws ServerException
Gets the userid of the user who owns the objects.

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

getAuditRecords

java.util.List<AuditRecord> getAuditRecords()
                                            throws ServerException
Gets the entire list of audit records for the object. Changes to the list affect the underlying object if this is DOWriter.

Returns:
the entire list of audit records for the object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

GetObjectXML

java.io.InputStream GetObjectXML()
                                 throws ServerException
Gets the content of the entire digital object as XML. The object will be returned exactly as it is stored in the repository.

Returns:
the content of the entire digital object as XML.
Throws:
ServerException - If there object could not be found or there was was a failure in accessing the object for any reason.

ExportObject

java.io.InputStream ExportObject(java.lang.String format,
                                 java.lang.String exportContext)
                                 throws ServerException
Gets the content of the entire digital object as XML, with public URIs as references to managed content datastreams under the custodianship of the repository.

The intent of this method is to return the digital object along with valid URI pointers for ALL its datastreams.

Parameters:
format - The XML format to export.
Returns:
the content of the entire digital object as XML, with public URIs for managed content datastreams.
Throws:
ServerException - If there object could not be found or there was was a failure in accessing the object for any reason.

GetObjectPID

java.lang.String GetObjectPID()
                              throws ServerException
Gets the PID of the digital object.

Returns:
the PID of the digital object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

GetObjectLabel

java.lang.String GetObjectLabel()
                                throws ServerException
Gets the label of the digital object.

Returns:
the label of the digital object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

GetObjectState

java.lang.String GetObjectState()
                                throws ServerException
Gets the state of the digital object. The state indicates the status of the digital object at any point in time. Valid states are: A=Active, I=Inactive, D=Deleted

Returns:
the state of the digital object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

ListDatastreamIDs

java.lang.String[] ListDatastreamIDs(java.lang.String state)
                                     throws ServerException
Gets a list of Datastream identifiers for all Datastreams in the digital object. Will take a state parameter to specify that only Datastreams that are in a particular state should be listed (e.g., only active Datastreams with a state value of "A"). If state is given as null, all datastream ids will be returned, regardless of state.

Parameters:
state - The state of the Datastreams to be listed.
Returns:
a list of Datastream identifiers for all Datastreams in the digital object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getDatastreamVersions

java.util.Date[] getDatastreamVersions(java.lang.String datastreamID)
                                       throws ServerException
Gets the creation dates of all versions of a particular datastream, in no particular order.

Parameters:
datastreamID - The datastream identifier
Returns:
the creation dates.
Throws:
ServerException - If any type of error occurred fulfilling the request.

GetDatastreams

Datastream[] GetDatastreams(java.util.Date versDateTime,
                            java.lang.String state)
                            throws ServerException
Gets all datastreams as of a certain date and in a certain state. This iterates through all datastreams in the object and returns only those that existed at the given date/time, and currently have a certain state. If the date/time given is null, the most recent version of each datastream is obtained. If the state is null, all datastreams as of the given time will be returned, regardless of state.

Parameters:
versDateTime - The date-time stamp to get appropriate Datastream versions
state - The state, null for any.
Returns:
all datastreams as of a certain date and in a certain state.
Throws:
ServerException - If any type of error occurred fulfilling the request.

GetDatastream

Datastream GetDatastream(java.lang.String datastreamID,
                         java.util.Date versDateTime)
                         throws ServerException
Gets a particular Datastream in the digital object. If the date given is null, the most recent version of the datastream is given. If the date is non-null, the closest version of the Datastream to the specified date/time (without going over) is given. If no datastreams match the given criteria, null is returned.

Parameters:
datastreamID - The Datastream identifier
versDateTime - The date-time stamp to get appropriate Datastream version
Returns:
a particular Datastream in the digital object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getDatastream

Datastream getDatastream(java.lang.String datastreamID,
                         java.lang.String versionID)
                         throws ServerException
Gets a particular datastream in the digital object. This is an alternative to retrieving a datastream if all that is known is the version id (and not the date). The datastream id and version id must match actual ids of an existing datastream in the object. Otherwise, null will be returned.

Parameters:
datastreamID - The datastream identifier
versionID - The identifier of the particular version
Returns:
a particular Datastream in the digital object
Throws:
ServerException - If any time of error occurred fulfilling the request.

listMethods

ObjectMethodsDef[] listMethods(java.util.Date versDateTime)
                               throws ServerException
Gets list of ALL method definitions that are available on a particular digital object. This is done by reflecting on EACH Disseminator and getting the PID of the behavior mechanism object for that disseminator. The methods are reflected via the behavior mechanism object, which is implementing the methods defined in a particular by a behavior definition.

Parameters:
versDateTime - The date-time stamp to get appropriate version. If this is given as null, the most recent version is used.
Returns:
a list of ALL method definitions that are available on a particular digital object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getObjectHistory

java.lang.String[] getObjectHistory(java.lang.String PID)
                                    throws ServerException

Gets the change history of an object by returning a list of timestamps that correspond to modification dates of components. This currently includes changes to datastreams and disseminators.

Parameters:
PID - The persistent identifier of the digitla object.
Returns:
An Array containing the list of timestamps indicating when changes were made to the object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getRelationships

RelationshipTuple[] getRelationships(java.lang.String relationship)
                                     throws ServerException
Throws:
ServerException