edu.wisc.ssec.mcidas.adde
Class AddePointURL

java.lang.Object
  extended by edu.wisc.ssec.mcidas.adde.AddeURL
      extended by edu.wisc.ssec.mcidas.adde.AddeDatasetURL
          extended by edu.wisc.ssec.mcidas.adde.AddePointURL
All Implemented Interfaces:
Cloneable

public class AddePointURL
extends AddeDatasetURL

A class for holding the ADDE URL for an image directory or data request. Decode the ADDE request for point data. If the request contains specific parameters (eg param=t), then the class variable binaryData is set to this param string

   group=<groupname>         ADDE group name
   descr=<descriptor>        ADDE descriptor name
   pos=<position>            request an absolute or relative ADDE
                               position number
   select=<select clause>    to specify which data is required
   param=<param list>        what parameters to return
                             eg param=t[c]
                             note that the units [c] are ignored by server
                             it is the clients task to convert units
                             Note that if "param=" is used,
                             binaryData is set to the
                             (processed) parameter list
   max=<max>                 maximum number of obs to return
   trace=<0/1>               setting to 1 tells server to write debug
                               trace file (imagedata, imagedirectory)
   binaryData=<param list>   because an unlimited number of parameters may
                             be requested, these must be packaged up at the end
                             of the adde request, and this is known as the
                             "binary data" part of the request

 the following keywords are required:

   group

 an example URL might look like:
   adde://rtds/point?group=neons&descr=metar

 


Field Summary
static String KEY_MAX
          Keyword for MAX
static String KEY_NUM
          Keyword for MAX
static String KEY_PARAM
          Keyword for PARAM
static String KEY_POS
          Keyword for POS
static String KEY_SELECT
          Keyword for SELECT
 
Fields inherited from class edu.wisc.ssec.mcidas.adde.AddeDatasetURL
KEY_DESCRIPTOR, KEY_GROUP
 
Fields inherited from class edu.wisc.ssec.mcidas.adde.AddeURL
ADDE_PROTOCOL, ALL, COMPRESS, DEFAULT_VALUE, GZIP, KEY_COMPRESS, KEY_DEBUG, KEY_PORT, KEY_PROJ, KEY_TRACE, KEY_USER, KEY_VERSION, NO, NO_COMPRESS, REQ_ADIR, REQ_AGET, REQ_DATASETINFO, REQ_GDIR, REQ_GGET, REQ_GRIDDATA, REQ_GRIDDIR, REQ_IMAGEDATA, REQ_IMAGEDIR, REQ_LWPR, REQ_MDKS, REQ_OBTEXT, REQ_OBTG, REQ_POINTDATA, REQ_TEXT, REQ_TXTG, REQ_WTXG, REQ_WXTEXT, TRACE_OFF, TRACE_ON, YES
 
Constructor Summary
AddePointURL()
          no arg constructor
AddePointURL(String host, String requestType, String group, String descriptor)
          Create an AddePointURL.
AddePointURL(String host, String requestType, String group, String descriptor, String query)
          Create an ADDE PointURL from the given specs.
AddePointURL(String host, String requestType, String group, String descriptor, String position, String select, String paramList, int maxNum)
          Create an ADDE Point URL from the given spec
 
Method Summary
static AddePointURL decodeURL(String baseURL)
          Decode a URL and return an AddePointURL
 int getMaxNumber()
          Get the MAX value
 String getParams()
          Get the PARAM value
 String getPosition()
          Get the POS value
 String getSelectClause()
          Get the SELECT value
static void main(String[] args)
          Test the parsing
protected  String makeQuery()
          Create the ADDE URL
protected  void parseQuery(String query)
          Parse the query string and set the values accordingly, subclasses should extend to parse their particular keywords
 void setMaxNumber(int value)
          Set the MAX value
 void setParams(String value)
          Set the PARAM value
 void setPosition(String value)
          Set the POS value
 void setSelectClause(String value)
          Set the SELECT clause
 
