edu.ucsb.adl.middleware
Interface MetadataDriverGatekeeper

All Known Implementing Classes:
BasicPasswordGatekeeper, CombinationGatekeeper, ConstantGatekeeper, IPAddressGatekeeper

public interface MetadataDriverGatekeeper

The interface between the ADL metadata service and gatekeepers that control access to the drivers that implement the service on behalf of collections. The ADL metadata service creates the gatekeeper for a driver by dynamically loading the gatekeeper class and calling the following class method:

public static MetadataDriverGatekeeper createGatekeeper (
    ExtendedProperties propertyList, String argument)
Gatekeeper startup parameters can be obtained from propertyList. argument is an additional, gatekeeper- and/or collection-specific startup parameter.

Version:
$Header: /export/home/gjanee/middleware/edu/ucsb/adl/middleware/RCS/MetadataDriverGatekeeper.java,v 1.3 2004/09/21 18:22:27 gjanee Exp $

$Log: MetadataDriverGatekeeper.java,v $ Revision 1.3 2004/09/21 18:22:27 gjanee
Minor documentation change.

Revision 1.2 2003/05/09 22:20:20 gjanee
Added support for arbitrary, per-collection and per-holding metadata views. Specifically, changed the view argument data type from an enumeration to a string. Added method viewsDriverAllowed.

Revision 1.1 1999/08/24 17:00:11 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
 void destroy()
          Frees any resources held by the gatekeeper.
 boolean metadataDriverAllowed(javax.servlet.ServletRequest request, java.lang.String view, java.lang.String collection, java.lang.String holding)
          Returns true if the request is authorized, that is, if the client is allowed to view the requested view of the metadata for the requested holding.
 boolean viewsDriverAllowed(javax.servlet.ServletRequest request, java.lang.String collection, java.lang.String holding)
          Returns true if the request is authorized, that is, if the client is allowed to retrieve the supported view list for the requested holding.
 

Method Detail

metadataDriverAllowed

public boolean metadataDriverAllowed(javax.servlet.ServletRequest request,
                                     java.lang.String view,
                                     java.lang.String collection,
                                     java.lang.String holding)
                              throws MiddlewareException
Returns true if the request is authorized, that is, if the client is allowed to view the requested view of the metadata for the requested holding. The gatekeeper can assume that collection names the collection for which the gatekeeper was created. This method must be multithread-safe.

Parameters:
request - The full request.
view - The metadata view requested, e.g., "adl:bucket".
collection - The collection name, e.g., "adl_catalog".
holding - The holding identifier.
Returns:
true if the request is authorized.
Throws:
BadRequestException - If request or holding are not valid.
UnsupportedException - If the request is valid but not supported (e.g., the view is unsupported by the holding).
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareException
See Also:
MetadataService

viewsDriverAllowed

public boolean viewsDriverAllowed(javax.servlet.ServletRequest request,
                                  java.lang.String collection,
                                  java.lang.String holding)
                           throws MiddlewareException
Returns true if the request is authorized, that is, if the client is allowed to retrieve the supported view list for the requested holding. The gatekeeper can assume that collection names the collection for which the gatekeeper was created. This method must be multithread-safe.

Parameters:
request - The full request.
collection - The collection name, e.g., "adl_catalog".
holding - The holding identifier.
Returns:
true if the request is authorized.
Throws:
BadRequestException - If request or holding are not valid.
InternalErrorException - If the authorization cannot otherwise be determined.
MiddlewareException
See Also:
MetadataService

destroy

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