edu.ucsb.adl.bucket99
Class IdentifiersDriver

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

public final class IdentifiersDriver
extends java.lang.Object
implements IdentifiersDriver

Driver for the ADL identifiers service. The driver queries a database for identifiers, and logs requests to a log file.

This class reads the following properties from the Bucket99 driver configuration file bucket99.conf. Property values may be indirectly specified using the notation @P where P is the name of another property (see ExtendedProperties for more information).

identifiers.database_driver_class
The fully-qualified name of the database driver class, e.g., "com.informix.jdbc.IfxDriver".
identifiers.database_url
The database's connection URL.
identifiers.database_properties
The name of a Java properties file containing database connection properties, or the string "none". If the filename is not absolute, it is interpreted relative to the directory containing the Bucket99 configuration file.
identifiers.query
An SQL query of the form "SELECT identifier FROM table".
identifiers.log_file
The name of the file to log invocation records to; or, if the value is of the form "j2se-logger:L", the name L of the Java Logger to log invocation records to (at logging level INFO); or the string "none" if logging is not desired. If the filename is not absolute, it is interpreted relative to the directory containing the Bucket99 configuration file.
Records logged by this driver contain six fields: For example:
!957375987400|identifiers|edu.ucsb.adl.bucket99.IdentifiersDriver|adl_catalog|1108|

Version:
$Header: /export/home/gjanee/bucket99/edu/ucsb/adl/bucket99/RCS/IdentifiersDriver.java,v 1.1 2006/06/23 05:30:34 gjanee Exp $

$Log: IdentifiersDriver.java,v $ Revision 1.1 2006/06/23 05:30:34 gjanee Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
static edu.ucsb.adl.bucket99.IdentifiersDriver createDriver(edu.ucsb.adl.middleware.Global global, java.io.File directory, java.lang.String collection)
          Creates an IdentifiersDriver.
 void destroy()
          Frees all resources held by the driver.
 java.util.Vector performIdentifiersService(java.lang.String collection)
          Performs the ADL identifiers service, i.e., returns the identifiers of all items in the collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createDriver

public static edu.ucsb.adl.bucket99.IdentifiersDriver createDriver(edu.ucsb.adl.middleware.Global global,
                                                                   java.io.File directory,
                                                                   java.lang.String collection)
                                                            throws InternalErrorException
Creates an IdentifiersDriver.

Parameters:
global - Unused.
directory - The pathname of the directory containing the Bucket99 driver configuration file.
collection - The name of the collection, e.g., "adl_catalog".
Returns:
An IdentifiersDriver.
Throws:
InternalErrorException - If any error is encountered.

performIdentifiersService

public java.util.Vector performIdentifiersService(java.lang.String collection)
                                           throws InternalErrorException
Performs the ADL identifiers service, i.e., returns the identifiers of all items in the collection. This method is multithread-safe.

Specified by:
performIdentifiersService in interface IdentifiersDriver
Parameters:
collection - The collection name, e.g., "adl_catalog".
Returns:
A vector of string identifiers.
Throws:
InternalErrorException - If any error occurs.
See Also:
IdentifiersService

destroy

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

Specified by:
destroy in interface IdentifiersDriver