edu.wisc.ssec.mcidas.adde
Class AddeImageURL

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.AddeImageURL
All Implemented Interfaces:
Cloneable

public class AddeImageURL
extends AddeDatasetURL

A class for holding the ADDE URL for an image directory or data request.

 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:

   imagedata - request for data in AreaFile format (AGET)
   imagedirectory - request for image directory information (ADIR)

 There can be any valid combination of the following supported keywords:

   group=<groupname>         ADDE group name
   descr=<descriptor>        ADDE descriptor name
   band=<band>               spectral band or channel number
   mag=<lmag> <emag>         image magnification, postitive for blowup,
                               negative for blowdown (default = 1, emag=lmag)
                               (imagedata only)
   latlon=<lat> <lon>        lat/lon point to center image on (imagedata only)
   linele=<lin> <ele> <type> line/element to center image on (imagedata only)
   place=<placement>         placement of lat/lon or linele points (center
                               or upperleft (def=center)) (imagedata only)
   pos=<position>            request an absolute or relative ADDE position
                               number.  May use <start> <end>  Default
                               for <end> is 0 if start<0, or =start otherwise.
   size=<lines> <elements>   size of image to be returned (imagedata only)
   unit=<unit>               to specify calibration units other than the
                               default
   spac=<bytes>              number of bytes per data point, 1, 2, or 4
                               (imagedata only)
   doc=<yes/no>              specify yes to include line documentation
                               with image (def=no)
   nav=<lalo>                include the lat-lon navigation info and not the O&A.
   aux=<yes/no>              specify yes to include auxilliary information
                               with image
   time=<time1> <time2>      specify the time range of images to select
                               (def=latest image if pos not specified)
   day=<day>                 specify the day of the images to select
                               (def=latest image if pos not specified)
   cal=<cal type>            request a specific calibration on the image
                               (imagedata only)
   id=<stn id>               radar station id
   user=<user_id>            ADDE user identification
   proj=<proj #>             a valid ADDE project number
   trace=<0/1>               setting to 1 tells server to write debug
                               trace file
   version=                  ADDE version number, currently 1 except for
                             griddata requests
   debug=                    set to true to watch the printlns stream by
   compress=                 set to "gzip" if you want to use the GZIP
                             compression or "compress" if you want to use
                             transfers in Unix compress format (You need to
                             have the VisAD package if you want to support
                             this.)  default = none.
   port=                     Socket port to connect on.  Overridden by
                             a port specified in the host
                             (e.g., adde.ucar.edu:500)
 


Field Summary
static String KEY_AUX
          Keyword for aux request
static String KEY_BAND
          Keyword for band
static String KEY_DAY
          Keyword for day request
static String KEY_DOC
          Keyword for doc request
static String KEY_ID
          Keyword for station id
static String KEY_LATLON
          Keyword for lat/lon request
static String KEY_LINEELE
          Keyword for lin/ele request
static String KEY_LOC
          Keyword for location
static String KEY_MAG
          Keyword for mag
static String KEY_NAV
          Keyword for navigation type
static String KEY_NUM
          Keyword for number of items
static String KEY_PLACE
          Keyword for place
static String KEY_POS
          Keyword for position
static String KEY_SIZE
          Keyword for size
static String KEY_SPAC
          Keyword for spacing
static String KEY_TIME
          Keyword for time request
static String KEY_UNIT
          Keyword for calibration unit
 
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
AddeImageURL()
          no arg constructor
AddeImageURL(String host, String requestType, String group, String descriptor)
          Create an AddeImageURL.
AddeImageURL(String host, String requestType, String group, String descriptor, String query)
          Create an ADDE Image URL from the given specs.
AddeImageURL(String host, String requestType, String group, String descriptor, String locateKey, String locateValue, String placeValue, int lines, int elements, int lmag, int emag, String band, String unit, int spacing)
          Create an ADDE Image URL from the given spec
 
