public class ServerInfo extends java.lang.Object
ServerInfo objects have methods for accessing the contents of
servers.xml.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ATTR_ACTIVE
attributes
|
static java.lang.String |
ATTR_NAME |
static java.lang.String |
ATTR_NAMES |
static java.lang.String |
ATTR_PROJ |
static java.lang.String |
ATTR_TYPE |
static java.lang.String |
ATTR_USER |
private java.lang.String[] |
defTypes |
private java.util.List |
groups |
private ucar.unidata.idv.IntegratedDataViewer |
myIdv |
private static java.lang.String |
proj |
private java.util.List |
serverDescriptors |
private org.w3c.dom.Document |
serversDocument |
private org.w3c.dom.Element |
serversRoot |
private ucar.unidata.xml.XmlResourceCollection |
serversXRC |
static java.lang.String |
TAG_GROUP |
static java.lang.String |
TAG_SERVER
tags
|
static java.lang.String |
TAG_SERVERS |
private java.util.List |
typeList |
private static java.lang.String |
user |
| Constructor and Description |
|---|
ServerInfo(ucar.unidata.idv.IntegratedDataViewer idv,
ucar.unidata.xml.XmlResourceCollection servers)
Creates a new
ServerInfo object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addServers(ucar.unidata.idv.IntegratedDataViewer idv,
java.util.List serverList)
Adds
serverList to servers.xml. |
void |
clear(ucar.unidata.xml.XmlResourceCollection serversXRC)
Clear
servers.xml. |
java.util.List |
getAddeServers(java.lang.String type,
boolean all,
boolean includeDuplicates)
Get list of
AddeServers that match type. |
java.util.List |
getGroups(java.lang.String type)
Get all group names for a given data
type. |
java.lang.String |
getProj()
Return project number, default="0"
|
java.util.List |
getServerNames(java.lang.String type,
boolean all,
boolean includeDuplicates)
Get list of server names that match
type. |
java.util.List |
getServers(java.lang.String type,
boolean all,
boolean includeDuplicates)
Get list of
ServerDescriptors that match the
given type. |
private void |
getServersFromXml(ucar.unidata.xml.XmlResourceCollection servers)
Read and parse servers.xml.
|
java.util.List |
getServerTypes()
Get the different "types" supported by the server.
|
java.lang.String |
getUser()
Return userId, default="idv".
|
private boolean |
init()
Read servers.xml and initialize all lists.
|
void |
setUserProj(java.lang.String user,
java.lang.String proj)
Change the user id and project number for this instance.
|
java.util.List |
updateAddeServers(java.lang.String type,
boolean all,
boolean includeDuplicates)
Re-reads
servers.xml and re-initialize all lists. |
private ucar.unidata.idv.IntegratedDataViewer myIdv
public static final java.lang.String TAG_SERVER
public static final java.lang.String TAG_SERVERS
public static final java.lang.String TAG_GROUP
public static final java.lang.String ATTR_ACTIVE
public static final java.lang.String ATTR_NAME
public static final java.lang.String ATTR_NAMES
public static final java.lang.String ATTR_USER
public static final java.lang.String ATTR_PROJ
public static final java.lang.String ATTR_TYPE
private ucar.unidata.xml.XmlResourceCollection serversXRC
private org.w3c.dom.Document serversDocument
private org.w3c.dom.Element serversRoot
private static java.lang.String user
private static java.lang.String proj
private java.util.List typeList
private java.util.List groups
private java.util.List serverDescriptors
private java.lang.String[] defTypes
public ServerInfo(ucar.unidata.idv.IntegratedDataViewer idv, ucar.unidata.xml.XmlResourceCollection servers)
ServerInfo object.idv - Reference to the main application object.servers - ADDE server definitions.private void getServersFromXml(ucar.unidata.xml.XmlResourceCollection servers)
servers - Collection of ADDE server definitions.public java.lang.String getUser()
"idv".public java.lang.String getProj()
"0".public void setUserProj(java.lang.String user, java.lang.String proj)
user - New user ID.proj - New project number.public java.util.List getServerTypes()
public java.util.List getServers(java.lang.String type, boolean all, boolean includeDuplicates)
ServerDescriptors that match the
given type.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.ServerDescriptor objects that match
type.public java.util.List getServerNames(java.lang.String type, boolean all, boolean includeDuplicates)
type.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.public java.util.List getAddeServers(java.lang.String type, boolean all, boolean includeDuplicates)
AddeServers that match type.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.AddeServer objects.public java.util.List updateAddeServers(java.lang.String type, boolean all, boolean includeDuplicates)
servers.xml and re-initialize all lists.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.type data.private boolean init()
false if serverDescriptors is null,
true otherwise.public java.util.List getGroups(java.lang.String type)
type.type - Data type. Should be one of
"image", "point", "grid", "text", "nav".type data.public void addServers(ucar.unidata.idv.IntegratedDataViewer idv, java.util.List serverList)
serverList to servers.xml.idv - Reference to main application object.serverList - alternating strings: name1, group1, name2, group2...public void clear(ucar.unidata.xml.XmlResourceCollection serversXRC)
servers.xml.serversXRC - Collection of server definitions.