fedora.server.access.dissemination
Class DatastreamResolverServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byfedora.server.access.dissemination.DatastreamResolverServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class DatastreamResolverServlet
extends javax.servlet.http.HttpServlet

Title: DatastreamResolverServlet.java

Description: This servlet acts as a proxy to resolve the physical location of datastreams. It requires a single parameter named id that denotes the temporary id of the requested datastresm. This id is in the form of a DateTime stamp. The servlet will perform an in-memory hashtable lookup using the temporary id to obtain the actual physical location of the datastream and then return the contents of the datastream as a MIME-typed stream. This servlet is invoked primarily by external mechanisms needing to retrieve the contents of a datastream.

The servlet also requires that an external mechanism request a datastream within a finite time interval of the tempID's creation. This is to lessen the risk of unauthorized access. The time interval within which a mechanism must repond is set by the Fedora configuration parameter named datastreamMediationLimit and is specified in milliseconds. If this parameter is not supplied it defaults to 5000 miliseconds.

-----------------------------------------------------------------------------

License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.

-----------------------------------------------------------------------------

Version:
$Id: DatastreamResolverServlet.java,v 1.24 2005/01/11 20:06:06 cwilper Exp $
Author:
rlw@virginia.edu
See Also:
Serialized Form

Constructor Summary
DatastreamResolverServlet()
           
 
Method Summary
 void destroy()
           
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Processes the servlet request and resolves the physical location of the specified datastream.
 void init()
          Initialize servlet.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatastreamResolverServlet

public DatastreamResolverServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException

Initialize servlet.

Throws:
javax.servlet.ServletException - If the servet cannot be initialized.

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException

Processes the servlet request and resolves the physical location of the specified datastream.

Parameters:
request - The servlet request.
response - servlet The servlet response.
Throws:
javax.servlet.ServletException - If an error occurs that effects the servlet's basic operation.
java.io.IOException - If an error occurrs with an input or output operation.

destroy

public void destroy()