Method Summary
protected  void appendDateOrPosString(StringBuffer buf)
          Create a DAY/TIME or POS string
 String getAuxValue()
          Get the AUX keyword value
 String getBand()
          Get the band or band range
 int getDatasetPosition()
          Get the dataset position
 String getDocValue()
          Get the DOC keyword value
 int getElementMag()
          Get the element magnification
 int getElements()
          Get the number of elements
 Date getEndDate()
          Get the end date for the request
 String getId()
          Get the location ID for radar images
 int getLineMag()
          Get the line magnification
 int getLines()
          Get the number of lines
 String getLocateKey()
          Get the locate key
 String getLocateValue()
          Get the locate value
 String getNavType()
          Get the navigation type
 String getPlaceValue()
          Get the PLACE value
 int getSpacing()
          Get the data size (SPAC)
 Date getStartDate()
          Get the start date for the request
 String getTimeCoverage()
          Set the time coverage
 String getUnit()
          Get the calibration unit
protected  String makeQuery()
          Create the ADDE URL
 void setAuxValue(String value)
          Set the AUX keyword value
 void setBand(String value)
          Set the band or band range
 void setDatasetPosition(int value)
          Set the dataset position
 void setDocValue(String value)
          Set the DOC keyword value
 void setElementMag(int value)
          Set the element magnification
 void setElements(int value)
          Set the number of elements
 void setEndDate(Date value)
          Set the end date for the request
 void setId(String value)
          Set the location ID for radar images
 void setLineMag(int value)
          Set the line magnification
 void setLines(int value)
          Set the number of lines
 void setLocateKey(String value)
          Set the locate key
 void setLocateValue(String value)
          Set the locate value
 void setNavType(String value)
          Set the navigation type
 void setPlaceValue(String value)
          Set the place value
 void setSpacing(int value)
          Set the data size (SPAC)
 void setStartDate(Date value)
          Set the start date for the request
 void setTimeCoverage(String value)
          Set the time coverage
 void setUnit(String value)
          Set the calibration unit
 
Methods inherited from class edu.wisc.ssec.mcidas.adde.AddeDatasetURL
getDescriptor, getGroup, parseQuery, 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_BAND

public static final String KEY_BAND
Keyword for band

See Also:
Constant Field Values

KEY_POS

public static final String KEY_POS
Keyword for position

See Also:
Constant Field Values

KEY_ID

public static final String KEY_ID
Keyword for station id

See Also:
Constant Field Values

KEY_LATLON

public static final String KEY_LATLON
Keyword for lat/lon request

See Also:
Constant Field Values

KEY_LINEELE

public static final String KEY_LINEELE
Keyword for lin/ele request

See Also:
Constant Field Values

KEY_LOC

public static final String KEY_LOC
Keyword for location

See Also:
Constant Field Values

KEY_MAG

public static final String KEY_MAG
Keyword for mag

See Also:
Constant Field Values

KEY_NUM

public static final String KEY_NUM
Keyword for number of items

See Also:
Constant Field Values

KEY_PLACE

public static final String KEY_PLACE
Keyword for place

See Also:
Constant Field Values

KEY_SIZE

public static final String KEY_SIZE
Keyword for size

See Also:
Constant Field Values

KEY_SPAC

public static final String KEY_SPAC
Keyword for spacing

See Also:
Constant Field Values

KEY_UNIT

public static final String KEY_UNIT
Keyword for calibration unit

See Also:
Constant Field Values

KEY_NAV

public static final String KEY_NAV
Keyword for navigation type

See Also:
Constant Field Values

KEY_AUX

public static final String KEY_AUX
Keyword for aux request

See Also:
Constant Field Values

KEY_DOC

public static final String KEY_DOC
Keyword for doc request

See Also:
Constant Field Values

KEY_DAY

public static final String KEY_DAY
Keyword for day request

See Also:
Constant Field Values

KEY_TIME

public static final String KEY_TIME
Keyword for time request

See Also:
Constant Field Values
Constructor Detail

AddeImageURL

public AddeImageURL()
no arg constructor


AddeImageURL

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

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

AddeImageURL

public AddeImageURL(String host,
                    String requestType,
                    String group,
                    String descriptor,
                    String query)
Create an ADDE Image URL 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)

AddeImageURL

public AddeImageURL(String host,
                    String requestType,
                    String group,
                    String descriptor,
                    String locateKey,
                    String locateValue,
                    String placeValue,
                    int lines,
                    int elements,
                    int lmag,
                    int emag,
                    String band,
                    String unit,
                    int spacing)
