dods.servers.sql
Class sqlDataset

java.lang.Object
  extended bydods.servers.sql.sqlDataset
All Implemented Interfaces:
GuardedDataset, GuardedSQLDataset

public class sqlDataset
extends java.lang.Object
implements GuardedSQLDataset

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.

Version:
$Revision: 1.5.2.3 $
Author:
Nathan David Potter

Method Summary
 DAS getDAS()
          In this (default) implementation of the getDAS() method a locally cached DAS is retrieved and parsed.
 ServerDDS getDDS()
          For the test server this method does the following: Makes a new test_ServerFactory (aka BaseTypeFactory) for the dataset requested.
 sqlDDS getSQLDDS()
          For the DODS SQL server this method does the following: Makes a newsqlServerFactory (aka BaseTypeFactory) for the dataset requested.
 java.io.DataInputStream openCachedDAS(ReqState rs)
          Opens a DAS cached on local disk.
 java.io.DataInputStream openCachedDDS(ReqState rs)
          Opens a DDS cached on local disk.
 void release()
          Release the lock, if any, on this dataset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

release

public void release()
Description copied from interface: GuardedDataset
Release the lock, if any, on this dataset.

Specified by:
release in interface GuardedDataset

getSQLDDS

public sqlDDS getSQLDDS()
                 throws DODSException,
                        ParseException
For the DODS SQL server this method does the following:

Specified by:
getSQLDDS in interface GuardedSQLDataset
Returns:
The sqlDDS for the named data set.
Throws:
DODSException
ParseException
See Also:
ServerDDS, sqlServerFactory, test_ServerFactory

getDDS

public ServerDDS getDDS()
                 throws DODSException,
                        ParseException
For the test server this method does the following:

Specified by:
getDDS in interface GuardedDataset
Returns:
The ServerDDS for the named data set.
Throws:
ParseException
DODSException
See Also:
ServerDDS, test_ServerFactory

openCachedDDS

public java.io.DataInputStream openCachedDDS(ReqState rs)
                                      throws DODSException
Opens a DDS cached on local disk. This can be used on DODS servers (such as the DODS SQL Server) that rely on locally cached DDS files as opposed to dynamically generated DDS's.

This method uses the iniFile object cached by loadIniFile() to determine where to look for the cached DDS.

Parameters:
rs - The ReqState object for this client request.
Returns:
An open DataInputStream from which the DDS can be read.
Throws:
DODSException
See Also:
ReqState

getDAS

public DAS getDAS()
           throws DODSException,
                  ParseException
In this (default) implementation of the getDAS() method a locally cached DAS is retrieved and parsed. In this method the DAS for the passed dataset is loaded from the "das_cache_dir" indidcated in the "[Server]" section of the DODSiniFile. If the there is no file available a DODSException is thrown. It is certainly possible (and possibly very desirable) to override this method when overriding the getDDS() method. One reason for doing this is if the DODS server being implemented can generate the DAS information dynamically. When overriding this method be sure that it does the following:

Specified by:
getDAS in interface GuardedDataset
Returns:
The DAS object for the data set specified in the parameter dataSet
Throws:
DODSException
ParseException
See Also:
DAS

openCachedDAS

public java.io.DataInputStream openCachedDAS(ReqState rs)
                                      throws java.io.FileNotFoundException
Opens a DAS cached on local disk. This can be used on DODS servers (such as the DODS SQL Server) that rely on locally cached DAS files as opposed to dynamically generated DAS's.

This method uses the iniFile object cached by loadIniFile() to determine where to look for the cached DDS.

If the DAS cannot be found an error is sent back to the client.

Parameters:
rs - The ReqState object for this client request.
Returns:
An open DataInputStream from which the DAS can be read.
Throws:
java.io.FileNotFoundException