Class AddeServer

java.lang.Object
ucar.unidata.util.NamedThing
ucar.unidata.idv.chooser.adde.AddeServer
All Implemented Interfaces:
NamedObject

public class AddeServer extends NamedThing
Holds information about the available adde servers
Version:
$Revision: 1.4 $Date: 2007/07/19 18:11:33 $
Author:
IDV development team
  • Field Details

  • Constructor Details

    • AddeServer

      public AddeServer()
      ctor
    • AddeServer

      public AddeServer(String name)
      ctor
      Parameters:
      name - my name
    • AddeServer

      public AddeServer(String name, String description)
      ctor
      Parameters:
      name - my name
      description - my description
  • Method Details

    • toXml

      public static Element toXml(List servers, boolean localOnly) throws Exception
      Create the xml tree for all of the given servers
      Parameters:
      servers - List of servers
      localOnly - Only include servers and groups that are marked as local
      Returns:
      xml root
      Throws:
      Exception - On badness
    • coalesce

      public static List coalesce(List servers)
      Merge all of the similarly named servers in the list
      Parameters:
      servers - list of servers
      Returns:
      merged servers
    • processXml

      public static List processXml(Element root)
      process the xml root
      Parameters:
      root - The xml node
      Returns:
      List of servers
    • findServer

      public static AddeServer findServer(List servers, String name)
      Find the server with the given name in the given list
      Parameters:
      servers - List of servers
      name - name
      Returns:
      The found server or null
    • getServersWithType

      public static List getServersWithType(String type, List servers)
      Find the list of servers that have at least one group with the given type
      Parameters:
      type - group type
      servers - servers
      Returns:
      servers with group of type type
    • setIsLocal

      public void setIsLocal(boolean value)
      Set the IsLocal property.
      Parameters:
      value - The new value for IsLocal
    • getIsLocal

      public boolean getIsLocal()
      Get the IsLocal property.
      Returns:
      The IsLocal
    • setActive

      public void setActive(boolean value)
      Set the Active property.
      Parameters:
      value - The new value for Active
    • getActive

      public boolean getActive()
      Get the Active property.
      Returns:
      The Active
    • hasType

      public boolean hasType(String type)
      Does this server have a group with the given type
      Parameters:
      type - group type
      Returns:
      has type
    • addGroup

      public void addGroup(AddeServer.Group group)
      Add the group to me
      Parameters:
      group - new group
    • addGroups

      public void addGroups(List groupsToAdd)
      Add the list of groups
      Parameters:
      groupsToAdd - list of groups
    • setGroups

      public void setGroups(List value)
      Set the Groups property.
      Parameters:
      value - The new value for Groups
    • getGroups

      public List getGroups()
      Get the Groups property.
      Returns:
      The Groups
    • findGroup

      public AddeServer.Group findGroup(String name)
      Find the group with the given name
      Parameters:
      name - group name
      Returns:
      The group with name or null
    • getGroupsWithType

      public List getGroupsWithType(String type)
      Get the groups with the given type
      Parameters:
      type - group type
      Returns:
      List of groups
    • getGroupsWithType

      public List getGroupsWithType(String type, boolean onlyActive)
      Get the groups with the given type
      Parameters:
      type - group type
      onlyActive - If true then only get the active groups
      Returns:
      List of groups
    • equals

      public boolean equals(Object o)
      equals
      Overrides:
      equals in class NamedThing
      Parameters:
      o - object
      Returns:
      equals
    • main

      public static void main(String[] args)
      test
      Parameters:
      args - args