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