fedora.server.storage
Interface DOReader

All Known Subinterfaces:
BDefReader, BMechReader, DOWriter
All Known Implementing Classes:
FastBdefReader, FastBmechReader, FastDOReader, 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 5166 2006-10-25 11:05:45Z eddie $
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[] GetBehaviorDefs(java.util.Date versDateTime)
          Gets PIDs of Behavior Definitions to which object subscribes.
 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.
 DisseminationBindingInfo[] getDisseminationBindingInfo(java.lang.String bDefPID, java.lang.String methodName, java.util.Date versDateTime)
          Gets the dissemination binding info necessary to perform a particular dissemination.
 Disseminator GetDisseminator(java.lang.String disseminatorID, java.util.Date versDateTime)
          Same as getDatastream, but for disseminators.
 Disseminator[] GetDisseminators(java.util.Date versDateTime, java.lang.String state)
          Same as getDatastreams, but for disseminators.
 java.util.Date[] getDisseminatorVersions(java.lang.String dissID)
          Gets the creation dates of all versions of a particular disseminator, in no particular order.
 DSBindingMapAugmented[] GetDSBindingMaps(java.util.Date versDateTime)
          Gets datastream binding map.
 java.lang.String getFedoraObjectType()
          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.
 MethodParmDef[] getObjectMethodParms(java.lang.String bDefPID, java.lang.String methodName, java.util.Date versDateTime)
          Gets list of method parameter definitions that are available on a particular method.
 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.
 java.lang.String[] ListDatastreamIDs(java.lang.String state)
          Gets a list of Datastream identifiers for all Datastreams in the digital object.
 java.lang.String[] ListDisseminatorIDs(java.lang.String state)
          Same as listDatastreamIds, but for disseminators.
 ObjectMethodsDef[] listMethods(java.util.Date versDateTime)
          Gets list of ALL method definitions that are available on a particular digital object.
 MethodDef[] listMethods(java.lang.String bDefPID, java.util.Date versDateTime)
          Gets list of method definitions that are available on a particular Disseminator.
 

Method Detail

getFedoraObjectType

java.lang.String getFedoraObjectType()
                                     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.

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 (e.g., foxml1.0, metslikefedora1)
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.

getDisseminatorVersions

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

Parameters:
dissID - The disseminator 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.

GetDisseminators

Disseminator[] GetDisseminators(java.util.Date versDateTime,
                                java.lang.String state)
                                throws ServerException
Same as getDatastreams, but for disseminators.

Parameters:
versDateTime - The date-time stamp to get appropriate Disseminator version
state - The state of the disseminator.
Returns:
all Disseminators as of a certain date.
Throws:
ServerException - If any type of error occurred fulfilling the request.

ListDisseminatorIDs

java.lang.String[] ListDisseminatorIDs(java.lang.String state)
                                       throws ServerException
Same as listDatastreamIds, but for disseminators.

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

GetDisseminator

Disseminator GetDisseminator(java.lang.String disseminatorID,
                             java.util.Date versDateTime)
                             throws ServerException
Same as getDatastream, but for disseminators.

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

GetBehaviorDefs

java.lang.String[] GetBehaviorDefs(java.util.Date versDateTime)
                                   throws ServerException
Gets PIDs of Behavior Definitions to which object subscribes. This is done by looking at all the Disseminators for the object, and reflecting on what Behavior Definitions objects the Disseminators refer to. The given date is used to query for disseminators. The disseminators as they existed during the given date are used. If the date is given as null, the most recent version of each disseminator is used.

Parameters:
versDateTime - The date-time stamp to get appropriate version
Returns:
a list of PIDs of Behavior Definitions to which object subscribes.
Throws:
ServerException - If any type of error occurred fulfilling the request.

listMethods

MethodDef[] listMethods(java.lang.String bDefPID,
                        java.util.Date versDateTime)
                        throws ServerException
Gets list of method definitions that are available on a particular Disseminator. This is done by reflecting on the Disseminator that subscribes to the Behavior Definition that is specified in the method input parameter. Then, by reflecting on that Disseminator, the PID of the Behavior Mechanism object can be obtained. Finally, method implementation information can be found in the Behavior Mechanism object to which that Disseminator refers.

Parameters:
bDefPID - The PID of a Behavior Definition to which the object subscribes. If this is the special bootstrap bdef, this method returns null.
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 method definitions that are available on a particular Disseminator.
Throws:
ServerException - If any type 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.

getObjectMethodParms

MethodParmDef[] getObjectMethodParms(java.lang.String bDefPID,
                                     java.lang.String methodName,
                                     java.util.Date versDateTime)
                                     throws ServerException
Gets list of method parameter definitions that are available on a particular method. This is done by reflecting on the Disseminator that subscribes to the Behavior Definition that is specified in the method input parameter. Then, by reflecting on that Disseminator, the PID of the Behavior Mechanism object can be obtained. Finally, method implementation information can be found in the Behavior Mechanism object to which that Disseminator refers.

Parameters:
bDefPID - The PID of a Behavior Definition to which the object subscribes. If this is the special bootstrap bdef, this method returns null.
methodName - The name of the method.
versDateTime - The date-time stamp to get appropriate version
Returns:
a list of method parameter definitions that are available on a particular method.
Throws:
ServerException - If any type of error occurred fulfilling the request.

GetDSBindingMaps

DSBindingMapAugmented[] GetDSBindingMaps(java.util.Date versDateTime)
                                         throws ServerException
Gets datastream binding map.

Parameters:
versDateTime - versioning datetime stamp
Returns:
DSBindingMapAugmented[] array of datastream binding maps
Throws:
ServerException - If anything went wrong

getDisseminationBindingInfo

DisseminationBindingInfo[] getDisseminationBindingInfo(java.lang.String bDefPID,
                                                       java.lang.String methodName,
                                                       java.util.Date versDateTime)
                                                       throws ServerException
Gets the dissemination binding info necessary to perform a particular dissemination.

Parameters:
bDefPID - the behavior definition pid
methodName - the method name
versDateTime - versioning datetime stamp
Returns:
the dissemination binding info necessary to perform a particular dissemination.
Throws:
ServerException - If anything went wrong

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.