Package dap4.dap4lib
Class HttpDSP
- java.lang.Object
-
- dap4.dap4lib.AbstractDSP
-
- dap4.dap4lib.serial.D4DSP
-
- dap4.dap4lib.HttpDSP
-
- All Implemented Interfaces:
dap4.core.data.DSP
public class HttpDSP extends D4DSP
Make a request to a server and convert the reply to a DapDataset from the returned bytes.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanallowCompressionprotected Stringbaseceprotected static StringCONSTRAINTTAGprotected Objectcontextprotected static String[]DAP4EXTENSIONSprotected static String[][]DAP4FRAGMARKERSprotected static StringDAP4PROTOprotected static String[][]DAP4QUERYMARKERSprotected static String[]DAP4SCHEMESprotected static String[]DAPEXTENSIONSprotected static StringDAPVERSIONprotected static StringDATASUFFIXprotected static booleanDEBUGprotected static intDFALTPRELOADSIZEprotected static StringDMRSUFFIXprotected static StringDMRVERSIONprotected static StringDSRSUFFIXprotected static StringFILEPROTOprotected static StringPROTOTAGprotected static StringQUERYSTARTprotected intstatusprotected XURIxuri-
Fields inherited from class dap4.dap4lib.serial.D4DSP
databuffer, DUMPDAP, DUMPDMR
-
Fields inherited from class dap4.dap4lib.AbstractDSP
dmr, DMRNS, location, PARSEDEBUG, rootcursor, TESTING, UCARTAGOPAQUE, UCARTAGORIGTYPE, UCARTAGUNLIMITED, UCARTAGVLEN, USEDOM, variables
-
-
Constructor Summary
Constructors Constructor Description HttpDSP()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuild()Open a connection and make a request for the (possibly constrained) DMR.protected static StringbuildURL(String baseurl, String suffix, dap4.core.dmr.DapDataset template, String ce)protected InputStreamcallServer(String methodurl)voidclose()booleandspMatch(String url, dap4.core.util.DapContext context)A path is a DAP4 path if at least one of the following is true.StringgetCapabilities(String url)Provide a method for getting the capabilities document.HttpDSPopen(String url)"open" a reference to a data source and return the DSP wrapper.protected voidparseURL(String url)-
Methods inherited from class dap4.dap4lib.AbstractDSP
addVariableData, getChecksumMode, getContext, getDMR, getLocation, getOrder, getVariableData, parseDMR, printDMR, processAttributes, setChecksumMode, setContext, setDataset, setDMR, setLocation, setOrder, suppress
-
-
-
-
Field Detail
-
DEBUG
protected static final boolean DEBUG
- See Also:
- Constant Field Values
-
DAPVERSION
protected static final String DAPVERSION
- See Also:
- Constant Field Values
-
DMRVERSION
protected static final String DMRVERSION
- See Also:
- Constant Field Values
-
DAP4PROTO
protected static final String DAP4PROTO
- See Also:
- Constant Field Values
-
FILEPROTO
protected static final String FILEPROTO
- See Also:
- Constant Field Values
-
DMRSUFFIX
protected static final String DMRSUFFIX
- See Also:
- Constant Field Values
-
DATASUFFIX
protected static final String DATASUFFIX
- See Also:
- Constant Field Values
-
DSRSUFFIX
protected static final String DSRSUFFIX
- See Also:
- Constant Field Values
-
QUERYSTART
protected static final String QUERYSTART
- See Also:
- Constant Field Values
-
CONSTRAINTTAG
protected static final String CONSTRAINTTAG
- See Also:
- Constant Field Values
-
PROTOTAG
protected static final String PROTOTAG
- See Also:
- Constant Field Values
-
DFALTPRELOADSIZE
protected static final int DFALTPRELOADSIZE
- See Also:
- Constant Field Values
-
DAPEXTENSIONS
protected static final String[] DAPEXTENSIONS
-
DAP4EXTENSIONS
protected static final String[] DAP4EXTENSIONS
-
DAP4QUERYMARKERS
protected static final String[][] DAP4QUERYMARKERS
-
DAP4FRAGMARKERS
protected static final String[][] DAP4FRAGMARKERS
-
DAP4SCHEMES
protected static final String[] DAP4SCHEMES
-
allowCompression
protected boolean allowCompression
-
basece
protected String basece
-
status
protected int status
-
xuri
protected XURI xuri
-
context
protected Object context
-
-
Method Detail
-
dspMatch
public boolean dspMatch(String url, dap4.core.util.DapContext context)
A path is a DAP4 path if at least one of the following is true. 1. it has "dap4:" as its leading protocol 2. it has #protocol=dap4 in its fragment- Parameters:
url-context- Any parameters that may help to decide.- Returns:
- true if this url appears to be processible by this DSP
-
open
public HttpDSP open(String url) throws dap4.core.util.DapException
Description copied from class:AbstractDSP"open" a reference to a data source and return the DSP wrapper.- Specified by:
openin interfacedap4.core.data.DSP- Specified by:
openin classAbstractDSP- Parameters:
url- - Object that defines the data source- Returns:
- = wrapping dsp
- Throws:
dap4.core.util.DapException
-
close
public void close()
- Specified by:
closein interfacedap4.core.data.DSP- Specified by:
closein classAbstractDSP
-
build
protected void build() throws dap4.core.util.DapExceptionOpen a connection and make a request for the (possibly constrained) DMR.- Throws:
dap4.core.util.DapException
-
callServer
protected InputStream callServer(String methodurl) throws dap4.core.util.DapException
- Throws:
dap4.core.util.DapException
-
getCapabilities
public String getCapabilities(String url) throws IOException
Provide a method for getting the capabilities document.- Parameters:
url- for accessing the document- Throws:
dap4.core.util.DapExceptionIOException
-
buildURL
protected static String buildURL(String baseurl, String suffix, dap4.core.dmr.DapDataset template, String ce)
-
parseURL
protected void parseURL(String url) throws dap4.core.util.DapException
- Throws:
dap4.core.util.DapException
-
-