Methods inherited from class edu.wisc.ssec.mcidas.adde.AddeDatasetURL
getDescriptor, getGroup, setDescriptor, setGroup
 
Methods inherited from class edu.wisc.ssec.mcidas.adde.AddeURL
appendKeyValue, clone, equals, getCompression, getDebug, getExtraKeys, getHost, getPort, getProject, getRequestType, getTrace, getURLString, getUser, getValue, getVersion, hashCode, setCompression, setCompressionFromString, setDebug, setExtraKeys, setHost, setPort, setProject, setRequestType, setTrace, setUser, setVersion
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SELECT

public static final String KEY_SELECT
Keyword for SELECT

See Also:
Constant Field Values

KEY_PARAM

public static final String KEY_PARAM
Keyword for PARAM

See Also:
Constant Field Values

KEY_MAX

public static final String KEY_MAX
Keyword for MAX

See Also:
Constant Field Values

KEY_NUM

public static final String KEY_NUM
Keyword for MAX

See Also:
Constant Field Values

KEY_POS

public static final String KEY_POS
Keyword for POS

See Also:
Constant Field Values
Constructor Detail

AddePointURL

public AddePointURL()
no arg constructor


AddePointURL

public AddePointURL(String host,
                    String requestType,
                    String group,
                    String descriptor)
Create an AddePointURL.

Parameters:
host - host to send to
requestType - type of request (REQ_IMAGEDATA, REQ_IMAGEDIR)
group - ADDE group
descriptor - ADDE descriptor

AddePointURL

public AddePointURL(String host,
                    String requestType,
                    String group,
                    String descriptor,
                    String query)
Create an ADDE PointURL from the given specs.

Parameters:
host - host to send to
requestType - type of request (REQ_IMAGEDATA, REQ_IMAGEDIR)
group - ADDE group (may be null)
descriptor - ADDE descriptor (may be null)
query - query string (key/value pairs)

AddePointURL

public AddePointURL(String host,
                    String requestType,
                    String group,
                    String descriptor,
                    String position,
                    String select,
                    String paramList,
                    int maxNum)
Create an ADDE Point URL from the given spec

Parameters:
host - host to send to
requestType - type of request (REQ_IMAGEDATA, REQ_IMAGEDIR)
group - ADDE group
descriptor - ADDE descriptor
position - dataset position (number or ALL)
select - select clause
paramList - parameter list
maxNum - maximum number to return
Method Detail

getSelectClause

public String getSelectClause()
Get the SELECT value

Returns:
the PLACE value

setSelectClause

public void setSelectClause(String value)
Set the SELECT clause

Parameters:
value - the SELECT clause

getParams

public String getParams()
Get the PARAM value

Returns:
the PARAM value

setParams

public void setParams(String value)
Set the PARAM value

Parameters:
value - the PARAM clause

getMaxNumber

public int getMaxNumber()
Get the MAX value

Returns:
the MAX value

setMaxNumber

public void setMaxNumber(int value)
Set the MAX value

Parameters:
value - the MAX clause

getPosition

public String getPosition()
Get the POS value

Returns:
the POS value (number or ALL)

setPosition

public void setPosition(String value)
Set the POS value

Parameters:
value - the POS clause (number or ALL)

makeQuery

protected String makeQuery()
Create the ADDE URL

Overrides:
makeQuery in class AddeDatasetURL
Returns:
a Adde URL

decodeURL

public static AddePointURL decodeURL(String baseURL)
Decode a URL and return an AddePointURL

Parameters:
baseURL - url to decode
Returns:
an AddePointURL object (or null)

parseQuery

protected void parseQuery(String query)
Parse the query string and set the values accordingly, subclasses should extend to parse their particular keywords

Overrides:
parseQuery in class AddeDatasetURL
Parameters:
query - query string

main

public static void main(String[] args)
Test the parsing

Parameters:
args - url to parse