edu.ucsb.adl.middleware
Class UnreferenceService

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

public final class UnreferenceService
extends java.lang.Object

The ADL unreference service. This service unreferences (i.e., permanently deletes the reference to) and unloads a remote collection.

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

unreference.gatekeeper.class
The fully-qualified name of the service-level gatekeeper class, e.g., "edu.ucsb.adl.middleware.IPAddressGatekeeper".
unreference.gatekeeper.argument
The service-level gatekeeper's startup parameter.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/UnreferenceService.java,v 1.6 2006/06/24 22:32:45 gjanee Exp $

$Log: UnreferenceService.java,v $ Revision 1.6 2006/06/24 22:32:45 gjanee
Corrected a synchronization bug (but there is still the theoretical possibility of a conflict with the reference service).

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 2002/09/28 20:41:41 gjanee
Configuration file renames. Renamed the collection-specific middleware configuration file to drivers.conf and the RMI proxy driver configuration file to rmi-proxy-driver.conf.

Revision 1.2 2002/09/25 23:21:45 gjanee
Minor change to support disabled collections. We delete the "OFFLINE" file if it exists.

Revision 1.1 2001/09/14 21:08:12 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
static edu.ucsb.adl.middleware.UnreferenceService createService(java.lang.String configurationFile)
          Creates an UnreferenceService.
 void destroy()
          Decrements the reference count.
 void performUnreferenceService(javax.servlet.ServletRequest request, java.lang.String collection)
          Performs the ADL unreference 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.UnreferenceService createService(java.lang.String configurationFile)
                                                                throws InternalErrorException
Creates an UnreferenceService. 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.

performUnreferenceService

public void performUnreferenceService(javax.servlet.ServletRequest request,
                                      java.lang.String collection)
                               throws MiddlewareException
Performs the ADL unreference service. This method is multithread-safe.

Parameters:
request - The full request.
collection - The local name of the collection to unreference, e.g., "adl_catalog".
Throws:
BadRequestException - If either argument is invalid, and in particular, if collection is not the local name of a remote collection.
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.