|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfedora.server.storage.FastDOReader
public class FastDOReader
Title: FastDOReader.java
Description: Digital Object Reader that accesses objects located in the "Fast" storage area. To enhance performance of disseminations, there are two distinct storage areas for digital objects:
This reader is designed to read objects from the "Fast" storage area that
is implemented as a relational database. If the object cannot be found in
the relational database, this reader will attempt to read the object
from the Definitive storage area using the appropriate definitive reader.
When the object exists in both storage areas, preference is given to the
Fast storage area since this reader is designed to read primarily from the
Fast Storage area. SimpleDODOReader
should always be used to read the authoritative version of an object.
Note that versioning is not implemented in Phase 1. Methods in
FastDOReader that contain arguments related to versioning date
such as versDateTime or asOfDate will be ignored
in Phase 1.
| Field Summary | |
|---|---|
protected static ConnectionPool |
connectionPool
Database ConnectionPool instance |
protected DOReader |
definitiveDOReader
Instance of DOReader... |
protected java.lang.String |
doLabel
Label of the digital object. |
protected static java.lang.String |
fedoraServerHost
Host name of the Fedora server |
protected static java.lang.String |
fedoraServerPort
Port number on which the Fedora server is running. |
protected boolean |
isFoundInDefinitiveStore
signals object found in definitive storage area |
protected boolean |
isFoundInFastStore
Signals object found in fast storage area |
protected Context |
m_context
|
protected static DOManager |
m_manager
Current Fedora server DOManager instance |
protected java.lang.String |
PID
Persistent identifier of the digital object. |
protected static Server |
s_server
Fedora server instance |
| Constructor Summary | |
|---|---|
FastDOReader(Context context,
java.lang.String objectPID)
Constructs a new FastDOReader for the specified digital
object. |
|
| Method Summary | |
|---|---|
java.io.InputStream |
ExportObject(java.lang.String format,
java.lang.String exportContext)
Exports the object. |
java.util.List<AuditRecord> |
getAuditRecords()
Gets the entire list of audit records for the object. |
java.lang.String[] |
GetBehaviorDefs(java.util.Date versDateTime)
Gets a list of Behavior Definition object PIDs associated with the specified digital 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 datastream specified by the datastream ID. |
Datastream |
getDatastream(java.lang.String dsID,
java.lang.String versionID)
Gets a particular datastream in the digital object. |
Datastream[] |
GetDatastreams(java.util.Date versDateTime,
java.lang.String state)
Gets all the datastreams of a digital object. |
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)
Gets a disseminator with the specified ID. |
Disseminator[] |
GetDisseminators(java.util.Date versDateTime,
java.lang.String state)
Gets all disseminators of the specified object. |
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 requested object. |
MethodParmDef[] |
getObjectMethodParms(java.lang.String bDefPID,
java.lang.String methodName,
java.util.Date versDateTime)
Gets method parameters associated with the specified method name. |
java.lang.String |
GetObjectPID()
Gets the persistent identifier or PID of the digital object. |
java.lang.String |
GetObjectState()
Gets the state on a digital object |
java.io.InputStream |
GetObjectXML()
Gets the XML representation of the object. |
java.lang.String |
getOwnerId()
Gets the userid of the user who owns the objects. |
java.lang.String[] |
ListDatastreamIDs(java.lang.String state)
Lists the datastream IDs of the requested object having the specified state. |
java.lang.String[] |
ListDisseminatorIDs(java.lang.String state)
Gets a list of disseminator IDs. |
ObjectMethodsDef[] |
listMethods(java.util.Date versDateTime)
Gets all methods associated with the specified digital object. |
MethodDef[] |
listMethods(java.lang.String bDefPID,
java.util.Date versDateTime)
Gets all method defintiions associated with the specified Behavior Mechanism. |
java.lang.String |
locatePID(java.lang.String PID)
Locates the specified digital object using its persitent identifier. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static ConnectionPool connectionPool
protected static Server s_server
protected static DOManager m_manager
protected boolean isFoundInFastStore
protected boolean isFoundInDefinitiveStore
protected java.lang.String doLabel
protected java.lang.String PID
protected DOReader definitiveDOReader
protected static java.lang.String fedoraServerHost
protected static java.lang.String fedoraServerPort
protected Context m_context
| Constructor Detail |
|---|
public FastDOReader(Context context,
java.lang.String objectPID)
throws ServerException
Constructs a new FastDOReader for the specified digital
object. It initializes the database connection for JDBC access to the
relational database and verifies existence of the specified object. If
the object is found, this constructor initializes the class variables for
PID and doLabel.
context - The context of this request.objectPID - The persistent identifier of the digital object.
ServerException - If any type of error occurred fulfilling the
request.| Method Detail |
|---|
public java.io.InputStream ExportObject(java.lang.String format,
java.lang.String exportContext)
throws StreamIOException,
GeneralException
Exports the object. Since the XML representation of an object is
not stored in the Fast storage area, this method always queries the
Definitive storage area using SimpleDOReader.
ExportObject in interface DOReaderformat - The XML format to export (e.g., foxml1.0, metslikefedora1)exportContext - The use case for export (public, migrate, archive)
which results in different ways of representing
datastream URLs or datastream content in the output.
StreamIOException - If there is a problem in getting the XML input
stream.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public java.lang.String getContentModelId()
throws ServerException
DOReader
getContentModelId in interface DOReaderServerException - If any type of error occurred fulfilling the
request.
public java.lang.String getFedoraObjectType()
throws ServerException
DOReader
getFedoraObjectType in interface DOReaderServerException - If any type of error occurred fulfilling the
request.
public java.util.Date getCreateDate()
throws ServerException
DOReader
getCreateDate in interface DOReaderServerException - If any type of error occurred fulfilling the
request.
public java.util.Date getLastModDate()
throws ServerException
DOReader
getLastModDate in interface DOReaderServerException - If any type of error occurred fulfilling the
request.
public java.lang.String[] GetBehaviorDefs(java.util.Date versDateTime)
throws GeneralException
Gets a list of Behavior Definition object PIDs associated with the specified digital object.
GetBehaviorDefs in interface DOReaderversDateTime - The versioning datetime stamp.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public MethodParmDef[] getObjectMethodParms(java.lang.String bDefPID,
java.lang.String methodName,
java.util.Date versDateTime)
throws GeneralException
Gets method parameters associated with the specified method name.
getObjectMethodParms in interface DOReaderbDefPID - The persistent identifer of Behavior Definition object.methodName - The name of the method.versDateTime - The versioning datetime stamp.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public MethodDef[] listMethods(java.lang.String bDefPID,
java.util.Date versDateTime)
throws GeneralException
Gets all method defintiions associated with the specified Behavior Mechanism. Note the PID of the associated Behavior Mechanism object is determined via reflection based on the specified PID of the digital object and the PID of its Behavior Definition object. This method retrieves the list of available methods based on the assocaited Behavior Mechanism object and NOT the Behavior Definition object. This is done to insure that only methods that have been implemented in the mechanism are returned. This distinction is only important when versioning is enabled in a later release. When versioning is enabled, it is possible that a versioned Behavior Definition may have methods that have not yet been implemented by all of its associated Behavior Mechanisms. In such a case, only those methods implemented in the mechanism will be returned.
listMethods in interface DOReaderbDefPID - The persistent identifier of Behavior Definition object.versDateTime - The versioning datetime stamp.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public Datastream GetDatastream(java.lang.String datastreamID,
java.util.Date versDateTime)
throws GeneralException
Gets a datastream specified by the datastream ID.
GetDatastream in interface DOReaderdatastreamID - The identifier of the requested datastream.versDateTime - The versioning datetime stamp.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public Datastream[] GetDatastreams(java.util.Date versDateTime,
java.lang.String state)
throws GeneralException
Gets all the datastreams of a digital object.
GetDatastreams in interface DOReaderversDateTime - The versioning datetime stamp.state - The state of the datastreams to get, null if any.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public Datastream getDatastream(java.lang.String dsID,
java.lang.String versionID)
throws GeneralException
DOReader
getDatastream in interface DOReaderdsID - The datastream identifierversionID - The identifier of the particular version
GeneralException
public java.util.Date[] getDatastreamVersions(java.lang.String datastreamID)
throws ServerException
DOReader
getDatastreamVersions in interface DOReaderdatastreamID - The datastream identifier
ServerException - If any type of error occurred fulfilling the
request.
public java.util.Date[] getDisseminatorVersions(java.lang.String dissID)
throws ServerException
DOReader
getDisseminatorVersions in interface DOReaderdissID - The disseminator identifier
ServerException - If any type of error occurred fulfilling the
request.
public DisseminationBindingInfo[] getDisseminationBindingInfo(java.lang.String bDefPID,
java.lang.String methodName,
java.util.Date versDateTime)
throws GeneralException
getDisseminationBindingInfo in interface DOReaderbDefPID - The identifier for behavior definition object.methodName - The name of the method.versDateTime - The versioning DateTime stamp.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public Disseminator GetDisseminator(java.lang.String disseminatorID,
java.util.Date versDateTime)
throws GeneralException
Gets a disseminator with the specified ID.
GetDisseminator in interface DOReaderdisseminatorID - the identifier of the requested disseminatorversDateTime - versioning datetime stamp
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public Disseminator[] GetDisseminators(java.util.Date versDateTime,
java.lang.String state)
throws GeneralException
Gets all disseminators of the specified object.
GetDisseminators in interface DOReaderversDateTime - versioning datetime stampstate - The state of disseminators to be retrieved.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public DSBindingMapAugmented[] GetDSBindingMaps(java.util.Date versDateTime)
throws GeneralException
Gets datastream binding map.
GetDSBindingMaps in interface DOReaderversDateTime - versioning datetime stamp
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public java.lang.String GetObjectLabel()
throws GeneralException
Gets the label of the requested object.
GetObjectLabel in interface DOReaderGeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public ObjectMethodsDef[] listMethods(java.util.Date versDateTime)
throws GeneralException
Gets all methods associated with the specified digital object. If the
object is found, an array of ObjectMethodsDef is returned.
If the object cannot be found in the relational database, the method
attempts to find the object in the Definitive storage area. If the object
cannot be found, ObjectNotFoundException is thrown.
listMethods in interface DOReaderversDateTime - The versioning datetime stamp.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public java.lang.String GetObjectPID()
throws GeneralException
Gets the persistent identifier or PID of the digital object.
GetObjectPID in interface DOReaderGeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public java.lang.String GetObjectState()
throws GeneralException
Gets the state on a digital object
GetObjectState in interface DOReaderGeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public java.lang.String[] getObjectHistory(java.lang.String PID)
throws GeneralException
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.
getObjectHistory in interface DOReaderPID - The persistent identifier of the digitla object.
GeneralException - If any type of error occurred fulfilling the
request.
public java.lang.String getOwnerId()
throws ServerException,
StorageDeviceException,
ObjectNotFoundException
DOReader
getOwnerId in interface DOReaderServerException - If any type of error occurred fulfilling the
request.
StorageDeviceException
ObjectNotFoundException
public java.util.List<AuditRecord> getAuditRecords()
throws ServerException,
StorageDeviceException,
ObjectNotFoundException
DOReader
getAuditRecords in interface DOReaderServerException - If any type of error occurred fulfilling the
request.
StorageDeviceException
ObjectNotFoundException
public java.io.InputStream GetObjectXML()
throws StreamIOException,
GeneralException
Gets the XML representation of the object. Since the XML representation
of an object is not stored in the Fast storage area, this method always
queries the Definitive storage area using DefinitveDOReader.
GetObjectXML in interface DOReaderGeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
StreamIOException - If there was a failure in accessing the object
for any IO reason during retrieval of the object from low-level
storage. Extends ServerException.
public java.lang.String[] ListDatastreamIDs(java.lang.String state)
throws GeneralException
Lists the datastream IDs of the requested object having the
specified state. Note that the Fast storage area does NOT
contain state information so state is ignored when querying the Fast
storage area. DefinitiveDOReader should be used instead
to list datastream IDs with a given state.
ListDatastreamIDs in interface DOReaderstate - State of the datastreams.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public java.lang.String[] ListDisseminatorIDs(java.lang.String state)
throws GeneralException
DefinitiveDOReader should be used to list disseminator IDs
when state is specified.
ListDisseminatorIDs in interface DOReaderstate - State of the disseminators.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
public java.lang.String locatePID(java.lang.String PID)
throws GeneralException,
ServerException
Locates the specified digital object using its persitent identifier.
This method will first attempt to locate the object in the Fast storage
area. If the the object cannot be located there, it will then try to find
it in the Definitive strorage area. If the object is found, the object's
label is returned. Otherwise, it throws
ObjectNotFoundException.
PID - persistent identifier of the digital object.
GeneralException - If there was any misc exception that we want to
catch and re-throw as a Fedora exception. Extends ServerException.
ServerException - If any type of error occurred fulfilling the
request.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||