edu.ucsb.adl.middleware
Interface MetadataDriver

All Known Implementing Classes:
CachingMetadataDriver, MetadataDriver, MetadataDriver

public interface MetadataDriver

The interface between the ADL metadata service and drivers that implement the service on behalf of collections. The ADL metadata service creates the driver for a collection by dynamically loading the driver class and calling the following class method:

public static MetadataDriver createDriver (Global global,
                                           File directory,
                                           String collection)
Driver configuration files can be obtained from directory. collection is the name of the collection, e.g., "adl_catalog". global is the global object representing this instance of the middleware; it can be used to store global quantities.

A metadata driver may also be created by a driver for the ADL query service; in this case, class method createDriverInternal (same profile as createDriver) will be called.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/MetadataDriver.java,v 1.6 2006/06/22 23:00:55 gjanee Exp $

$Log: MetadataDriver.java,v $ Revision 1.6 2006/06/22 23:00:55 gjanee
Added a new requirement that drivers must supply a createDriverInternal class method.

Revision 1.5 2004/03/05 19:01:57 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.4 2003/05/09 20:55:05 gjanee
Added support for arbitrary, per-collection and per-holding metadata views. Specifically, changed the view argument data type from an enumeration to a string. Added method performViewsService.

Revision 1.3 2001/11/16 16:56:04 gjanee
Minor documentation change to reflect new internationalization requirements.

Revision 1.2 2001/08/11 13:52:24 gjanee
Documentation change to reflect the new configuration file structure.

Revision 1.1 1999/12/04 00:37:02 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
 void destroy()
          Frees any resources held by the driver.
 java.lang.String performMetadataService(java.lang.String view, java.lang.String collection, java.lang.String holding)
          Returns a view of the metadata for a holding within the collection.
 java.lang.String[] performViewsService(java.lang.String collection, java.lang.String holding)
          Returns a list of the views supported by a holding within the collection.
 

Method Detail

performMetadataService

public java.lang.String performMetadataService(java.lang.String view,
                                               java.lang.String collection,
                                               java.lang.String holding)
                                        throws MiddlewareException
Returns a view of the metadata for a holding within the collection. The driver can assume that the request has been authorized and that collection names the collection for which the driver was created. This method must be multithread-safe.

Parameters:
view - The metadata view, e.g., "adl:bucket".
collection - The collection name, e.g., "adl_catalog".
holding - The holding identifier.
Returns:
An XML document that is well-formed and valid according to the appropriate DTD. The document should not contain an encoding declaration.
Throws:
BadRequestException - If holding is not a valid holding identifier.
UnsupportedException - If the request is valid but not supported (e.g., the view is unsupported by the holding).
InternalErrorException - If the request is valid but cannot otherwise be completed.
MiddlewareException
See Also:
MetadataService

performViewsService

public java.lang.String[] performViewsService(java.lang.String collection,
                                              java.lang.String holding)
                                       throws MiddlewareException
Returns a list of the views supported by a holding within the collection. The driver can assume that the request has been authorized and that collection names the collection for which the driver was created. This method must be multithread-safe.

Parameters:
collection - The collection name, e.g., "adl_catalog".
holding - The holding identifier.
Returns:
The views supported by the holding. The list must include the three standard ADL views. Specifically, the first view must be adl:bucket, the second, adl:browse, and the third, adl:access.
Throws:
BadRequestException - If holding is not a valid holding identifier.
InternalErrorException - If the request is valid but cannot otherwise be completed.
MiddlewareException
See Also:
MetadataService

destroy

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