use of com.sun.appserv.management.config.ClusterConfig in project Payara by payara.
the class ClusteredServerConfigTest method createClusteredServer.
public ClusteredServerConfig createClusteredServer(final String serverName, final String nodeAgentName, final int basePort) {
final DomainConfig domainConfig = getDomainConfig();
if (domainConfig.getServersConfig().getClusteredServerConfigMap().get(serverName) != null) {
domainConfig.getServersConfig().removeClusteredServerConfig(serverName);
} else if (domainConfig.getServersConfig().getStandaloneServerConfigMap().get(serverName) != null) {
domainConfig.getServersConfig().removeStandaloneServerConfig(serverName);
}
final ClusterConfig clusterConfig = ClusterConfigTest.ensureDefaultInstance(domainConfig);
if (domainConfig.getServersConfig().getClusteredServerConfigMap().get(serverName) != null) {
domainConfig.getServersConfig().removeClusteredServerConfig(serverName);
assert domainConfig.getServersConfig().getClusteredServerConfigMap().get(serverName) == null;
}
final ConfigSetup setup = new ConfigSetup(getDomainRoot());
final Map<String, String> options = new HashMap<String, String>();
setup.setupServerPorts(options, basePort);
final ClusteredServerConfig csc = domainConfig.getServersConfig().createClusteredServerConfig(serverName, clusterConfig.getName(), nodeAgentName, options);
sanityCheck(csc);
return csc;
}
Aggregations