dods.servers.test
Class dts

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bydods.servlet.DODSServlet
              extended bydods.servers.test.dts
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class dts
extends DODSServlet

Purpose:
This is the DODS Test servlet (dts). It allows the owner of the server to deliver data in ANY valid DDS to a client. This DDS will be filled with invented data if the client requests a DataDDS. This kind of test fixture is useful for evaluating a clients ability to handle the various complexities of the DODS data types.

Configuration:
The DODSServlet relies on the javax.servlet.ServletConfig interface (in particular the getInitParameter() method) to retrieve configuration information used by the servlet. InitParameters:

Here is an example entry from the web.xml file (for tomcat3.3a) for the DODS Test Server (DTS):

         <servlet>
            <servlet-name>
                dts
            </servlet-name>
 

<servlet-class> dods.servers.test.dts </servlet-class>

<init-param> <param-name>DebugOn</param-name> <param-value>showRequest showResponse </param-value> </init-param>

<init-param> <param-name>INFOcache</param-name> <param-value>/usr/Java-DODS/sdds-testsuite/info/</param-value> </init-param>

<init-param> <param-name>DDScache</param-name> <param-value>/usr/Java-DODS/sdds-testsuite/dds/</param-value> </init-param>

<init-param> <param-name>DAScache</param-name> <param-value>/usr/Java-DODS/sdds-testsuite/das/</param-value> </init-param> </servlet>

Version:
$Revision: 1.15.2.3 $
Author:
Nathan David Potter
See Also:
Serialized Form

Constructor Summary
dts()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          ************************************************************************ We override this crucial method from the parent servlet in order to force the client not to cache.
 void doGetDODS(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ReqState rs)
          ************************************************************************ Default handler for the client's data request.
protected  GuardedDataset getDataset(ReqState rs)
          ************************************************************************ This method must be implemented locally for each DODS server.
 java.lang.String getServerVersion()
          ************************************************************************ This method returns a String containing the DODS Server Version...
 
Methods inherited from class dods.servlet.DODSServlet
anyExceptionHandler, badURL, dodsExceptionHandler, doGetASC, doGetCatalog, doGetDAS, doGetDDS, doGetDIR, doGetHELP, doGetHTML, doGetINFO, doGetStatus, doGetVER, getDAS, getServerName, init, isTheClientCompressed, openCachedDAS, openCachedDDS, parseExceptionHandler, printCatalog, printStatus, probeRequest, processDodsURL, sendDODSError
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, 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
 

Constructor Detail

dts

public dts()
Method Detail

getServerVersion

public java.lang.String getServerVersion()
************************************************************************ This method returns a String containing the DODS Server Version...

Specified by:
getServerVersion in class DODSServlet

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
************************************************************************ We override this crucial method from the parent servlet in order to force the client not to cache. This is achieved by setting the header tag "Last-Modified" to the current date and time.

Overrides:
doGet in class DODSServlet
Parameters:
request - The client's HttpServletRequest request object.
response - The server's HttpServletResponse response object.
Throws:
java.io.IOException
javax.servlet.ServletException
See Also:
DODSServlet.processDodsURL(HttpServletRequest)

doGetDODS

public void doGetDODS(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      ReqState rs)
               throws java.io.IOException,
                      javax.servlet.ServletException
************************************************************************ Default handler for the client's data request. Requires the getDDS() method implemented by each server localization effort.

Once the DDS has been parsed, the data is read (using the class in the localized server factory etc.), compared to the constraint expression, and then sent to the client.

Overrides:
doGetDODS in class DODSServlet
Parameters:
request - The client's HttpServletRequest request object.
response - The server's HttpServletResponse response object.
rs - The ReqState object containing th details of this client request.
Throws:
java.io.IOException
javax.servlet.ServletException

getDataset

protected GuardedDataset getDataset(ReqState rs)
                             throws DODSException,
                                    java.io.IOException,
                                    ParseException
Description copied from class: DODSServlet
************************************************************************ This method must be implemented locally for each DODS server. The local implementation of this method is the key piece for connecting any localized data types that are derived from the dods.dap.Server types back into the running servlet.

This method should do the following:

Specified by:
getDataset in class DODSServlet
Parameters:
rs - The ReqState object for this client request.
Returns:
The ServerDDS object all parsed and ready to roll.
Throws:
DODSException
java.io.IOException
ParseException
See Also:
ServerDDS, sqlServerFactory, test_ServerFactory