edu.wisc.ssec.mcidas.adde
Class AddeTextReader

java.lang.Object
  extended by edu.wisc.ssec.mcidas.adde.AddeTextReader

public class AddeTextReader
extends Object

Read text from an ADDE server interface for McIDAS ADDE data sets. This class handles file, weather text and obs text requests.

 For File Reading:
   URLs must all have the following format   
     adde://host/text?file=filename.ext

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

     file - name of text file on ADDE server

   the following keywords are required:

     file

   an example URL might look like:
     adde://viper/text?file=filename.ext

 For Weather Text Reading:
   URLs must all have the following format   
     adde://host/wxtext?group=group&key1=value1&key2=val2....&keyn=valn

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

     group=<group>         weather text group (default= RTWXTEXT)
     prod=<product>        predefind product name
     apro=<val1 .. valn>   AFOS/AWIPS product headers to match (don't 
                           use with wmo keyword
     astn=<val1 .. valn>   AFOS/AWIPS stations to match
     wmo= <val1 .. valn>   WMO product headers to match (don't 
                           use with apro keyword
     wstn=<val1 .. valn>   WMO stations to match
     day=<start end>       range of days to search
     dtime=<numhours>      maximum number of hours to search back (def=96)
     match=<match strings> list of character match strings to find from text
     num=<num>             number of matches to find (def=1)

   the following keywords are required:

     day  (bug causes it not to default to current day)
     one of the selection criteria

   an example URL might look like:
     adde://adde.ucar.edu/wxtext?group=rtwxtext&prod=zone_fcst&astn=bou

 For Observational Text Reading:
   URLs must all have the following format   
     adde://host/obtext?group=group&descr=descr&key1=value1....&keyn=valn

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

     group=<group>         weather text group (default= RTWXTEXT)
     descr=<descriptor>    weather text subgroup (default=SFCHOURLY)
     id=<id1 id2 ... idn>  list of station ids
     co=<co1 co2 ... con>  list of countries
     reg=<reg1 reg2..regn> list of regions
     newest=<day hour>     most recent time to allow in request 
                           (def=current time)
     oldest=<day hour>     oldest observation time to allow in request
     type=<type>           numeric value for the type of ob
     nhours=<numhours>     maximum number of hours to search
     num=<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

 

Author:
Tom Whittaker/Don Murray

Constructor Summary
AddeTextReader(String request)
          Creates an AddeTextReader object that allows reading an ADDE text file or weather text
 
Method Summary
 Vector getLinesOfText()
           
 int getNumLines()
          Return the number of lines of text that were read.
 String getStatus()
          Get a string representation of the status code
 int getStatusCode()
          Return the status code of the read
 String getText()
          Return the text read from the server.
 List<WxTextProduct> getWxTextProducts()
           
static void main(String[] args)
          test by running 'java edu.wisc.ssec.mcidas.adde.AddeTextReader'
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddeTextReader

public AddeTextReader(String request)
Creates an AddeTextReader object that allows reading an ADDE text file or weather text

Parameters:
request - ADDE URL to read from. See class javadoc.
Method Detail

getStatus

public String getStatus()
Get a string representation of the status code

Returns:
human readable status

getStatusCode

public int getStatusCode()
Return the status code of the read

Returns:
status code (>0 == read okay);

getNumLines

public int getNumLines()
Return the number of lines of text that were read.

Returns:
number of lines.

getText

public String getText()
Return the text read from the server. If there was a problem the error message is returned.

Returns:
text from server or error message

getLinesOfText

public Vector getLinesOfText()

getWxTextProducts

public List<WxTextProduct> getWxTextProducts()

main

public static void main(String[] args)
                 throws Exception
test by running 'java edu.wisc.ssec.mcidas.adde.AddeTextReader'

Throws:
Exception