edu.ucsb.adl.middleware
Class ResultsService

java.lang.Object
  |
  +--edu.ucsb.adl.middleware.ResultsService

public final class ResultsService
extends java.lang.Object

The ADL results service. Conceptually, this service returns a result set given the result set's ID.

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

results.gatekeeper.class
The fully-qualified name of the service-level gatekeeper class, e.g., "edu.ucsb.adl.middleware.IPAddressGatekeeper".
results.gatekeeper.argument
The service-level gatekeeper's startup parameter.
result_set.reaper_cycle_time
The duration of the result set reaper's cycle in milliseconds.
result.compression_age
The age in milliseconds at which query results are compressed, or the string "never" to disable compression (other than possibly an initial compression as determined by the result.initial_compression property). A query result's age is reset to zero each time one of its metadata views is accessed; accessing a metadata view, if compressed, causes the view to be uncompressed.
In the above, property values that are time durations in milliseconds may have a single-character suffix added to specify a different unit of measure. Recognized suffixes are "s" (seconds), "m" (minutes), "h" (hours), and "d" (days).

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/ResultsService.java,v 1.7 2007/02/14 17:12:51 gjanee Exp $

$Log: ResultsService.java,v $ Revision 1.7 2007/02/14 17:12:51 gjanee
Minor change to accommodate a change to ResultSet.startReaper.

Revision 1.6 2004/09/21 23:53:43 gjanee
Minor documentation change.

Revision 1.5 2004/03/15 17:12:33 gjanee
Added support for compression of results. Added property result.compression_age.

Revision 1.4 2004/03/11 19:21:24 gjanee
Added support for different units of measure in time duration properties.

Revision 1.3 2004/03/05 18:52:05 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/15 21:57:43 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 1999/12/03 20:58:19 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
static edu.ucsb.adl.middleware.ResultsService createService(java.lang.String configurationFile)
          Creates a ResultsService.
 void destroy()
          Decrements the reference count.
 edu.ucsb.adl.middleware.ResultSet performResultsService(javax.servlet.ServletRequest request, int id)
          Performs the ADL results service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createService

public static edu.ucsb.adl.middleware.ResultsService createService(java.lang.String configurationFile)
                                                            throws InternalErrorException
Creates a ResultsService. If a service already exists for the configuration file, the extant service's reference count is incremented and it is returned instead.

Parameters:
configurationFile - The filename of a main middleware configuration file.
Throws:
InternalErrorException - If the initialization of the service fails.

performResultsService

public edu.ucsb.adl.middleware.ResultSet performResultsService(javax.servlet.ServletRequest request,
                                                               int id)
                                                        throws MiddlewareException
Performs the ADL results service. This method is multithread-safe.

Parameters:
request - The full request.
id - The ID of the desired result set.
Returns:
The result set.
Throws:
BadRequestException - If any of the arguments is invalid.
NoAuthorizationException - If the request is valid but not allowed.
InternalErrorException - If the request cannot otherwise be completed.
MiddlewareException

destroy

public void destroy()
Decrements the reference count. When the reference count drops to zero, all resources held by the service are freed.