edu.ucsb.adl.middleware
Class ConfigurationService

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

public final class ConfigurationService
extends java.lang.Object

The ADL configuration service. Conceptually, this service returns a property list containing selected middleware configuration parameters.

This class reads the following properties from the main middleware configuration file:

configuration.gatekeeper.class
The fully-qualified name of the service-level gatekeeper class, e.g., "edu.ucsb.adl.middleware.IPAddressGatekeeper".
configuration.gatekeeper.argument
The service-level gatekeeper's startup parameter.
And the following properties are both read and returned:
query.lifetime
The lifetime of queries in milliseconds.
query.maximum_results
The maximum number of results a query may accumulate.
rankers
The names of all rankers registered to the middleware separated by commas, e.g., "relevance,date,spatial_similarity".
R.name
For ranker R, the descriptive name of the ranker, e.g., "by date, most recent first".
result_set.lifetime
The lifetime of result sets in milliseconds.
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).

And the following properties are synthesized and returned:

version
The version of the ADL middleware server, e.g., "1.1.1". The version consists of three positive integers: the major version number (incremented when interface changes are made that break backward compatibility); the minor version number (incremented when significant changes and additions are made); and the revision number (incremented when minor changes and bug fixes are made).
collections
The names of all available collections separated by commas, e.g., "adl_catalog,adl_gazetteer,stanford_georef".
In the main 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).

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/ConfigurationService.java,v 1.8 2004/09/21 23:53:43 gjanee Exp $

$Log: ConfigurationService.java,v $ Revision 1.8 2004/09/21 23:53:43 gjanee
Minor documentation change.

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

Revision 1.6 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.5 2002/09/25 23:13:30 gjanee
Added support for disabled collections. A subdirectory of the master collection directory is interpreted as a collection if and only if it does *not* contain a file named "OFFLINE".

Revision 1.4 2001/09/12 21:10:14 gjanee
The version property is now obtained from the Version class (i.e., from a compiled-in source) as opposed to being read in from the configuration file.

Revision 1.3 2001/08/24 18:40:19 gjanee
Minor change. In listing the available collections, it is now enforced that only subdirectories of the collection directory are listed.

Revision 1.2 2001/08/14 20:56:25 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. An implication of this change is that the list of available collections is now determined dynamically by simply listing the subdirectories.

Revision 1.1 2000/04/05 18:54:29 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
static edu.ucsb.adl.middleware.ConfigurationService createService(java.lang.String configurationFile)
          Creates a ConfigurationService.
 void destroy()
          Decrements the reference count.
 java.util.Properties performConfigurationService(javax.servlet.ServletRequest request)
          Performs the ADL configuration 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.ConfigurationService createService(java.lang.String configurationFile)
                                                                  throws InternalErrorException
Creates a ConfigurationService. 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.

performConfigurationService

public java.util.Properties performConfigurationService(javax.servlet.ServletRequest request)
                                                 throws MiddlewareException
Performs the ADL configuration service. This method is multithread-safe.

Parameters:
request - The full request.
Returns:
A property list.
Throws:
BadRequestException - If request is not valid.
NoAuthorizationException - If the request is 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.