public abstract class DapController
extends javax.servlet.http.HttpServlet
| Modifier and Type | Field and Description |
|---|---|
protected static String |
BIG_ENDIAN |
protected static DapCache |
cache |
protected static String |
DATAEXT |
static boolean |
DEBUG |
static long |
DEFAULTBINARYWRITELIMIT |
protected static String |
DMREXT |
protected static String |
DSREXT |
static boolean |
DUMPDATA |
static boolean |
DUMPDMR |
protected static String[] |
ENDINGS |
protected static String |
FAVICON |
protected boolean |
initialized |
protected static boolean |
IS_BIG_ENDIAN |
protected static String |
LITTLE_ENDIAN |
static boolean |
PARSEDEBUG |
static boolean |
TESTING |
| Constructor and Description |
|---|
DapController() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCommonHeaders(DapRequest drq) |
protected abstract void |
doCapabilities(DapRequest drq,
dap4.core.util.DapContext cxt)
Process a capabilities request.
|
protected void |
doData(DapRequest drq,
dap4.core.util.DapContext cxt)
Process a DataDMR request.
|
protected void |
doDMR(DapRequest drq,
dap4.core.util.DapContext cxt)
Process a DMR request.
|
protected void |
doDSR(DapRequest drq,
dap4.core.util.DapContext cxt)
Process a DSR request.
|
protected abstract void |
doFavicon(String icopath,
dap4.core.util.DapContext cxt)
Process a favicon request.
|
abstract long |
getBinaryWriteLimit()
Get the maximum # of bytes per request
|
protected static DapCache |
getCache() |
protected DapRequest |
getRequestState(javax.servlet.http.HttpServletRequest rq,
javax.servlet.http.HttpServletResponse rsp)
Merge the servlet inputs into a single object
for easier transport as well as adding value.
|
abstract String |
getResourcePath(DapRequest drq,
String location)
Convert a URL path into an absolute file path
Note that it is assumed than any leading servlet prefix has been removed.
|
abstract String |
getServletID()
Get the servlet name (with no leading or trailing slashes)
|
void |
handleRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res) |
void |
init() |
void |
initialize()
Initialize servlet/controller
|
static String |
printDMR(dap4.core.dmr.DapDataset dmr) |
protected void |
senderror(DapRequest drq,
int httpcode,
Throwable t)
Generate an error based on the parameters
|
protected static void |
setCache(DapCache cache) |
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, servicepublic static boolean TESTING
public static boolean DEBUG
public static boolean DUMPDMR
public static boolean DUMPDATA
public static boolean PARSEDEBUG
protected static final String BIG_ENDIAN
protected static final String LITTLE_ENDIAN
protected static boolean IS_BIG_ENDIAN
protected static final String DMREXT
protected static final String DATAEXT
protected static final String DSREXT
protected static final String[] ENDINGS
protected static final String FAVICON
public static final long DEFAULTBINARYWRITELIMIT
protected static DapCache cache
protected boolean initialized
protected static void setCache(DapCache cache)
protected static DapCache getCache()
protected abstract void doFavicon(String icopath, dap4.core.util.DapContext cxt) throws IOException
icopath - The path to the iconcxt - The dap contextIOExceptionprotected abstract void doCapabilities(DapRequest drq, dap4.core.util.DapContext cxt) throws IOException
cxt - The dapontextIOExceptionpublic abstract String getResourcePath(DapRequest drq, String location) throws dap4.core.util.DapException
drq - dap requestlocation - suffix of url pathIOExceptiondap4.core.util.DapExceptionpublic abstract long getBinaryWriteLimit()
public abstract String getServletID()
public void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic void initialize()
public void handleRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException
IOExceptionprotected void doDSR(DapRequest drq, dap4.core.util.DapContext cxt) throws IOException
IOExceptionprotected void doDMR(DapRequest drq, dap4.core.util.DapContext cxt) throws IOException
cxt - The dap contextIOExceptionprotected void doData(DapRequest drq, dap4.core.util.DapContext cxt) throws IOException
* @param cxt The dap context
IOExceptionprotected void addCommonHeaders(DapRequest drq) throws IOException
IOExceptionprotected DapRequest getRequestState(javax.servlet.http.HttpServletRequest rq, javax.servlet.http.HttpServletResponse rsp) throws IOException
rq - A Servlet request objectrsp - A Servlet response objectIOExceptionprotected void senderror(DapRequest drq, int httpcode, Throwable t) throws IOException
drq - DapRequesthttpcode - 0=>no code specifiedt - exception that caused the error; may be nullIOExceptionpublic static String printDMR(dap4.core.dmr.DapDataset dmr)