org.nfis.gdas.service
Class GdasServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.nfis.util.NfisServlet
              extended by org.nfis.gdas.service.GdasServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class GdasServlet
extends org.nfis.util.NfisServlet

Version:
1.0 - Dec 7, 2004 - 4:17:45 PM The GdasServlet implements the GDAS version management described in the GDAS Specification Version 0.9.1, Section 6.2.4. All GDAS requests should be sent to this servlet. The servlet will then forward the request to the correct registered GDAS version implementation.

GDAS implementations are registered with the GdasServlet by configuring the <init-param> <param-name> named 'supportedVersions' element in this web containers web.xml.

First a valid GDAS 'Request' parameter is searched for. If it is not found the request is treated as an XML request. Once the request type and version are determined, requests are forwarded to the proper GDAS implementation.

Author:
emurphy emurphy@pfc.cfs.nrcan.gc.ca
See Also:
Serialized Form

Field Summary
static java.lang.String APPLICATION_EXCEPTION
          Error code for unexpected error
static java.lang.String COMMAND
          Used by the demo interface
protected static java.lang.String GET_CAPABILITIES
           
protected static java.lang.String GET_DATA
           
static java.lang.String INVALID_FORMAT_EXCEPTION_CODE
          Code when a request cannot be parsed as XML
static java.lang.String INVALID_PARAMETER_VAUE_ERROR_CODE
          Error code if there is a missing service, request or version parameter
static java.lang.String MISSING_PARAMETER_VALUE_ERROR_CODE
          Error code if a parameter cannot be found
static java.lang.String TYPE_OF_XML_REQUEST
          The name of the request attribute that contains the string 'GetCapabilities' or 'GetData'.
protected static java.lang.String VERSION_PARAM_NAME
           
static java.lang.String XML_REQUEST_DOC
          The name of a GetData XML request stored in the request.
 
Fields inherited from class org.nfis.util.NfisServlet
DEFAULT_MAX_IN_MEMORY, DEFAULT_MAX_SIZE, FILE_TO_LARGE_ERROR, FILE_UPOAD_ERROR, MAX_IN_MEMORY, MAX_SIZE, NULL_PARAM_ERROR, TEMP_DIRECTORY, UNKNOWN_SIZE_ERROR
 
Constructor Summary
GdasServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Examines the request and, depending on its value, calls the appropriate method further process the request.
 void init()
          Used to initialize variables needed by GDAS, including getting the Versions of GDAS (from the Web.xml) that are available by this service.
 
Methods inherited from class org.nfis.util.NfisServlet
forwardTo, getCommand, getFileItem, getFileItems, getLanguageFromSession, getParameter, setPropertyFile, writeOutXml
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, 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
 

Field Detail

COMMAND

public static final java.lang.String COMMAND
Used by the demo interface

See Also:
Constant Field Values

MISSING_PARAMETER_VALUE_ERROR_CODE

public static final java.lang.String MISSING_PARAMETER_VALUE_ERROR_CODE
Error code if a parameter cannot be found

See Also:
Constant Field Values

INVALID_PARAMETER_VAUE_ERROR_CODE

public static final java.lang.String INVALID_PARAMETER_VAUE_ERROR_CODE
Error code if there is a missing service, request or version parameter

See Also:
Constant Field Values

INVALID_FORMAT_EXCEPTION_CODE

public static final java.lang.String INVALID_FORMAT_EXCEPTION_CODE
Code when a request cannot be parsed as XML

See Also:
Constant Field Values

XML_REQUEST_DOC

public static final java.lang.String XML_REQUEST_DOC
The name of a GetData XML request stored in the request.

See Also:
Constant Field Values

TYPE_OF_XML_REQUEST

public static final java.lang.String TYPE_OF_XML_REQUEST
The name of the request attribute that contains the string 'GetCapabilities' or 'GetData'.

See Also:
Constant Field Values

APPLICATION_EXCEPTION

public static final java.lang.String APPLICATION_EXCEPTION
Error code for unexpected error

See Also:
Constant Field Values

GET_DATA

protected static final java.lang.String GET_DATA
See Also:
Constant Field Values

GET_CAPABILITIES

protected static final java.lang.String GET_CAPABILITIES
See Also:
Constant Field Values

VERSION_PARAM_NAME

protected static final java.lang.String VERSION_PARAM_NAME
See Also:
Constant Field Values
Constructor Detail

GdasServlet

public GdasServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Used to initialize variables needed by GDAS, including getting the Versions of GDAS (from the Web.xml) that are available by this service.

Overrides:
init in class org.nfis.util.NfisServlet
Throws:
javax.servlet.ServletException

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws java.io.IOException
Examines the request and, depending on its value, calls the appropriate method further process the request.

Overrides:
doPost in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException