dods.servers.test
Class dts

java.lang.Object
  extended by HttpServlet
      extended by dods.servlet.DODSServlet
          extended by dods.servers.test.dts

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.3 $
Author:
Nathan David Potter

Constructor Summary
dts()
           
 
Method Summary
 void doGet(HttpServletRequest request, HttpServletResponse response)
          We override this crucial method from the parent servlet in order to force the client not to cache.
 void doGetDODS(HttpServletRequest request, HttpServletResponse response, requestState rs)
          Default handler for the client's data request.
protected  GuardedDataset getDataset(requestState rs)
          This method must be implemented locally for each DODS server.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

dts

public dts()
Method Detail

getServerVersion

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

Specified by:
getServerVersion in class DODSServlet

doGet

public void doGet(HttpServletRequest request,
                  HttpServletResponse response)
           throws IOException,
                  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:
IOException
ServletException
See Also:
DODSServlet.processDodsURL(HttpServletRequest), #getDataSet(), #setDataSet(String), #getCE(), #setCE(String), #getRequestSuffix(), #setRequestSuffix(String), #loadIniFile()

doGetDODS

public void doGetDODS(HttpServletRequest request,
                      HttpServletResponse response,
                      requestState rs)
               throws IOException,
                      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.
dataSet - Name of the datset whose data is requested.
constraintExpression - Constraint expression recieved from the client. This is used (if it's not just empty) subset the data in the dataset.
Throws:
IOException
ServletException

getDataset

protected GuardedDataset getDataset(requestState rs)
                             throws DODSException,
                                    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
Returns:
The ServerDDS object all parsed and ready to roll.
Throws:
DODSException
IOException
ParseException
See Also:
ServerDDS, sqlServerFactory, test_ServerFactory