Create an ADDE Image 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
locateKey - locate key
locateValue - locate value
placeValue - place value
lines - number of lines
elements - number of elements
lmag - line magnification
emag - element magnification
band - band
unit - calibration unit
spacing - data size
Method Detail

getPlaceValue

public String getPlaceValue()
Get the PLACE value

Returns:
the PLACE value

getLocateKey

public String getLocateKey()
Get the locate key

Returns:
the locate key

getLocateValue

public String getLocateValue()
Get the locate value

Returns:
the locate value

getLines

public int getLines()
Get the number of lines

Returns:
the number of lines

getElements

public int getElements()
Get the number of elements

Returns:
the number of elements

getElementMag

public int getElementMag()
Get the element magnification

Returns:
the element magnification

getLineMag

public int getLineMag()
Get the line magnification

Returns:
the line magnification

setLocateKey

public void setLocateKey(String value)
Set the locate key

Parameters:
value - the locate key

setLocateValue

public void setLocateValue(String value)
Set the locate value

Parameters:
value - the locate value

setPlaceValue

public void setPlaceValue(String value)
Set the place value

Parameters:
value - the place value

setLines

public void setLines(int value)
Set the number of lines

Parameters:
value - the number of lines

setElements

public void setElements(int value)
Set the number of elements

Parameters:
value - the number of elements

setElementMag

public void setElementMag(int value)
Set the element magnification

Parameters:
value - the element magnification

setLineMag

public void setLineMag(int value)
Set the line magnification

Parameters:
value - the line magnification

setSpacing

public void setSpacing(int value)
Set the data size (SPAC)

Parameters:
value - the data size

getSpacing

public int getSpacing()
Get the data size (SPAC)

Returns:
the data size

setBand

public void setBand(String value)
Set the band or band range

Parameters:
value - the band range or ALL. For REQ_IMAGEDATA, must be a single band

getBand

public String getBand()
Get the band or band range

Returns:
the band range or ALL.

setUnit

public void setUnit(String value)
Set the calibration unit

Parameters:
value - the calibration unit

getUnit

public String getUnit()
Get the calibration unit

Returns:
calibration unit

setNavType

public void setNavType(String value)
Set the navigation type

Parameters:
value - the navigation type (X or LALO)

getNavType

public String getNavType()
Get the navigation type

Returns:
navigation type (default or LALO)

setId

public void setId(String value)
Set the location ID for radar images

Parameters:
value - the location ID

getId

public String getId()
Get the location ID for radar images

Returns:
location ID

setDatasetPosition

public void setDatasetPosition(int value)
Set the dataset position

Parameters:
value - the dataset position

getDatasetPosition

public int getDatasetPosition()
Get the dataset position

Returns:
dataset position

setStartDate

public void setStartDate(Date value)
Set the start date for the request

Parameters:
value - the starting date for the request

getStartDate

public Date getStartDate()
Get the start date for the request

Returns:
the start date for the request

setEndDate

public void setEndDate(Date value)
Set the end date for the request

Parameters:
value - the ending date for the request

getEndDate

public Date getEndDate()
Get the end date for the request

Returns:
the ending date for the request

setTimeCoverage

public void setTimeCoverage(String value)
Set the time coverage

Parameters:
value - the time coverage

getTimeCoverage

public String getTimeCoverage()
Set the time coverage

Returns:
the time coverage

setAuxValue

public void setAuxValue(String value)
Set the AUX keyword value

Parameters:
value - the AUX keyword value (YES, NO or DEFAULT_VALUE)

getAuxValue

public String getAuxValue()
Get the AUX keyword value

Returns:
the AUX keyword value (YES, NO or DEFAULT_VALUE)

setDocValue

public void setDocValue(String value)
Set the DOC keyword value

Parameters:
value - the DOC keyword value (YES, NO or DEFAULT_VALUE)

getDocValue

public String getDocValue()
Get the DOC keyword value

Returns:
the DOC keyword value (YES, NO or DEFAULT_VALUE)

makeQuery

protected String makeQuery()
Create the ADDE URL

Overrides:
makeQuery in class AddeDatasetURL
Returns:
a Adde URL

appendDateOrPosString

protected void appendDateOrPosString(StringBuffer buf)
Create a DAY/TIME or POS string

Parameters:
buf - buffer to append to