@Beta public class AdvancedNetworkConfig extends Object
NetworkConfig
with the additional ability to define multiple
endpoints, each with its own separate protocol/security and/or socket properties.
When AdvancedNetworkConfig
is present and enabled then it always takes precedence over
the NetworkingConfig.Modifier and Type | Class and Description |
---|---|
static class |
AdvancedNetworkConfig.MemberNetworkingView
Member endpoint decorated as a
NetworkConfig
Facade used during bootstrap to hide if-logic between the two networking configuration approaches |
Constructor and Description |
---|
AdvancedNetworkConfig() |
public MemberAddressProviderConfig getMemberAddressProviderConfig()
public AdvancedNetworkConfig setMemberAddressProviderConfig(MemberAddressProviderConfig memberAddressProviderConfig)
public AdvancedNetworkConfig addWanEndpointConfig(EndpointConfig endpointConfig)
EndpointConfig
to the endpoints configuration. When the argument is an
EndpointConfig
, then it configures network settings for the client side of outgoing network
connections opened from that member. When the provided endpointconfig
is a
ServerSocketEndpointConfig
, then the HazelcastInstance
will additionally listen on
the configured port for incoming WAN connections.
Example of how to configure Hazelcast instances for active-passive WAN replication:
Config config = new Config();
ServerSocketEndpointConfig wanServerSocketConfig = new ServerSocketEndpointConfig().setPort(8765);
// setup SSL config etc
wanServerSocketConfig.getSSLConfig()
.setEnabled(true)
.setFactoryImplementation(new OpenSSLEngineFactory());
config.getAdvancedNetworkConfig()
.setEnabled(true)
.addWanEndpointConfig(wanServerSocketConfig);
HazelcastInstance passive = Hazelcast.newHazelcastInstance(config);
Config config = new Config();
EndpointConfig wanEndpointConfig = new EndpointConfig().setName("wan-tokyo");
wanEndpointConfig.getSSLConfig()
.setEnabled(true)
.setFactoryImplementation(new OpenSSLEngineFactory());
config.getAdvancedNetworkConfig()
.setEnabled(true)
.addWanEndpointConfig(wanEndpointConfig);
// setup WAN replication
WanReplicationConfig wanReplicationConfig = new WanReplicationConfig();
// WAN publisher config references endpoint config by name
WanBatchReplicationPublisherConfig publisherConfig = new WanBatchReplicationPublisherConfig()
.setEndpoint("wan-tokyo")
.setTargetEndpoints("tokyo.hazelcast.com:8765");
wanReplicationConfig.addWanBatchReplicationPublisherConfig(publisherConfig);
config.addWanReplicationConfig(wanReplicationConfig);
HazelcastInstance active = Hazelcast.newHazelcastInstance(config);
endpointConfig
- the endpoint configuration to addpublic AdvancedNetworkConfig setMemberEndpointConfig(ServerSocketEndpointConfig serverSocketEndpointConfig)
MEMBER
protocol. If another
ServerSocketEndpointConfig
was previously set, it will be replaced. When starting a Hazelcast
instance with AdvancedNetworkConfig
enabled, its configuration must include
one ServerSocketEndpointConfig
for protocol type MEMBER
.serverSocketEndpointConfig
- the server socket endpoint configurationpublic AdvancedNetworkConfig setClientEndpointConfig(ServerSocketEndpointConfig serverSocketEndpointConfig)
CLIENT
protocol. If another
ServerSocketEndpointConfig
was previously set, it will be replaced. When starting a Hazelcast
instance with AdvancedNetworkConfig
enabled, its configuration may include
at most one ServerSocketEndpointConfig
for protocol type CLIENT
.serverSocketEndpointConfig
- the server socket endpoint configurationpublic AdvancedNetworkConfig setRestEndpointConfig(RestServerEndpointConfig restServerEndpointConfig)
REST
protocol. If another
ServerSocketEndpointConfig
was previously set, it will be replaced. When starting a Hazelcast
instance with AdvancedNetworkConfig
enabled, its configuration may include
at most one ServerSocketEndpointConfig
for protocol type REST
.restServerEndpointConfig
- the server socket endpoint configurationpublic AdvancedNetworkConfig setMemcacheEndpointConfig(ServerSocketEndpointConfig memcacheEndpointConfig)
memcache
protocol. If another
ServerSocketEndpointConfig
was previously set, it will be replaced.memcacheEndpointConfig
- the server socket endpoint configurationpublic Map<com.hazelcast.instance.EndpointQualifier,EndpointConfig> getEndpointConfigs()
public AdvancedNetworkConfig setEndpointConfigs(Map<com.hazelcast.instance.EndpointQualifier,EndpointConfig> endpointConfigs)
public boolean isEnabled()
public AdvancedNetworkConfig setEnabled(boolean enabled)
public JoinConfig getJoin()
JoinConfig
.public AdvancedNetworkConfig setJoin(JoinConfig join)
join
- the join to setpublic AdvancedNetworkConfig setIcmpFailureDetectorConfig(IcmpFailureDetectorConfig icmpFailureDetectorConfig)
IcmpFailureDetectorConfig
. The value can be null
if this detector isn't needed.icmpFailureDetectorConfig
- the IcmpFailureDetectorConfig to setgetIcmpFailureDetectorConfig()
public IcmpFailureDetectorConfig getIcmpFailureDetectorConfig()
IcmpFailureDetectorConfig
. It is possible that null is returned if no
IcmpFailureDetectorConfig has been set.setIcmpFailureDetectorConfig(IcmpFailureDetectorConfig)
public RestServerEndpointConfig getRestEndpointConfig()
Copyright © 2024 Hazelcast, Inc.. All rights reserved.