edu.wisc.ssec.mcidas.adde
Class AddeServerInfo

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

public class AddeServerInfo
extends Object

All things related to ADDE servers, groups and datasets Certain requests are dependent on appropriate prior requests. E.g., must set server, then group, before you can request File Format.

Version:
0.2
Author:
tomw

Constructor Summary
AddeServerInfo()
          Creates new AddeServerInfo.
AddeServerInfo(String[] l)
          The non-default parameter is a list of of ADDE servers
 
Method Summary
 String getArchiveDate()
           
 AreaDirectory[][] getAreaDirectories()
          get the sorted list of AreaDirectory objects
 String[] getBandNames()
          return the bandNames text
 String[] getDatasetList()
          get a list of all datasets valid for this server and the designated group.
 String[] getDatasetListDescriptions()
          get a list of all dataset descriptions for this server and the designated group
 String[] getDateTimeList()
          get the valid date-time list for the selected server/group/dataset.
 String getFileFormat()
          Get the File Format (AREA, TEXT, NEXR, etc.) for the currently selected group.
 String[] getGroupList()
          get a list of all groups valid for this server
 boolean getIsArchive()
           
 String getRequestString(int reqestType)
          Not used??
 String getSelectedServer()
          get name of the server that has been selected and for which all group and dataset info is currently valid for
 String[] getServerList()
          get a list of servers
 String getStatus()
          get the status of the last request
static void main(String[] args)
          For testing purposes.
 void setArchiveDate(String d)
           
 void setIsArchive(boolean flag)
           
 void setSelectedDataset(String d)
          identify the selected dataset
 void setSelectedGroup(String g)
          identify the selected group
 int setSelectedServer(String s, String type)
          define which server to select, and the type of ADDE data group (image, point, grid, text) to get group and descriptor info for This is the workhorse of the code.
 void setUserIDandProjString(String up)
          set the userID and proj number if required for transactions, as required by servers that use accounting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddeServerInfo

public AddeServerInfo()
Creates new AddeServerInfo. This collects information about ADDE server(s) -- their groups, datasets, and date-times (right now only image date-time implemented). This is a helper class for anything else that needs to get these information. The candidate list of ADDE servers should be obtained from a yet-to-be-identified "well-known list", and made available in this class.


AddeServerInfo

public AddeServerInfo(String[] l)
The non-default parameter is a list of of ADDE servers

Parameters:
l - a list of ADDE servers that can be used in lieu of automatically obtaining it.
Method Detail

getServerList

public String[] getServerList()
get a list of servers

Returns:
names of server hosts

getSelectedServer

public String getSelectedServer()
get name of the server that has been selected and for which all group and dataset info is currently valid for

Returns:
name of server host

setSelectedServer

public int setSelectedServer(String s,
                             String type)
define which server to select, and the type of ADDE data group (image, point, grid, text) to get group and descriptor info for This is the workhorse of the code.

Parameters:
s - the name of the ADDE server to be selected
type - the type of data to select.
Returns:
status code: 0=ok, -1=invalid accounting, -2=didn't get metadata

getGroupList

public String[] getGroupList()
get a list of all groups valid for this server

Returns:
array of group ids

getDatasetList

public String[] getDatasetList()
get a list of all datasets valid for this server and the designated group.

Returns:
array of dataset tags

getDatasetListDescriptions

public String[] getDatasetListDescriptions()
get a list of all dataset descriptions for this server and the designated group

Returns:
array of dataset descriptors

getDateTimeList

public String[] getDateTimeList()
get the valid date-time list for the selected server/group/dataset. Note that you must 'setSelectedGroup()' and 'setSelectedDataset()' prior to using this method. [Also, Don Murray at Unidata wrote the original - thanks!]

Returns:
list of date-times ("yy-MM-dd / hh:mm:ss" format) or the string "No data available"

getFileFormat

public String getFileFormat()
Get the File Format (AREA, TEXT, NEXR, etc.) for the currently selected group.

Returns:
file format for currently selected group

getAreaDirectories

public AreaDirectory[][] getAreaDirectories()
get the sorted list of AreaDirectory objects

Returns:
list of directories

setSelectedGroup

public void setSelectedGroup(String g)
identify the selected group

Parameters:
g - the name of the group to select

setSelectedDataset

public void setSelectedDataset(String d)
identify the selected dataset

Parameters:
d - the name of the dataset/descr to select

setIsArchive

public void setIsArchive(boolean flag)

getIsArchive

public boolean getIsArchive()

setArchiveDate

public void setArchiveDate(String d)

getArchiveDate

public String getArchiveDate()

getBandNames

public String[] getBandNames()
return the bandNames text

Returns:
array of text of the SATBAND data fetched from selectedServer

getRequestString

public String getRequestString(int reqestType)
Not used??


setUserIDandProjString

public void setUserIDandProjString(String up)
set the userID and proj number if required for transactions, as required by servers that use accounting.

Parameters:
up - the user/project number request string in the form "user=tom&proj=1234"

getStatus

public String getStatus()
get the status of the last request

Returns:
words describing last transaction

main

public static void main(String[] args)
For testing purposes. Edit server, and run the class as if it were an application.