fedora.server.storage
Class FastBdefReader

java.lang.Object
  extended by fedora.server.storage.FastDOReader
      extended by fedora.server.storage.FastBdefReader
All Implemented Interfaces:
BDefReader, DOReader

public class FastBdefReader
extends FastDOReader
implements BDefReader

Title: FastBdefReader.java

Description: BDEF Object Reader that accesses objects located in the "Fast" storage area. It mirrors the functionality of SimpleBDefReader for the "Definitive" storage area. To enhance performance of disseminations, there are two distinct storage areas for digital objects:

  1. "Fast" storage area - The storage area containing a subset of digital objects that is optimized for performance. Both the composition of the subset of objects and storage area are implementation specific. For Phase 1, this object subset consists of a partial replication of the most current version of each object and is used as the primary source for resolving dissemination requests. The replication is partial since only information required to disseminate the object is replicated in the Fast storage area. For Phase 1, the Fast storage area is implemented as a relational database that is accessed via JDBC. Note that an appropriate definitve reader should always be used to obtain the most complete information about a specific object. A fast reader is used primarily for dissemination requests..
  2. Definitive storage area - The storage area containing complete information on all digital objects in the repository. This storage area is used as the authoritative source for reading complete information about a digital object. This storage area is used as a secondary source for resolving dissemination requests when the specified object does not exist in the Fast storage area.

This reader is designed to read bdef 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. A SimpleBDefReader should always be used to read the authoritative version of a bdef object.

Note that versioning is not implemented in Phase 1. Methods in FastBdefReader that contain arguments related to versioning date such as versDateTime or asOfDate will be ignored in Phase 1.

Version:
$Id: FastBdefReader.java 5218 2006-11-20 05:10:11Z cwilper $
Author:
rlw@virginia.edu

Field Summary
 
Fields inherited from class fedora.server.storage.FastDOReader
connectionPool, definitiveDOReader, doLabel, fedoraServerHost, fedoraServerPort, isFoundInDefinitiveStore, isFoundInFastStore, m_context, m_manager, PID, s_server
 
Constructor Summary
FastBdefReader(Context context, java.lang.String objectPID)
          Constructs an instance of FastBdefReader.
 
Method Summary
 MethodParmDef[] getAbstractMethodParms(java.lang.String methodName, java.util.Date versDateTime)
          Gets user method parameters associated with the specified method name.
 MethodDef[] getAbstractMethods(java.util.Date versDateTime)
          This method retrieves the list of available methods based on Behavior Definition object.
 java.io.InputStream getAbstractMethodsXML(java.util.Date versDateTime)
          Gets XML containing method definitions.
 java.lang.String locateBdefPID(java.lang.String bDefPID)
          Locates the specified bdef object using its persistent identifier.
 
Methods inherited from class fedora.server.storage.FastDOReader
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, locatePID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Constructor Detail

FastBdefReader

public FastBdefReader(Context context,
                      java.lang.String objectPID)
               throws ServerException

Constructs an instance of FastBdefReader.

Constructs a new FastBdefReader for the specified bdef object. If the object is found, this constructor initializes the class variables for bDefPID and bDefLabel.

Parameters:
context - The context of this request.
objectPID - The persistent identifier of the bdef object.
Throws:
ServerException - If any type of error occurred fulfilling the request.
Method Detail

getAbstractMethods

public MethodDef[] getAbstractMethods(java.util.Date versDateTime)
                               throws ServerException

This method retrieves the list of available methods based on Behavior Definition object.

Specified by:
getAbstractMethods in interface BDefReader
Parameters:
versDateTime - The versioning datetime stamp.
Returns:
An array of method definitions.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getAbstractMethodsXML

public java.io.InputStream getAbstractMethodsXML(java.util.Date versDateTime)
                                          throws ServerException

Gets XML containing method definitions. Since the XML representation of digital objects is not stored in the Fast storage area, this method uses a BDefReader to query the Definitive storage area.

Specified by:
getAbstractMethodsXML in interface BDefReader
Parameters:
versDateTime - The versioning datetime stamp.
Returns:
A stream of bytes containing XML-encoded representation of method definitions from XML in the Behavior Definition object.
Throws:
ServerException - If any type of error occurred fulfilling the request.

getAbstractMethodParms

public MethodParmDef[] getAbstractMethodParms(java.lang.String methodName,
                                              java.util.Date versDateTime)
                                       throws GeneralException

Gets user method parameters associated with the specified method name.

Parameters:
methodName - The name of the method.
versDateTime - The versioning datetime stamp.
Returns:
An array of method parameter definitions.
Throws:
GeneralException - If there was any misc exception that we want to catch and re-throw as a Fedora exception. Extends ServerException.

locateBdefPID

public java.lang.String locateBdefPID(java.lang.String bDefPID)
                               throws GeneralException,
                                      ServerException

Locates the specified bdef object using its persistent 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 storage area. If the object is found, the object's label is returned. Otherwise, it throws GeneralException.

Parameters:
bDefPID - persistent identifier of the digital object.
Returns:
String containing label of the specified digital object.
Throws:
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.