edu.ucsb.adl.middleware
Interface QueryDriver

All Known Implementing Classes:
QueryDriver, QueryDriver

public interface QueryDriver

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

public static QueryDriver 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.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/QueryDriver.java,v 1.3 2004/03/05 19:01:57 gjanee Exp $

$Log: QueryDriver.java,v $ Revision 1.3 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.2 2001/08/11 14:06:18 gjanee
Documentation change to reflect the new configuration file structure.

Revision 1.1 1999/10/26 00:09:50 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
 edu.ucsb.adl.middleware.QueryThread createQueryThread(java.lang.String collection, edu.ucsb.adl.middleware.Query query, edu.ucsb.adl.middleware.ResultAccumulator accumulator)
          Creates a thread that processes a query on behalf of the collection.
 void destroy()
          Frees any resources held by the driver.
 

Method Detail

createQueryThread

public edu.ucsb.adl.middleware.QueryThread createQueryThread(java.lang.String collection,
                                                             edu.ucsb.adl.middleware.Query query,
                                                             edu.ucsb.adl.middleware.ResultAccumulator accumulator)
                                                      throws MiddlewareException
Creates a thread that processes a query on behalf of the collection. The driver can assume that the request has been authorized, that collection names the collection for which the driver was created, and that collection is one of the collections listed in query. This method must be multithread-safe.

Parameters:
collection - The collection name, e.g., "adl_catalog".
query - The query.
accumulator - The result accumulator to which query results are to be sent. The thread must call the accumulator's sourceTerminated method upon termination.
Returns:
A query thread.
Throws:
UnsupportedException - If the query is not supported.
InternalErrorException - If the thread cannot otherwise be created.
MiddlewareException
See Also:
QueryService

destroy

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