public class AddeServer extends NamedThing
Modifier and Type | Class and Description |
---|---|
static class |
AddeServer.Group
Class Group represents an adde group
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TYPE_ANY
group type
|
static java.lang.String |
TYPE_IMAGE
image type
|
static java.lang.String |
TYPE_NONE
group type
|
static java.lang.String |
TYPE_POINT
point type
|
static java.lang.String |
TYPE_RADAR
radar type
|
static java.lang.String |
TYPE_WXTEXT
text type
|
Constructor and Description |
---|
AddeServer()
ctor
|
AddeServer(java.lang.String name)
ctor
|
AddeServer(java.lang.String name,
java.lang.String description)
ctor
|
Modifier and Type | Method and Description |
---|---|
void |
addGroup(AddeServer.Group group)
Add the group to me
|
void |
addGroups(java.util.List groupsToAdd)
Add the list of groups
|
static java.util.List |
coalesce(java.util.List servers)
Merge all of the similarly named servers in the list
|
boolean |
equals(java.lang.Object o)
equals
|
AddeServer.Group |
findGroup(java.lang.String name)
Find the group with the given name
|
static AddeServer |
findServer(java.util.List servers,
java.lang.String name)
Find the server with the given name in the given list
|
boolean |
getActive()
Get the Active property.
|
java.util.List |
getGroups()
Get the Groups property.
|
java.util.List |
getGroupsWithType(java.lang.String type)
Get the groups with the given type
|
java.util.List |
getGroupsWithType(java.lang.String type,
boolean onlyActive)
Get the groups with the given type
|
boolean |
getIsLocal()
Get the IsLocal property.
|
static java.util.List |
getServersWithType(java.lang.String type,
java.util.List servers)
Find the list of servers that have at least one group with the given type
|
boolean |
hasType(java.lang.String type)
Does this server have a group with the given type
|
static void |
main(java.lang.String[] args)
test
|
static java.util.List |
processXml(org.w3c.dom.Element root)
process the xml root
|
void |
setActive(boolean value)
Set the Active property.
|
void |
setGroups(java.util.List value)
Set the Groups property.
|
void |
setIsLocal(boolean value)
Set the IsLocal property.
|
static org.w3c.dom.Element |
toXml(java.util.List servers,
boolean localOnly)
Create the xml tree for all of the given servers
|
getDescription, getName, hashCode, setDescription, setName, toString
public static final java.lang.String TYPE_NONE
public static final java.lang.String TYPE_ANY
public static final java.lang.String TYPE_IMAGE
public static final java.lang.String TYPE_RADAR
public static final java.lang.String TYPE_POINT
public static final java.lang.String TYPE_WXTEXT
public AddeServer()
public AddeServer(java.lang.String name)
name
- my namepublic AddeServer(java.lang.String name, java.lang.String description)
name
- my namedescription
- my descriptionpublic static org.w3c.dom.Element toXml(java.util.List servers, boolean localOnly) throws java.lang.Exception
servers
- List of serverslocalOnly
- Only include servers and groups that are marked as localjava.lang.Exception
- On badnesspublic static java.util.List coalesce(java.util.List servers)
servers
- list of serverspublic static java.util.List processXml(org.w3c.dom.Element root)
root
- The xml nodepublic static AddeServer findServer(java.util.List servers, java.lang.String name)
servers
- List of serversname
- namepublic static java.util.List getServersWithType(java.lang.String type, java.util.List servers)
type
- group typeservers
- serverspublic void setIsLocal(boolean value)
value
- The new value for IsLocalpublic boolean getIsLocal()
public void setActive(boolean value)
value
- The new value for Activepublic boolean getActive()
public boolean hasType(java.lang.String type)
type
- group typepublic void addGroup(AddeServer.Group group)
group
- new grouppublic void addGroups(java.util.List groupsToAdd)
groupsToAdd
- list of groupspublic void setGroups(java.util.List value)
value
- The new value for Groupspublic java.util.List getGroups()
public AddeServer.Group findGroup(java.lang.String name)
name
- group namepublic java.util.List getGroupsWithType(java.lang.String type)
type
- group typepublic java.util.List getGroupsWithType(java.lang.String type, boolean onlyActive)
type
- group typeonlyActive
- If true then only get the active groupspublic boolean equals(java.lang.Object o)
equals
in class NamedThing
o
- objectpublic static void main(java.lang.String[] args)
args
- args