org.fcrepo.server.storage
Interface DOReader

All Known Subinterfaces:
DOWriter, ServiceDefinitionReader, ServiceDeploymentReader
All Known Implementing Classes:
SimpleDOReader, SimpleDOWriter, SimpleServiceAwareReader, SimpleServiceDefinitionReader, SimpleServiceDeploymentReader

public interface DOReader

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

Author:
Sandy Payette

Method Summary
 InputStream Export(String format, 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.
 InputStream ExportObject(String format, String exportContext)
          Deprecated. in Fedora 3.0, use Export() instead
 List<AuditRecord> getAuditRecords()
          Gets the entire list of audit records for the object.
 List<String> getContentModels()
          Gets a list of the content models of the object.
 Date getCreateDate()
          Gets the date of creation of this object.
 Datastream GetDatastream(String datastreamID, Date versDateTime)
          Gets a particular Datastream in the digital object.
 Datastream getDatastream(String datastreamID, String versionID)
          Gets a particular datastream in the digital object.
 Datastream[] GetDatastreams(Date versDateTime, String state)
          Gets all datastreams as of a certain date and in a certain state.
 Date[] getDatastreamVersions(String datastreamID)
          Gets the creation dates of all versions of a particular datastream, in no particular order.
 Date getLastModDate()
          Gets the date of the last modification of this object.
 DigitalObject getObject()
          Gets the underlying digital object this reader is working with.
 String[] getObjectHistory(String PID)
          Gets the change history of an object by returning a list of timestamps that correspond to modification dates of components.
 String GetObjectLabel()
          Gets the label of the digital object.
 String GetObjectPID()
          Gets the PID of the digital object.
 String GetObjectState()
          Gets the state of the digital object.
 InputStream GetObjectXML()
          Gets the content of the entire digital object as XML.
 String getOwnerId()
          Gets the userid of the user who owns the objects.
 Set<RelationshipTuple> getRelationships()
          Get all RELS-EXT and RELS-INT relationships in the object.
 Set<RelationshipTuple> getRelationships(org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Get all matching RELS-EXT relationships in the object, assumes pid is the subject
 Set<RelationshipTuple> getRelationships(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Get all matching RELS-EXT and RELS-INT relationships in the object.
 boolean hasContentModel(org.jrdf.graph.ObjectNode contentModel)
          Determins whether or not the object have the given uri as a content model.
 boolean hasRelationship(org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Determine if the object contains the given relationship, assumes pid as the subject.
 boolean hasRelationship(org.jrdf.graph.SubjectNode subject, org.jrdf.graph.PredicateNode predicate, org.jrdf.graph.ObjectNode object)
          Determine if the object contains the given relationship.
 String[] ListDatastreamIDs(String state)
          Gets a list of Datastream identifiers for all Datastreams in the digital object.
 ObjectMethodsDef[] listMethods(Date versDateTime)
          Gets list of ALL method definitions that are available on a particular digital object.
 

Method Detail

getObject

DigitalObject getObject()
Gets the underlying digital object this reader is working with.


getCreateDate

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

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

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

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

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.

Export

InputStream Export(String format,
                   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 format to export the object in. If null or "default", will use the repository's configured default export format.
exportContext - The use case for export (public, migrate, archive) which results in different ways of representing datastream URLs or datastream content in the output.
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.
See Also:
DOTranslationUtility.SERIALIZE_EXPORT_PUBLIC, DOTranslationUtility.SERIALIZE_EXPORT_MIGRATE, DOTranslationUtility.SERIALIZE_EXPORT_ARCHIVE

ExportObject

@Deprecated
InputStream ExportObject(String format,
                                    String exportContext)
                         throws ServerException
Deprecated. in Fedora 3.0, use Export() instead

Throws:
ServerException

GetObjectPID

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

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

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.

getContentModels

List<String> getContentModels()
                              throws ServerException
Gets a list of the content models of the object. The strings will be of the format "info:fedora/PID"

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

hasContentModel

boolean hasContentModel(org.jrdf.graph.ObjectNode contentModel)
                        throws ServerException
Determins whether or not the object have the given uri as a content model.

Parameters:
contentModel - The object node of the content model
Returns:
true if the object have the content model.
Throws:
ServerException

ListDatastreamIDs

String[] ListDatastreamIDs(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

Date[] getDatastreamVersions(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(Date versDateTime,
                            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(String datastreamID,
                         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(String datastreamID,
                         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(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 service deployment object for that disseminator. The methods are reflected via the service deployment 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

String[] getObjectHistory(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.

hasRelationship

boolean hasRelationship(org.jrdf.graph.SubjectNode subject,
                        org.jrdf.graph.PredicateNode predicate,
                        org.jrdf.graph.ObjectNode object)
                        throws ServerException
Determine if the object contains the given relationship.

Parameters:
subject - Subject of the relationship, or null if unspecified (will match any).
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
true if the object
Throws:
ServerException - If any type of error occurred fulfilling the request.

hasRelationship

boolean hasRelationship(org.jrdf.graph.PredicateNode predicate,
                        org.jrdf.graph.ObjectNode object)
                        throws ServerException
Determine if the object contains the given relationship, assumes pid as the subject.

Parameters:
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
true if the object
Throws:
ServerException - If any type of error occurred fulfilling the request.

getRelationships

Set<RelationshipTuple> getRelationships()
                                        throws ServerException
Get all RELS-EXT and RELS-INT relationships in the object.

Returns:
All RELS-EXT and RELS-INT relationships in the object
Throws:
ServerException - If any type of error occurred fulfilling the request.

getRelationships

Set<RelationshipTuple> getRelationships(org.jrdf.graph.SubjectNode subject,
                                        org.jrdf.graph.PredicateNode predicate,
                                        org.jrdf.graph.ObjectNode object)
                                        throws ServerException
Get all matching RELS-EXT and RELS-INT relationships in the object.

Parameters:
subject - Subject of the relationship, or null if unspecified (will match any).
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
All matching relationships in the object
Throws:
ServerException - If any type of error occurred fulfilling the request.

getRelationships

Set<RelationshipTuple> getRelationships(org.jrdf.graph.PredicateNode predicate,
                                        org.jrdf.graph.ObjectNode object)
                                        throws ServerException
Get all matching RELS-EXT relationships in the object, assumes pid is the subject

Parameters:
predicate - Predicate of the relationship, or null if unspecified (will match any).
object - Object (target) of the relationship, or null if unspecified (will match any).
Returns:
All matching relationships in the object
Throws:
ServerException - If any type of error occurred fulfilling the request.


Copyright © 2011 DuraSpace. All Rights Reserved.