Search in sources :

Example 1 with ClusterConfig

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;
}
Also used : HashMap(java.util.HashMap) ClusteredServerConfig(com.sun.appserv.management.config.ClusteredServerConfig) DomainConfig(com.sun.appserv.management.config.DomainConfig) ClusterConfig(com.sun.appserv.management.config.ClusterConfig)

Aggregations

ClusterConfig (com.sun.appserv.management.config.ClusterConfig)1 ClusteredServerConfig (com.sun.appserv.management.config.ClusteredServerConfig)1 DomainConfig (com.sun.appserv.management.config.DomainConfig)1 HashMap (java.util.HashMap)1