Class testDataset
- All Implemented Interfaces:
opendap.servlet.GuardedDataset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()opendap.dap.DASgetDAS()************************************************************************opendap.servers.ServerDDSgetDDS()************************************************************************ For the test server this method does the following: Makes a new test_ServerFactory (aka BaseTypeFactory) for the dataset requested.openCachedDAS(opendap.servlet.ReqState rs) ************************************************************************ Opens a DAS cached on local disk.openCachedDDS(opendap.servlet.ReqState rs) ************************************************************************ Opens a DDS cached on local disk.openCachedDDX(opendap.servlet.ReqState rs) ************************************************************************ Opens a DDX cached on local disk.voidrelease()
-
Constructor Details
-
testDataset
public testDataset(opendap.servlet.ReqState rs)
-
-
Method Details
-
release
public void release()- Specified by:
releasein interfaceopendap.servlet.GuardedDataset
-
close
public void close()- Specified by:
closein interfaceopendap.servlet.GuardedDataset
-
getDDS
public opendap.servers.ServerDDS getDDS() throws opendap.dap.DAP2Exception, opendap.dap.parsers.ParseException************************************************************************ For the test server this method does the following:- Makes a new test_ServerFactory (aka BaseTypeFactory) for the dataset requested.
- Instantiates a ServerDDS using the test_ServerFactory and populates it (this is accomplished by opening a locally cached DDS from a file and parsing it)
- Returns this freshly minted ServerDDS object (to the servlet code where it is used.)
- Specified by:
getDDSin interfaceopendap.servlet.GuardedDataset- Returns:
- The
ServerDDSfor the named data set. - Throws:
opendap.dap.DAP2Exceptionopendap.dap.parsers.ParseException- See Also:
-
ServerDDStest_ServerFactory
-
openCachedDDX
************************************************************************ Opens a DDX cached on local disk. This can be used on OPeNDAP servers (such as the OPeNDAP SQL Server) that rely on locally cached DDX files as opposed to dynamically generated DDS's.This method uses the
ServletConfigobject cached by in theReqStateobject to locate the servlet init parameter DDXcache to determine where to look for the cached DDX document. If the init parameter was not set then theReqState.defaultDDXcachevariable is used as the location of the DDX cache.If the DDX cannot be found an error is sent back to the client.
- Parameters:
rs- TheReqStateobject for this invocation of the servlet.- Returns:
- An open
DataInputStreamfrom which the DDX can be read. - See Also:
-
ReqState
-
openCachedDDS
************************************************************************ Opens a DDS cached on local disk. This can be used on OPeNDAP servers (such as the OPeNDAP SQL Server) that rely on locally cached DDS files as opposed to dynamically generated DDS's.This method uses the
ServletConfigobject cached by in theReqStateobject to locate the servlet init parameter DDScache to determine where to look for the cachedDDS. If the init parameter was not set then theReqState.defaultDDScachevariable is used as the location of the DDS cache.If the DDS cannot be found an error is sent back to the client.
- Parameters:
rs- TheReqStateobject for this invocation of the servlet.- Returns:
- An open
DataInputStreamfrom which the DDS can be read. - See Also:
-
ReqState
-
getDAS
public opendap.dap.DAS getDAS() throws opendap.dap.DAP2Exception, opendap.dap.parsers.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 "DAScache" <init-param> in the web.xml file. If the there is no file available a DAP2Exception 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 OPeNDAP server being implemented can generate the DAS information dynamically. When overriding this method be sure that it does the following:- Instantiates the DAS for the indicated (passed) dataset and populates it. This is accomplished in the default implementation by opening a (cached?) DAS stored in a file and parsing it. In a different implementation it could be created dynamically.
- Returns this freshly minted DAS object. (to the servlet code where it is used.)
- Specified by:
getDASin interfaceopendap.servlet.GuardedDataset- Returns:
- The DAS object for the data set specified in the parameter
dataSet - Throws:
opendap.dap.DAP2Exceptionopendap.dap.parsers.ParseException- See Also:
-
DAS
-
openCachedDAS
************************************************************************ Opens a DAS cached on local disk. This can be used on OPeNDAP servers (such as the OPeNDAP SQL Server) that rely on locally cached DAS files as opposed to dynamically generated DAS's.This method uses the
ServletConfigobject cached by in theReqStateobject to locate the servlet init parameter DAScache to determine where to look for the cachedDAS. If the init parameter was not set then theReqState.defaultDAScachevariable is used as the location of the DAS cache.If the DAS cannot be found an error is sent back to the client.
- Parameters:
rs- TheReqStateobject for this invocation of the servlet.- Returns:
- An open
DataInputStreamfrom which the DAS can be read. - Throws:
FileNotFoundException- See Also:
-
ReqState
-