public class DTSServlet
extends opendap.servlet.AbstractServlet
<servlet>
<servlet-name>
dts
</servlet-name>
<servlet-class>
opendap.servers.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-OPeNDAP/sdds-testsuite/info/</param-value>
</init-param>
<init-param>
<param-name>DDScache</param-name>
<param-value>/usr/Java-OPeNDAP/sdds-testsuite/dds/</param-value>
</init-param>
<init-param>
<param-name>DAScache</param-name>
<param-value>/usr/Java-OPeNDAP/sdds-testsuite/das/</param-value>
</init-param>
</servlet>
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
DTSServlet()
************************************************************************
Intitializes the servlet.
|
| Modifier and Type | Method and Description |
|---|---|
void |
anyExceptionHandler(java.lang.Throwable e,
opendap.servlet.ReqState rs)
Sends an error to the client.
|
void |
badURL(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Sends an html document to the client explaining that they have used a
poorly formed URL and then the help page...
|
void |
dap2ExceptionHandler(opendap.dap.DAP2Exception de,
javax.servlet.http.HttpServletResponse response)
Sends a OPeNDAP DAP2 error to the client.
|
void |
doDebug(opendap.servlet.ReqState rs)
Handler for debug requests;
|
protected boolean |
doDebugCmd(java.lang.String cmd,
java.util.StringTokenizer tz,
java.io.PrintStream pw) |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles incoming requests from clients.
|
void |
doGetASC(opendap.servlet.ReqState rs)
Handler for OPeNDAP ascii data requests.
|
void |
doGetBLOB(opendap.servlet.ReqState rs)
Handler for the client's data request.
|
void |
doGetCatalog(opendap.servlet.ReqState rs)
Handler for OPeNDAP catalog.xml requests.
|
void |
doGetDAP2Data(opendap.servlet.ReqState rs)
Handler for the client's data request.
|
void |
doGetDAS(opendap.servlet.ReqState rs)
Handler for the client's DAS request.
|
void |
doGetDDS(opendap.servlet.ReqState rs)
Handler for the client's DDS request.
|
void |
doGetDDX(opendap.servlet.ReqState rs)
Handler for the client's DDX request.
|
void |
doGetDIR(opendap.servlet.ReqState rs)
Handler for the client's directory request.
|
void |
doGetHELP(opendap.servlet.ReqState rs)
Handler for the client's help request.
|
void |
doGetHTML(opendap.servlet.ReqState rs)
Handler for OPeNDAP .html requests.
|
void |
doGetINFO(opendap.servlet.ReqState rs)
Handler for OPeNDAP info requests.
|
void |
doGetStatus(opendap.servlet.ReqState rs)
Handler for OPeNDAP status requests; not publically available,
used only for debugging
|
void |
doGetSystemProps(opendap.servlet.ReqState rs)
Handler for OPeNDAP status requests; not publically available,
used only for debugging
|
void |
doGetVER(opendap.servlet.ReqState rs)
Handler for the client's version request.
|
protected opendap.servlet.GuardedDataset |
getDataset(opendap.servlet.ReqState rs)
************************************************************************
This method must be implemented locally for each OPeNDAP server.
|
protected opendap.servlet.ReqState |
getRequestState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
java.lang.String |
getRootPath()
Getter function for rootpath
|
java.lang.String |
getServerName()
In this (default) implementation of the getServerName() method we just get
the name of the servlet and pass it back.
|
java.lang.String |
getServerVersion()
This method returns a String containing the OPeNDAP Server Version...
|
void |
init() |
void |
IOExceptionHandler(java.io.IOException e,
opendap.servlet.ReqState rs)
Sends an error to the client.
|
void |
parseExceptionHandler(opendap.dap.parsers.ParseException pe,
javax.servlet.http.HttpServletResponse response)
Turns a ParseException into a OPeNDAP DAP2 error and sends it to the client.
|
protected void |
printCatalog(opendap.servlet.ReqState rs,
java.io.PrintWriter os) |
protected void |
printStatus(java.io.PrintWriter os) |
void |
probeRequest(java.io.PrintStream ps,
opendap.servlet.ReqState rs)
This is a bit of instrumentation that I kept around to let me look at the
state of the incoming
HttpServletRequest from the client. |
void |
sendDODSError(opendap.servlet.ReqState rs,
java.lang.String clientMsg,
java.lang.String serverMsg)
Sends a OPeNDAP DAP2 error (type UNKNOWN ERROR) to the client and displays a
message on the server console.
|
badURL, doDebugCmd, printDODSException, printThrowable, probeRequest, sendDODSError, setLogdoDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicepublic DTSServlet()
public java.lang.String getRootPath()
getRootPath in class opendap.servlet.AbstractServletpublic java.lang.String getServerVersion()
getServerVersion in class opendap.servlet.AbstractServletprotected opendap.servlet.GuardedDataset getDataset(opendap.servlet.ReqState rs)
throws opendap.dap.DAP2Exception,
java.io.IOException,
opendap.dap.parsers.ParseException
getDataset in class opendap.servlet.AbstractServletrs - The ReqState object for this particular client request.opendap.dap.DAP2Exceptionjava.io.IOExceptionopendap.dap.parsers.ParseExceptionpublic void init()
throws javax.servlet.ServletException
init in class opendap.servlet.AbstractServletjavax.servlet.ServletExceptionpublic void parseExceptionHandler(opendap.dap.parsers.ParseException pe,
javax.servlet.http.HttpServletResponse response)
parseExceptionHandler in class opendap.servlet.AbstractServletpe - The ParseException that caused the problem.response - The HttpServletResponse for the client.public void dap2ExceptionHandler(opendap.dap.DAP2Exception de,
javax.servlet.http.HttpServletResponse response)
dap2ExceptionHandler in class opendap.servlet.AbstractServletde - The OPeNDAP DAP2 exception that caused the problem.response - The HttpServletResponse for the client.public void IOExceptionHandler(java.io.IOException e,
opendap.servlet.ReqState rs)
IOExceptionHandler in class opendap.servlet.AbstractServlete - The exception that caused the problem.rs - The ReqState for the client.public void anyExceptionHandler(java.lang.Throwable e,
opendap.servlet.ReqState rs)
anyExceptionHandler in class opendap.servlet.AbstractServlete - The exception that caused the problem.rs - The ReqState for the client.public void sendDODSError(opendap.servlet.ReqState rs,
java.lang.String clientMsg,
java.lang.String serverMsg)
throws java.lang.Exception
rs - The client's ReqState object.clientMsg - Error message String to send to the client.serverMsg - Error message String to display on the server console.java.lang.Exceptionpublic void doGetDAS(opendap.servlet.ReqState rs)
throws java.lang.Exception
Once the DAS has been parsed it is sent to the requesting client.
doGetDAS in class opendap.servlet.AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.java.lang.ExceptionReqStatepublic void doGetDDS(opendap.servlet.ReqState rs)
throws java.lang.Exception
Once the DDS has been parsed and constrained it is sent to the requesting client.
doGetDDS in class opendap.servlet.AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.java.lang.ExceptionReqStatepublic void doGetDDX(opendap.servlet.ReqState rs)
throws java.lang.Exception
Once the DDX has been parsed and constrained it is sent to the requesting client.
doGetDDX in class opendap.servlet.AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.java.lang.ExceptionReqStatepublic void doGetBLOB(opendap.servlet.ReqState rs)
throws java.lang.Exception
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.
doGetBLOB in class opendap.servlet.AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.java.lang.ExceptionReqStatepublic void doGetDAP2Data(opendap.servlet.ReqState rs)
throws java.lang.Exception
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.
doGetDAP2Data in class opendap.servlet.AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.java.io.IOExceptionjavax.servlet.ServletExceptionjava.lang.ExceptionReqStatepublic void doGetDIR(opendap.servlet.ReqState rs)
throws java.lang.Exception
doGetDIR in class opendap.servlet.AbstractServletrs - The client's ReqStatejava.lang.ExceptionGetDirHandlerpublic void doGetVER(opendap.servlet.ReqState rs)
throws java.lang.Exception
Returns a plain text document with server version and OPeNDAP core version #'s
doGetVER in class opendap.servlet.AbstractServletrs - The client's ReqStatejava.lang.Exceptionpublic void doGetHELP(opendap.servlet.ReqState rs)
throws java.lang.Exception
Returns an html page of help info for the server
doGetHELP in class opendap.servlet.AbstractServletrs - The client's ReqState java.lang.Exceptionpublic void badURL(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
request - The client's request response - The client responsejava.lang.Exceptionpublic void doGetASC(opendap.servlet.ReqState rs)
throws java.lang.Exception
doGetASC in class opendap.servlet.AbstractServletrs - the decoded Request Statejava.lang.Exceptionpublic void doGetINFO(opendap.servlet.ReqState rs)
throws java.lang.Exception
doGetINFO in class opendap.servlet.AbstractServletrs - The client's ReqState java.lang.ExceptionGetInfoHandlerpublic void doGetHTML(opendap.servlet.ReqState rs)
throws java.lang.Exception
doGetHTML in class opendap.servlet.AbstractServletrs - The client's ReqStatejava.lang.ExceptionGetHTMLInterfaceHandlerpublic void doGetCatalog(opendap.servlet.ReqState rs)
throws java.lang.Exception
doGetCatalog in class opendap.servlet.AbstractServletrs - The client's ReqState java.lang.ExceptionGetHTMLInterfaceHandlerprotected void printCatalog(opendap.servlet.ReqState rs,
java.io.PrintWriter os)
throws java.io.IOException
printCatalog in class opendap.servlet.AbstractServletjava.io.IOExceptionpublic void doDebug(opendap.servlet.ReqState rs)
doDebug in class opendap.servlet.AbstractServletrs - The client's ReqState object.protected boolean doDebugCmd(java.lang.String cmd,
java.util.StringTokenizer tz,
java.io.PrintStream pw)
public void doGetSystemProps(opendap.servlet.ReqState rs)
throws java.lang.Exception
doGetSystemProps in class opendap.servlet.AbstractServletrs - The client's ReqState java.lang.ExceptionGetHTMLInterfaceHandlerpublic void doGetStatus(opendap.servlet.ReqState rs)
throws java.lang.Exception
doGetStatus in class opendap.servlet.AbstractServletrs - The client's ReqStatejava.lang.ExceptionGetHTMLInterfaceHandlerprotected void printStatus(java.io.PrintWriter os)
printStatus in class opendap.servlet.AbstractServletpublic void probeRequest(java.io.PrintStream ps,
opendap.servlet.ReqState rs)
HttpServletRequest from the client.
This method calls the get* methods of the request and prints
the results to standard out.ps - The PrintStream to send output.rs - The ReqState object to probe.public java.lang.String getServerName()
getServerName in class opendap.servlet.AbstractServletpublic void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
DTSServlet.doGet in class opendap.servlet.AbstractServletrequest - The client's HttpServletRequest request
object.response - The server's HttpServletResponse response
object.ReqStateprotected opendap.servlet.ReqState getRequestState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
getRequestState in class opendap.servlet.AbstractServletrequest -