edu.ucsb.adl.bucket99
Class FileCollectionDriver

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

public final class FileCollectionDriver
extends java.lang.Object
implements CollectionDriver

File-based driver for the ADL collection service. The collection metadata is read from a local file and cached. The file is re-read whenever it is noticed that the file has been modified.

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).

collection.metadata_file
The name of the file containing the collection metadata. If the filename is not absolute, it is interpreted relative to the directory containing the Bucket99 configuration file.
collection.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 five fields:

For example:
!957375987400|collection|edu.ucsb.adl.bucket99.FileCollectionDriver|adl_catalog|

Version:
$Header: /export/home/gjanee/bucket99/edu/ucsb/adl/bucket99/RCS/FileCollectionDriver.java,v 1.9 2004/09/23 16:19:24 gjanee Exp $

$Log: FileCollectionDriver.java,v $ Revision 1.9 2004/09/23 16:19:24 gjanee
Rewrite to use class edu.ucsb.adl.middleware.ExtendedProperties.

Revision 1.8 2004/03/05 23:59:25 gjanee
Added support for multiple middleware instances. A middleware instance is represented by a Global object that is tied to a main middleware configuration file. All service objects now maintain a reference to the appropriate Global object. Instance-wide variables formerly coded as class variables are now held by the Global object; various methods that return instance-wide variables now accept a Global object as an argument. The Global object is now passed to all service drivers.

Revision 1.7 2003/06/13 03:51:27 gjanee
Added support for logging to Java loggers. Modified the interpretation of the collection.log_file property.

Revision 1.6 2002/09/28 21:08:57 gjanee
Minor documentation change.

Revision 1.5 2002/09/28 20:58:29 gjanee
Configuration file renames. Renamed the Bucket99 configuration file to bucket99.conf.

Revision 1.4 2001/11/16 06:05:11 gjanee
Internationalization support. We now use FileLoader.loadXMLFile to load the collection metadata.

Revision 1.3 2001/10/09 17:09:08 gjanee
Added support for relative filenames.

Revision 1.2 2001/08/20 18:58:07 gjanee
Switched to the new configuration file structure. In the new structure, an entirely collection-independent "main" configuration file refers to a directory of subdirectories, one subdirectory per collection; each subdirectory holds a collection-specific middleware configuration file in addition to any configuration files required by the collection driver.

Revision 1.1 2000/05/12 19:12:45 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
static edu.ucsb.adl.bucket99.FileCollectionDriver createDriver(edu.ucsb.adl.middleware.Global global, java.io.File directory, java.lang.String collection)
          Creates a FileCollectionDriver.
 void destroy()
          Frees all resources held by the driver.
 java.lang.String performCollectionService(java.lang.String collection)
          Performs the ADL collection service, i.e., returns the collection-level metadata for 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.FileCollectionDriver createDriver(edu.ucsb.adl.middleware.Global global,
                                                                      java.io.File directory,
                                                                      java.lang.String collection)
                                                               throws InternalErrorException
Creates a FileCollectionDriver.

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:
A FileCollectionDriver.
Throws:
InternalErrorException - If any error is encountered.

performCollectionService

public java.lang.String performCollectionService(java.lang.String collection)
                                          throws InternalErrorException
Performs the ADL collection service, i.e., returns the collection-level metadata for the collection. This method is multithread-safe.

Specified by:
performCollectionService in interface CollectionDriver
Parameters:
collection - The collection name, e.g., "adl_catalog".
Returns:
The metadata.
Throws:
InternalErrorException - If any error occurs.
See Also:
CollectionService

destroy

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

Specified by:
destroy in interface CollectionDriver