edu.ucsb.adl.bucket99
Class BlobMetadataSubdriver

java.lang.Object
  |
  +--edu.ucsb.adl.bucket99.BlobMetadataSubdriver
All Implemented Interfaces:
MetadataSubdriver

public final class BlobMetadataSubdriver
extends java.lang.Object
implements MetadataSubdriver

Metadata subdriver that generates ADL metadata reports by retrieving reports from a database as BLOBs (binary large objects), CLOBs (character large objects), or simple strings.

This class reads the following properties from Bucket99 configuration files when creating a subdriver for property prefix V. Property values may be indirectly specified using the notation @P where P is the name of another property (see ExtendedProperties for more information).

V.query
An SQL query of the form "SELECT column FROM table WHERE holding = ?". The query should return exactly one row when ? is replaced with a valid holding identifier. column, which may not be NULL, should be a BLOB, CLOB, or string containing the appropriate metadata report for the holding. If the holding identifier is invalid, the query should return zero rows.
metadata.identifier_datatype
The datatype of holding identifiers; must be "integer" or "string".
V.column_datatype
The datatype of the column selected by V.query above; must be "blob", "clob", or "string".
V.column_encoding
If V.column_datatype is "blob", the character encoding used by the column, e.g., "US-ASCII".

Version:
$Header: /export/home/gjanee/bucket99/edu/ucsb/adl/bucket99/RCS/BlobMetadataSubdriver.java,v 1.2 2004/09/23 17:03:10 gjanee Exp $

$Log: BlobMetadataSubdriver.java,v $ Revision 1.2 2004/09/23 17:03:10 gjanee
Rewrite to use class edu.ucsb.adl.middleware.ExtendedProperties.

Revision 1.1 2004/02/24 17:59:30 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
static edu.ucsb.adl.bucket99.BlobMetadataSubdriver createSubdriver(edu.ucsb.adl.middleware.ExtendedProperties propertyList, java.lang.String prefix)
          Creates a BlobMetadataSubdriver.
 void destroy()
          Frees all resources held by the subdriver.
 void disuseConnection()
          For use by MetadataDriver only.
 java.lang.String generateReport(java.lang.String view, java.lang.String collection, java.lang.String holding)
          Generates an ADL metadata report.
 void useConnection(java.sql.Connection connection)
          For use by MetadataDriver only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSubdriver

public static edu.ucsb.adl.bucket99.BlobMetadataSubdriver createSubdriver(edu.ucsb.adl.middleware.ExtendedProperties propertyList,
                                                                          java.lang.String prefix)
                                                                   throws InternalErrorException
Creates a BlobMetadataSubdriver.

Parameters:
propertyList - The source for the above-mentioned properties.
prefix - The property name prefix corresponding to the metadata view the subdriver is to support, e.g., "ACCESS".
Returns:
A BlobMetadataSubdriver.
Throws:
InternalErrorException - If any error occurs.

useConnection

public void useConnection(java.sql.Connection connection)
                   throws java.sql.SQLException
For use by MetadataDriver only.

Specified by:
useConnection in interface MetadataSubdriver
Parameters:
connection - The connection.
Throws:
java.sql.SQLException - If any error occurs.

disuseConnection

public void disuseConnection()
For use by MetadataDriver only.

Specified by:
disuseConnection in interface MetadataSubdriver

generateReport

public java.lang.String generateReport(java.lang.String view,
                                       java.lang.String collection,
                                       java.lang.String holding)
                                throws java.sql.SQLException,
                                       MiddlewareException
Generates an ADL metadata report.

Specified by:
generateReport in interface MetadataSubdriver
Parameters:
view - Unused.
collection - Unused.
holding - The holding identifier.
Returns:
An XML document that is well-formed and valid according to the appropriate DTD.
Throws:
java.sql.SQLException - If a database-related error occurs.
BadRequestException - If holding is invalid.
InternalErrorException - If any other error occurs.
MiddlewareException

destroy

public void destroy()
Frees all resources held by the subdriver.

Specified by:
destroy in interface MetadataSubdriver