public class DTSServlet extends 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 |
|---|---|
protected boolean |
allowDeflate
Support compressions or not
|
static org.slf4j.Logger |
log |
| Constructor and Description |
|---|
DTSServlet()
************************************************************************
Intitializes the servlet.
|
| Modifier and Type | Method and Description |
|---|---|
void |
anyExceptionHandler(Throwable e,
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(DAP2Exception de,
javax.servlet.http.HttpServletResponse response)
Sends a OPeNDAP DAP2 error to the client.
|
void |
doDebug(ReqState rs)
Handler for debug requests;
|
protected boolean |
doDebugCmd(String cmd,
StringTokenizer tz,
PrintStream pw) |
void |
doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles incoming requests from clients.
|
void |
doGetASC(ReqState rs)
Handler for OPeNDAP ascii data requests.
|
void |
doGetBLOB(ReqState rs)
Handler for the client's data request.
|
void |
doGetCatalog(ReqState rs)
Handler for OPeNDAP catalog.xml requests.
|
void |
doGetDAP2Data(ReqState rs)
Handler for the client's data request.
|
void |
doGetDAS(ReqState rs)
Handler for the client's DAS request.
|
void |
doGetDDS(ReqState rs)
Handler for the client's DDS request.
|
void |
doGetDDX(ReqState rs)
Handler for the client's DDX request.
|
void |
doGetDIR(ReqState rs)
Handler for the client's directory request.
|
void |
doGetHELP(ReqState rs)
Handler for the client's help request.
|
void |
doGetHTML(ReqState rs)
Handler for OPeNDAP .html requests.
|
void |
doGetINFO(ReqState rs)
Handler for OPeNDAP info requests.
|
void |
doGetStatus(ReqState rs)
Handler for OPeNDAP status requests; not publically available,
used only for debugging
|
void |
doGetSystemProps(ReqState rs)
Handler for OPeNDAP status requests; not publically available,
used only for debugging
|
void |
doGetVER(ReqState rs)
Handler for the client's version request.
|
protected GuardedDataset |
getDataset(ReqState rs)
************************************************************************
This method must be implemented locally for each OPeNDAP server.
|
protected ReqState |
getRequestState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
String |
getRootPath()
Getter function for rootpath
|
String |
getServerName()
In this (default) implementation of the getServerName() method we just get
the name of the servlet and pass it back.
|
String |
getServerVersion()
This method returns a String containing the OPeNDAP Server Version...
|
void |
init() |
void |
IOExceptionHandler(IOException e,
ReqState rs)
Sends an error to the client.
|
void |
parseExceptionHandler(ParseException pe,
javax.servlet.http.HttpServletResponse response)
Turns a ParseException into a OPeNDAP DAP2 error and sends it to the client.
|
protected void |
printCatalog(ReqState rs,
PrintWriter os) |
protected void |
printStatus(PrintWriter os) |
void |
probeRequest(PrintStream ps,
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(ReqState rs,
String clientMsg,
String serverMsg)
Sends a OPeNDAP DAP2 error (type UNKNOWN ERROR) to the client and displays a
message on the server console.
|
badURL, printDODSException, printThrowable, sendDODSError, setLogdoDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicepublic static org.slf4j.Logger log
protected boolean allowDeflate
public DTSServlet()
public String getRootPath()
getRootPath in class AbstractServletpublic String getServerVersion()
getServerVersion in class AbstractServletprotected GuardedDataset getDataset(ReqState rs) throws DAP2Exception, IOException, ParseException
getDataset in class AbstractServletrs - The ReqState object for this particular client request.DAP2ExceptionIOExceptionParseExceptionpublic void init()
throws javax.servlet.ServletException
init in class AbstractServletjavax.servlet.ServletExceptionpublic void parseExceptionHandler(ParseException pe, javax.servlet.http.HttpServletResponse response)
parseExceptionHandler in class AbstractServletpe - The ParseException that caused the problem.response - The HttpServletResponse for the client.public void dap2ExceptionHandler(DAP2Exception de, javax.servlet.http.HttpServletResponse response)
dap2ExceptionHandler in class AbstractServletde - The OPeNDAP DAP2 exception that caused the problem.response - The HttpServletResponse for the client.public void IOExceptionHandler(IOException e, ReqState rs)
IOExceptionHandler in class AbstractServlete - The exception that caused the problem.rs - The ReqState for the client.public void anyExceptionHandler(Throwable e, ReqState rs)
anyExceptionHandler in class AbstractServlete - The exception that caused the problem.rs - The ReqState for the client.public void sendDODSError(ReqState rs, String clientMsg, String serverMsg) throws 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.Exceptionpublic void doGetDAS(ReqState rs) throws Exception
Once the DAS has been parsed it is sent to the requesting client.
doGetDAS in class AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.ExceptionReqStatepublic void doGetDDS(ReqState rs) throws Exception
Once the DDS has been parsed and constrained it is sent to the requesting client.
doGetDDS in class AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.ExceptionReqStatepublic void doGetDDX(ReqState rs) throws Exception
Once the DDX has been parsed and constrained it is sent to the requesting client.
doGetDDX in class AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.ExceptionReqStatepublic void doGetBLOB(ReqState rs) throws 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 AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.ExceptionReqStatepublic void doGetDAP2Data(ReqState rs) throws 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 AbstractServletrs - The ReqState of this client request. Contains all kinds of
important stuff.IOExceptionjavax.servlet.ServletExceptionExceptionReqStatepublic void doGetDIR(ReqState rs) throws Exception
doGetDIR in class AbstractServletrs - The client's ReqStateExceptionGetDirHandlerpublic void doGetVER(ReqState rs) throws Exception
Returns a plain text document with server version and OPeNDAP core version #'s
doGetVER in class AbstractServletrs - The client's ReqStateExceptionpublic void doGetHELP(ReqState rs) throws Exception
Returns an html page of help info for the server
doGetHELP in class AbstractServletrs - The client's ReqState Exceptionpublic void badURL(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws Exception
request - The client's request response - The client responseExceptionpublic void doGetASC(ReqState rs) throws Exception
doGetASC in class AbstractServletrs - the decoded Request StateExceptionpublic void doGetINFO(ReqState rs) throws Exception
doGetINFO in class AbstractServletrs - The client's ReqState ExceptionGetInfoHandlerpublic void doGetHTML(ReqState rs) throws Exception
doGetHTML in class AbstractServletrs - The client's ReqStateExceptionGetHTMLInterfaceHandlerpublic void doGetCatalog(ReqState rs) throws Exception
doGetCatalog in class AbstractServletrs - The client's ReqState ExceptionGetHTMLInterfaceHandlerprotected void printCatalog(ReqState rs, PrintWriter os) throws IOException
printCatalog in class AbstractServletIOExceptionpublic void doDebug(ReqState rs)
doDebug in class AbstractServletrs - The client's ReqState object.protected boolean doDebugCmd(String cmd, StringTokenizer tz, PrintStream pw)
doDebugCmd in class AbstractServletpublic void doGetSystemProps(ReqState rs) throws Exception
doGetSystemProps in class AbstractServletrs - The client's ReqState ExceptionGetHTMLInterfaceHandlerpublic void doGetStatus(ReqState rs) throws Exception
doGetStatus in class AbstractServletrs - The client's ReqStateExceptionGetHTMLInterfaceHandlerprotected void printStatus(PrintWriter os)
printStatus in class AbstractServletpublic void probeRequest(PrintStream ps, ReqState rs)
HttpServletRequest from the client.
This method calls the get* methods of the request and prints
the results to standard out.probeRequest in class AbstractServletps - The PrintStream to send output.rs - The ReqState object to probe.public String getServerName()
getServerName in class AbstractServletpublic void doGet(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
DTSServlet.doGet in class AbstractServletrequest - The client's HttpServletRequest request
object.response - The server's HttpServletResponse response
object.ReqStateprotected ReqState getRequestState(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
getRequestState in class AbstractServletrequest - Copyright © 1999-2013 UCAR/Unidata. All Rights Reserved.