Class ServerInfo

java.lang.Object
edu.wisc.ssec.mcidasv.chooser.ServerInfo

public class ServerInfo extends Object
ServerInfo objects have methods for accessing the contents of servers.xml.
  • Field Details

  • Constructor Details

  • Method Details

    • getServersFromXml

      private void getServersFromXml(XmlResourceCollection servers)
      Read and parse servers.xml.
      Parameters:
      servers - Collection of ADDE server definitions.
    • getUser

      public String getUser()
      Return userId, default="idv".
      Returns:
      User ID. Default value is "idv".
    • getProj

      public String getProj()
      Return project number, default="0"
      Returns:
      Project number. Default value is "0".
    • setUserProj

      public void setUserProj(String user, String proj)
      Change the user id and project number for this instance.
      Parameters:
      user - New user ID.
      proj - New project number.
    • getServerTypes

      public List getServerTypes()
      Get the different "types" supported by the server.
      Returns:
      A list whose possible values may contain "image", "point", "grid", "text", "nav".
    • getServers

      public List getServers(String type, boolean all, boolean includeDuplicates)
      Get list of ServerDescriptors that match the given type.
      Parameters:
      type - Data type. Should be one of "image", "point", "grid", "text", "nav".
      all - Includes all definitions, even duplicates.
      includeDuplicates - Whether or not duplicate definitions are included.
      Returns:
      List of ServerDescriptor objects that match type.
    • getServerNames

      public List getServerNames(String type, boolean all, boolean includeDuplicates)
      Get list of server names that match type.
      Parameters:
      type - Data type. Should be one of "image", "point", "grid", "text", "nav".
      all - Includes all definitions, even duplicates.
      includeDuplicates - Whether or not duplicate definitions are included.
      Returns:
      List of server name strings.
    • getAddeServers

      public List getAddeServers(String type, boolean all, boolean includeDuplicates)
      Get list of AddeServers that match type.
      Parameters:
      type - Data type. Should be one of "image", "point", "grid", "text", "nav".
      all - Includes all definitions, even duplicates.
      includeDuplicates - Whether or not duplicate definitions are included.
      Returns:
      List of AddeServer objects.
    • updateAddeServers

      public List updateAddeServers(String type, boolean all, boolean includeDuplicates)
      Re-reads servers.xml and re-initialize all lists.
      Parameters:
      type - Data type. Should be one of "image", "point", "grid", "text", "nav".
      all - Includes all definitions, even duplicates.
      includeDuplicates - Whether or not duplicate definitions are included.
      Returns:
      List of server name strings that support type data.
    • init

      private boolean init()
      Read servers.xml and initialize all lists.
      Returns:
      false if serverDescriptors is null, true otherwise.
    • getGroups

      public List getGroups(String type)
      Get all group names for a given data type.
      Parameters:
      type - Data type. Should be one of "image", "point", "grid", "text", "nav".
      Returns:
      List of groups that support type data.
    • addServers

      public void addServers(IntegratedDataViewer idv, List serverList)
      Adds serverList to servers.xml.
      Parameters:
      idv - Reference to main application object.
      serverList - alternating strings: name1, group1, name2, group2...
    • clear

      public void clear(XmlResourceCollection serversXRC)
      Clear servers.xml.
      Parameters:
      serversXRC - Collection of server definitions.