|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.net.URLConnection
edu.wisc.ssec.mcidas.adde.AddeURLConnection
public class AddeURLConnection
This class extends URLConnection, providing the guts of the work to establish an ADDE network connection, put together a request packet, and initiate data flow. Connections for image data, image directories, grid data, grid directory, point source data and dataset information (McIDAS AGET, ADIR, GDIR, GGET, MDKS, TXTG and LWPR requests) are supported.
URLs must all have the following format: adde://host/request?keyword_1=value_1&keyword_2=value_2 where request can be one of the following: datasetinfo - request for data set information (LWPR) griddirectory - request for grid directory information (GDIR) griddata - request for grid data (GGET) imagedata - request for data in AreaFile format (AGET) imagedirectory - request for image directory information (ADIR) pointdata - request for point data (MDKS) textdata - request to read a text file (TXTG) There can be any valid combination of the following supported keywords: -------for any request group=ADDE group name user= ADDE user identification proj= a valid ADDE project number trace=<0/1> setting to 1 tells server to write debug trace file (imagedata, imagedirectory) version= ADDE version number, currently 1 except for griddata requests debug= set to true to watch the printlns stream by compress= set to true if you want to use compressed transfers. You need to have the VisAD package if you want to support this. -------for images: descr= ADDE descriptor name band= spectral band or channel number mag= image magnification, postitive for blowup, negative for blowdown (default = 1, emag=lmag) (imagedata only) latlon= lat/lon point to center image on (imagedata only) linele= line/element to center image on (imagedata only) place= placement of lat/lon or linele points (center or upperleft (def=center)) (imagedata only) pos= request an absolute or relative ADDE position number size= size of image to be returned (imagedata only) unit= to specify calibration units other than the default spac= number of bytes per data point, 1, 2, or 4 (imagedata only) doc= specify yes to include line documentation with image (def=no) aux= specify yes to include auxilliary information with image time= specify the time range of images to select (def=latest image if pos not specified) day= specify the day of the images to select (def=latest image if pos not specified) cal= request a specific calibration on the image (imagedata only) id= radar station id ------ for grids: descr= ADDE descriptor name param= parameter code list time= time in hhmmss format day= day in ccyyddd format lev= list of requested levels (value or SFC, MSL or TRO) ftime= valid time (hhmmss format) (use with fday) fday= forecast day (ccyyddd) fhour= forecast hours (offset from model run time) (hhmmss format) num= maximum number of grids to return (nn) ------ for point data: descr= ADDE descriptor name pos= request an absolute or relative ADDE position number select=
Field Summary | |
---|---|
static int |
ADIR
ADIR request type |
static int |
AGET
AGET request type |
static int |
GDIR
GDIR request type |
static int |
GGET
GGET request type |
static int |
LWPR
LWPR request type |
static int |
MDKS
MDKS request type |
static int |
OBTG
OBTG request type |
static int |
TXTG
TXTG request type |
static int |
WTXG
WTXG request type |
Fields inherited from class java.net.URLConnection |
---|
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, useCaches |
Method Summary | |
---|---|
void |
connect()
Establishes an ADDE connection using the URL passed to the constructor. |
java.lang.StringBuffer |
decodeLWPRString(java.lang.String uCmd)
Decode the ADDE request for data set information. |
java.lang.StringBuffer |
decodeOBTGString(java.lang.String uCmd)
Decode the ADDE request for a weather observation text. |
java.lang.StringBuffer |
decodeTXTGString(java.lang.String uCmd)
Decode the ADDE request for a text file. |
java.lang.StringBuffer |
decodeWTXGString(java.lang.String uCmd)
Decode the ADDE request for a weather text. |
java.io.DataInputStream |
getDataInputStream()
returns a reference to DataInputStream established in connect(). |
int |
getInitialRecordSize()
Return the number of bytes being sent by the server for the first record. |
java.io.InputStream |
getInputStream()
returns a reference to InputStream established in connect(). |
int |
getRequestType()
Get the request type |
Methods inherited from class java.net.URLConnection |
---|
addRequestProperty, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getHeaderFields, getIfModifiedSince, getLastModified, getOutputStream, getPermission, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setReadTimeout, setRequestProperty, setUseCaches, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int AGET
public static final int ADIR
public static final int LWPR
public static final int GDIR
public static final int GGET
public static final int MDKS
public static final int TXTG
public static final int WTXG
public static final int OBTG
Method Detail |
---|
public void connect() throws java.io.IOException, AddeURLException
connect
in class java.net.URLConnection
java.io.IOException
AddeURLException
public int getRequestType()
public java.io.InputStream getInputStream() throws java.io.IOException
getInputStream
in class java.net.URLConnection
java.io.IOException
public java.io.DataInputStream getDataInputStream() throws java.io.IOException
java.io.IOException
public int getInitialRecordSize()
public java.lang.StringBuffer decodeTXTGString(java.lang.String uCmd)
there can be any valid combination of the following supported keywords: file=the text file name on the server descr= the dataset name on the server group= the ADDE group name for this TEXT the following keywords are required: file or descr an example URL might look like: adde://viper/text?group=textdata&file=myfile.txt
public java.lang.StringBuffer decodeWTXGString(java.lang.String uCmd)
there can be any valid combination of the following supported keywords: group=weather text group (default= RTWXTEXT) prod= predefind product name apro= AFOS/AWIPS product headers to match (don't use with wmo keyword astn= AFOS/AWIPS stations to match wmo= WMO product headers to match (don't use with apro keyword wstn= WMO stations to match day= range of days to search dtime= maximum number of hours to search back (def=96) match= list of character match strings to find from text num= number of matches to find (def=1) the following keywords are required: day (should default to current, but there's a bug) apro, astn or wstn an example URL might look like: adde://viper/text?group=textdata&file=myfile.txt
public java.lang.StringBuffer decodeOBTGString(java.lang.String uCmd)
there can be any valid combination of the following supported keywords: group=weather text group (default= RTWXTEXT) descr= weather text subgroup (default=SFCHOURLY) id= list of station ids co= list of countries reg= list of regions newest= most recent time to allow in request (def=current time) oldest= oldest observation time to allow in request type= numeric value for the type of ob nhours= maximum number of hours to search num= number of matches to find (def=1) the following keywords are required: group descr id, co, or reg an example URL might look like: adde://adde.ucar.edu/obtext?group=rtwxtext&descr=sfchourly&id=kden&num=2
public java.lang.StringBuffer decodeLWPRString(java.lang.String uCmd)
there can be any valid combination of the following supported keywords: group=ADDE group name type= ADDE data type. Must be one of the following: IMAGE, POINT, GRID, TEXT, NAV the default is the IMAGE type. the following keywords are required: group an example URL might look like: adde://viper/datasetinfo?group=gvar&type=image
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |