use of com.hazelcast.instance.EndpointQualifier in project hazelcast by hazelcast.
the class DelegatingAddressPicker method pickAddressFromEndpointConfig.
private void pickAddressFromEndpointConfig() {
InetSocketAddress bindAddress;
InetSocketAddress publicAddress;
ServerSocketChannel serverSocketChannel;
for (EndpointConfig config : config.getAdvancedNetworkConfig().getEndpointConfigs().values()) {
if (!(config instanceof ServerSocketEndpointConfig)) {
continue;
}
ServerSocketEndpointConfig endpointConfig = (ServerSocketEndpointConfig) config;
EndpointQualifier qualifier = endpointConfig.getQualifier();
bindAddress = memberAddressProvider.getBindAddress(qualifier);
publicAddress = memberAddressProvider.getPublicAddress(qualifier);
validatePublicAddress(publicAddress);
if (!bindAddresses.values().contains(bindAddress)) {
// bind new server socket
serverSocketChannel = createServerSocketChannel(logger, config, bindAddress.getAddress(), bindAddress.getPort() == 0 ? endpointConfig.getPort() : bindAddress.getPort(), endpointConfig.getPortCount(), endpointConfig.isPortAutoIncrement(), endpointConfig.isReuseAddress(), false);
serverSocketChannels.put(qualifier, serverSocketChannel);
int port = serverSocketChannel.socket().getLocalPort();
if (port != bindAddress.getPort()) {
bindAddress = new InetSocketAddress(bindAddress.getAddress(), port);
}
if (publicAddress.getPort() == 0) {
publicAddress = new InetSocketAddress(publicAddress.getAddress(), port);
}
}
logger.info("Using bind address: " + bindAddress + ", " + "public address: " + publicAddress + " for qualifier " + qualifier);
bindAddresses.put(qualifier, bindAddress);
publicAddresses.put(qualifier, publicAddress);
}
}
use of com.hazelcast.instance.EndpointQualifier in project hazelcast by hazelcast.
the class EndpointQualifierConstructorTest method testText.
@Test
public void testText() {
EndpointQualifier source = EndpointQualifier.REST;
assertCloneEquals(source);
}
use of com.hazelcast.instance.EndpointQualifier in project hazelcast by hazelcast.
the class EndpointQualifierConstructorTest method testClient.
@Test
public void testClient() {
EndpointQualifier source = EndpointQualifier.CLIENT;
assertCloneEquals(source);
}
use of com.hazelcast.instance.EndpointQualifier in project hazelcast by hazelcast.
the class EndpointQualifierConstructorTest method testMember.
@Test
public void testMember() {
EndpointQualifier source = EndpointQualifier.MEMBER;
assertCloneEquals(source);
}
use of com.hazelcast.instance.EndpointQualifier in project hazelcast by hazelcast.
the class EndpointQualifierConstructorTest method testWan.
@Test
public void testWan() {
EndpointQualifier source = EndpointQualifier.resolve(ProtocolType.WAN, "custom");
assertCloneEquals(source);
}
Aggregations