edu.ucsb.adl.middleware
Class StatusService

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

public final class StatusService
extends java.lang.Object

The ADL status service. Conceptually, this service returns a complete HTML document describing the status of the ADL middleware server.

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

status.gatekeeper.class
The fully-qualified name of the service-level gatekeeper class, e.g., "edu.ucsb.adl.middleware.IPAddressGatekeeper".
status.gatekeeper.argument
The service-level gatekeeper's startup parameter.
status.style_sheet_url
Either the string "none" or the URL of a CSS style sheet to be included as a link in the HTML document's header.
status.cancel_servlet_url
Either the string "none" or the URL of servlet edu.ucsb.adl.middleware.CancelServlet, e.g., "http://bigmac.edu/servlet/cancel".
status.results_servlet_url
Either the string "none" or the URL of servlet edu.ucsb.adl.middleware.ResultsServlet, e.g., "http://bigmac.edu/servlet/results".
status.cache_control_servlet_url
Either the string "none" or the URL of servlet edu.ucsb.adl.middleware.CacheControlServlet, e.g., "http://bigmac.edu/servlet/cache_control".
status.map_server_url
Either the string "none" or the template URL of a map server. See the mapServerURL argument of method Query.toHTML for a description of the template.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/StatusService.java,v 1.7 2006/06/26 22:02:35 gjanee Exp $

$Log: StatusService.java,v $ Revision 1.7 2006/06/26 22:02:35 gjanee
Added cache preload threads to the status page. Added property status.cache_control_servlet_url.

Revision 1.6 2004/09/22 03:00:26 gjanee
Rewrite to use new, centralized XML/HTML encoding functions.

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

Revision 1.4 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.3 2003/06/12 21:04:32 gjanee
Minor change to the "Get result" form to accommodate a change to the results service's HTTP interface.

Revision 1.2 2001/08/15 21:44:06 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/04/06 18:30:28 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

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

performStatusService

public java.lang.String performStatusService(javax.servlet.ServletRequest request)
                                      throws MiddlewareException
Performs the ADL status service. This method is multithread-safe.

Parameters:
request - The full request.
Returns:
An HTML document.
Throws:
BadRequestException - If request is invalid.
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.