use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.
the class LocalAddressRegistryIntegrationTest method createConfigForServer.
private Config createConfigForServer() {
Config config = smallInstanceConfig();
AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
JoinConfig advancedJoinConfig = advancedNetworkConfig.getJoin();
advancedJoinConfig.getTcpIpConfig().setEnabled(true);
ServerSocketEndpointConfig memberServerSocketConfig = new ServerSocketEndpointConfig().setPort(SERVER_MEMBER_ADDRESS.getPort());
memberServerSocketConfig.getInterfaces().addInterface(SERVER_MEMBER_ADDRESS.getHost());
ServerSocketEndpointConfig clientServerSocketConfig = new ServerSocketEndpointConfig().setPort(SERVER_CLIENT_ADDRESS.getPort());
clientServerSocketConfig.getInterfaces().addInterface(SERVER_CLIENT_ADDRESS.getHost());
ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setName("wan").setPort(SERVER_WAN_ADDRESS.getPort());
wanServerSocketConfig.getInterfaces().addInterface(SERVER_WAN_ADDRESS.getHost());
memberServerSocketConfig.getInterfaces().addInterface("127.0.0.1");
advancedNetworkConfig.setEnabled(true).setMemberEndpointConfig(memberServerSocketConfig).setClientEndpointConfig(clientServerSocketConfig).addWanEndpointConfig(wanServerSocketConfig);
return config;
}
use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.
the class LocalAddressRegistryIntegrationTest method createConfigForInitiator.
private Config createConfigForInitiator() {
Config config = smallInstanceConfig();
AdvancedNetworkConfig advancedNetworkConfig = config.getAdvancedNetworkConfig();
JoinConfig advancedJoinConfig = advancedNetworkConfig.getJoin();
advancedJoinConfig.getTcpIpConfig().setEnabled(true).addMember(SERVER_MEMBER_ADDRESS.getHost() + ":" + SERVER_MEMBER_ADDRESS.getPort());
ServerSocketEndpointConfig memberServerSocketConfig = new ServerSocketEndpointConfig().setPort(INITIATOR_MEMBER_ADDRESS.getPort());
memberServerSocketConfig.getInterfaces().addInterface(INITIATOR_MEMBER_ADDRESS.getHost());
ServerSocketEndpointConfig clientServerSocketConfig = new ServerSocketEndpointConfig().setPort(INITIATOR_CLIENT_ADDRESS.getPort());
ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setName("wan").setPort(SERVER_WAN_ADDRESS.getPort());
wanServerSocketConfig.getInterfaces().addInterface(INITIATOR_WAN_ADDRESS.getHost());
memberServerSocketConfig.getInterfaces().addInterface("127.0.0.1");
advancedNetworkConfig.setEnabled(true).setMemberEndpointConfig(memberServerSocketConfig).setClientEndpointConfig(clientServerSocketConfig).addWanEndpointConfig(wanServerSocketConfig);
return config;
}
use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.
the class TcpServerContext method getOutboundPorts.
@Override
public Collection<Integer> getOutboundPorts(EndpointQualifier endpointQualifier) {
final AdvancedNetworkConfig advancedNetworkConfig = node.getConfig().getAdvancedNetworkConfig();
if (advancedNetworkConfig.isEnabled()) {
EndpointConfig endpointConfig = advancedNetworkConfig.getEndpointConfigs().get(endpointQualifier);
final Collection<Integer> outboundPorts = endpointConfig != null ? endpointConfig.getOutboundPorts() : Collections.<Integer>emptyList();
final Collection<String> outboundPortDefinitions = endpointConfig != null ? endpointConfig.getOutboundPortDefinitions() : Collections.<String>emptyList();
return AddressUtil.getOutboundPorts(outboundPorts, outboundPortDefinitions);
}
final NetworkConfig networkConfig = node.getConfig().getNetworkConfig();
final Collection<Integer> outboundPorts = networkConfig.getOutboundPorts();
final Collection<String> outboundPortDefinitions = networkConfig.getOutboundPortDefinitions();
return AddressUtil.getOutboundPorts(outboundPorts, outboundPortDefinitions);
}
use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.
the class MemcachedMultiendpointTest method createConfig.
@Override
protected Config createConfig() {
Config config = smallInstanceConfig();
AdvancedNetworkConfig anc = config.getAdvancedNetworkConfig();
anc.setEnabled(true).setMemcacheEndpointConfig(new ServerSocketEndpointConfig());
// Join is disabled intentionally. will start standalone HazelcastInstances.
JoinConfig join = anc.getJoin();
join.getAutoDetectionConfig().setEnabled(false);
join.getTcpIpConfig().setEnabled(false);
return config;
}
use of com.hazelcast.config.AdvancedNetworkConfig in project hazelcast by hazelcast.
the class RestClusterMultiendpointTest method createConfig.
@Override
protected Config createConfig() {
Config c = new Config();
AdvancedNetworkConfig anc = c.getAdvancedNetworkConfig();
anc.setEnabled(true);
return c;
}
Aggregations