public class A3CMLConfig extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
Hashtable<String,A3CMLDomain> |
domains
Hashtable of all domains
|
Hashtable<String,A3CMLProperty> |
properties
Hashtable of all global properties
|
private static long |
serialVersionUID
define serialVersionUID for interoperability
|
Hashtable<Short,A3CMLServer> |
servers
Hashtable of all servers (persistent and transient)
|
Constructor and Description |
---|
A3CMLConfig() |
Modifier and Type | Method and Description |
---|---|
void |
addDomain(A3CMLDomain domain)
Adds a domain.
|
A3CMLProperty |
addProperty(A3CMLProperty prop)
add property
|
void |
addServer(A3CMLServer server)
Adds a server.
|
void |
configure(A3CMLServer root)
Adapts the current configuration to the specified persistent server.
|
boolean |
containsDomain(String name)
Returns true if it exists a domain with this name, false otherwise.
|
boolean |
containsProperty(String name)
contains property
|
boolean |
containsServer(short sid)
Returns true if the configuration contains a server with specified id.
|
boolean |
containsServer(String name)
Returns true if the configuration contains a server with specified name.
|
boolean |
equals(Object obj) |
static A3CMLConfig |
getConfig(String path)
Gets a
A3CMLConfig serialized object from file. |
A3CMLDomain |
getDomain(String name)
Returns the description of a domain.
|
A3CMLConfig |
getDomainConfig(String domainName)
Gets configuration of agent servers by a domain from a Config object.
|
A3CMLConfig |
getDomainConfig(String[] listDomainName)
Gets configuration of agent servers by a list of domain from a Config object.
|
String |
getJvmArgs(short sid)
Get the JVM argument for a particular agent server identified by its id.
|
String |
getJvmArgs(String name)
Get the JVM argument for a particular agent server identified by its name.
|
A3CMLProperty |
getProperty(String name)
Returns the specified property.
|
A3CMLProperty |
getProperty(String name,
short sid)
Returns the specified property.
|
A3CMLServer |
getServer(short sid)
Returns the description of a server.
|
A3CMLServer |
getServer(String name)
Returns the description of a server.
|
short |
getServerIdByName(String name)
Gets a server identifier from its name.
|
String |
getServerNameById(short sid)
Gets a server name from its identifier.
|
String |
getServiceArgs(short sid,
String classname)
Get the argument strings for a particular service on a particular
agent server identified by its id.
|
String |
getServiceArgs(String name,
String classname)
Get the argument strings for a particular service on a particular
agent server identified by its name.
|
String |
getServiceArgsHost(String hostname,
String classname)
Gets the argument strings for a particular service running on a server
identified by its host (searchs on all servers and associated transient).
|
int |
hashCode() |
static A3CMLConfig |
load()
read object from a serialized file.
|
A3CMLDomain |
removeDomain(String name)
Removes a domain.
|
A3CMLProperty |
removeProperty(String name)
remove property
|
A3CMLServer |
removeServer(short sid)
Removes a server.
|
A3CMLServer |
removeServer(String name)
Remove a server.
|
void |
reset()
reset visited and gateway fields.
|
void |
save()
save configuration of agent servers (Config)
in a serialized file.
|
String |
toString() |
private static final long serialVersionUID
public Hashtable<String,A3CMLDomain> domains
public Hashtable<Short,A3CMLServer> servers
public Hashtable<String,A3CMLProperty> properties
public final void addDomain(A3CMLDomain domain) throws DuplicateDomainException
domain
- The description of added domain.DuplicateDomainException
- If the domain already exist.public final A3CMLDomain removeDomain(String name) throws UnknownDomainException
name
- The domain name.UnknownDomainException
- If the domain don't exist.public final boolean containsDomain(String name)
name
- The domain name.public final A3CMLDomain getDomain(String name) throws UnknownDomainException
name
- The domain name.UnknownDomainException
- If the domain don't exist.public final void addServer(A3CMLServer server) throws DuplicateServerException
server
- The description of added server.DuplicateServerException
- If the server already exist.public final A3CMLServer removeServer(short sid) throws UnknownServerException
sid
- The unique server identifier.UnknownServerException
- If the server does not exist.public final A3CMLServer removeServer(String name) throws UnknownServerException
name
- The server name.UnknownServerException
- If the server does not exist.public final boolean containsServer(short sid)
sid
- server idpublic short getServerIdByName(String name) throws UnknownServerException
name
- The server name.UnknownServerException
- If the server does not exist.public String getServerNameById(short sid) throws UnknownServerException
name
- The server identifier.UnknownServerException
- If the server does not exist.public final boolean containsServer(String name)
name
- server namepublic final A3CMLServer getServer(short sid) throws UnknownServerException
sid
- The server identifier.UnknownServerException
- If the server does not exist.public final A3CMLServer getServer(String name) throws UnknownServerException
name
- The server name.UnknownServerException
- If the server does not exist.public final A3CMLProperty addProperty(A3CMLProperty prop) throws Exception
prop
- A3CMLPropertyException
public final A3CMLProperty removeProperty(String name)
name
- property namepublic final boolean containsProperty(String name)
name
- property namepublic final A3CMLProperty getProperty(String name)
public final A3CMLProperty getProperty(String name, short sid) throws Exception
Exception
public final String getJvmArgs(short sid) throws UnknownServerException
id
- agent server identifier.UnknownServerException
- The specified server does not exist.public final String getJvmArgs(String name) throws UnknownServerException
name
- agent server name.UnknownServerException
- The specified server does not exist.public final String getServiceArgs(short sid, String classname) throws UnknownServerException, UnknownServiceException
sid
- agent server id.classname
- the service class name.UnknownServerException
- The specified server does not exist.UnknownServiceException
- The specified service is not declared on this server.public final String getServiceArgs(String name, String classname) throws UnknownServerException, UnknownServiceException
sid
- agent server name.classname
- the service class name.UnknownServerException
- The specified server does not exist.UnknownServiceException
- The specified service is not declared on this server.public void configure(A3CMLServer root) throws Exception
Exception
public A3CMLConfig getDomainConfig(String domainName) throws Exception
Config
object.domainName
- domain nameConfig
object if file exists and is
correct, null otherwise.Exception
- unspecialized exception when reading and parsing the configuration filepublic A3CMLConfig getDomainConfig(String[] listDomainName) throws Exception
Config
object.domainName
- list of domain nameConfig
object if file exists and is
correct, null otherwise.Exception
- unspecialized exception when reading and parsing the configuration filepublic void save() throws IOException
IOException
AgentServer.DEFAULT_SER_CFG_FILE
public static A3CMLConfig load() throws Exception
Exception
public static A3CMLConfig getConfig(String path) throws IOException
A3CMLConfig
serialized object from file.path
- path of serialized configuration fileA3CMLConfig
object if file exists and is
correct, null otherwise.IOException
Exception
- unspecialized exception when reading and parsing the configuration filepublic final String getServiceArgsHost(String hostname, String classname) throws Exception
hostname
- hostnameclassName
- the service class nameUnknownServiceException
- The specified service is not declared on this server.Exception
public void reset()
Copyright © 2019 ScalAgent D.T.. All rights reserved.