Class AdvancedNetworkConfig.MemberNetworkingView
- Enclosing class:
- AdvancedNetworkConfig
NetworkConfig
Facade used during bootstrap to hide if-logic between the two networking configuration approaches-
Field Summary
Fields inherited from class com.hazelcast.config.NetworkConfig
DEFAULT_PORT
-
Method Summary
Modifier and TypeMethodDescriptionaddOutboundPort
(int port) addOutboundPortDefinition
(String portDef) boolean
Returns the currentIcmpFailureDetectorConfig
.getJoin()
Returns theJoinConfig
.int
getPort()
Returns the port the Hazelcast member will try to bind on.int
Returns the maximum number of ports allowed to try to bind on.Gets theSocketInterceptorConfig
.Returns the currentSSLConfig
.Gets theSymmetricEncryptionConfig
.int
hashCode()
boolean
Checks if a Hazelcast member is allowed find a free port by incrementing the port number when it encounters an occupied port.boolean
setIcmpFailureDetectorConfig
(IcmpFailureDetectorConfig icmpFailureDetectorConfig) Sets theIcmpFailureDetectorConfig
.setInterfaces
(InterfacesConfig interfaces) setJoin
(JoinConfig join) setMemberAddressProviderConfig
(MemberAddressProviderConfig memberAddressProviderConfig) setOutboundPortDefinitions
(Collection<String> outboundPortDefs) setOutboundPorts
(Collection<Integer> outboundPorts) setPort
(int port) Sets the port the Hazelcast member will try to bind on.setPortAutoIncrement
(boolean portAutoIncrement) Sets if a Hazelcast member is allowed to find a free port by incrementing the port number when it encounters an occupied port.setPortCount
(int portCount) The maximum number of ports allowed to use.setPublicAddress
(String publicAddress) Overrides the public address of a member.setReuseAddress
(boolean reuseAddress) Sets the reuse address.setSocketInterceptorConfig
(SocketInterceptorConfig socketInterceptorConfig) Sets theSocketInterceptorConfig
.setSSLConfig
(SSLConfig sslConfig) Sets theSSLConfig
. null value indicates that no SSLConfig should be used.setSymmetricEncryptionConfig
(SymmetricEncryptionConfig symmetricEncryptionConfig) Sets theSymmetricEncryptionConfig
.toString()
Methods inherited from class com.hazelcast.config.NetworkConfig
getMemcacheProtocolConfig, getRestApiConfig, getTpcSocketConfig, setMemcacheProtocolConfig, setRestApiConfig, setTpcSocketConfig
-
Method Details
-
getPort
public int getPort()Description copied from class:NetworkConfig
Returns the port the Hazelcast member will try to bind on. A port number of 0 will let the system pick up an ephemeral port.- Overrides:
getPort
in classNetworkConfig
- Returns:
- the port the Hazelcast member will try to bind on
- See Also:
-
setPort
Description copied from class:NetworkConfig
Sets the port the Hazelcast member will try to bind on.A valid port value is between 0 and 65535. A port number of 0 will let the system pick up an ephemeral port.
- Overrides:
setPort
in classNetworkConfig
- Parameters:
port
- the port the Hazelcast member will try to bind on- Returns:
- NetworkConfig the updated NetworkConfig
- See Also:
-
getPortCount
public int getPortCount()Description copied from class:NetworkConfig
Returns the maximum number of ports allowed to try to bind on.- Overrides:
getPortCount
in classNetworkConfig
- Returns:
- the maximum number of ports allowed to try to bind on
- See Also:
-
setPortCount
Description copied from class:NetworkConfig
The maximum number of ports allowed to use.- Overrides:
setPortCount
in classNetworkConfig
- Parameters:
portCount
- the maximum number of ports allowed to use- Returns:
- this configuration
- See Also:
-
isPortAutoIncrement
public boolean isPortAutoIncrement()Description copied from class:NetworkConfig
Checks if a Hazelcast member is allowed find a free port by incrementing the port number when it encounters an occupied port.- Overrides:
isPortAutoIncrement
in classNetworkConfig
- Returns:
- the portAutoIncrement
- See Also:
-
setPortAutoIncrement
Description copied from class:NetworkConfig
Sets if a Hazelcast member is allowed to find a free port by incrementing the port number when it encounters an occupied port.If you explicitly want to control the port a Hazelcast member is going to use, you probably want to set portAutoincrement to false. In this case, the Hazelcast member is going to try the port
NetworkConfig.setPort(int)
and if the port is not free, the member will not start and throw an exception.If this value is set to true, Hazelcast will start at the port specified by
NetworkConfig.setPort(int)
and will try until it finds a free port, or until it runs out of ports to tryNetworkConfig.setPortCount(int)
.- Overrides:
setPortAutoIncrement
in classNetworkConfig
- Parameters:
portAutoIncrement
- the portAutoIncrement to set- Returns:
- the updated NetworkConfig
- See Also:
-
isReuseAddress
public boolean isReuseAddress()- Overrides:
isReuseAddress
in classNetworkConfig
-
setReuseAddress
Description copied from class:NetworkConfig
Sets the reuse address.When should setReuseAddress(true) be used?
When the member is shutdown, the server socket port will be in TIME_WAIT state for the next 2 minutes or so. If you start the member right after shutting it down, you may not be able to bind to the same port because it is in TIME_WAIT state. if you set reuseAddress=true then TIME_WAIT will be ignored, and you will be able to bind to the same port again.
This property should not be set to true on the Windows platform: see
- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6421091
- http://www.hsc.fr/ressources/articles/win_net_srv/multiple_bindings.html
- Overrides:
setReuseAddress
in classNetworkConfig
-
getOutboundPortDefinitions
- Overrides:
getOutboundPortDefinitions
in classNetworkConfig
-
setOutboundPortDefinitions
- Overrides:
setOutboundPortDefinitions
in classNetworkConfig
-
addOutboundPortDefinition
- Overrides:
addOutboundPortDefinition
in classNetworkConfig
-
getOutboundPorts
- Overrides:
getOutboundPorts
in classNetworkConfig
-
setOutboundPorts
- Overrides:
setOutboundPorts
in classNetworkConfig
-
addOutboundPort
- Overrides:
addOutboundPort
in classNetworkConfig
-
getInterfaces
- Overrides:
getInterfaces
in classNetworkConfig
- Returns:
- the interfaces
-
setInterfaces
- Overrides:
setInterfaces
in classNetworkConfig
- Parameters:
interfaces
- the interfaces to set
-
getJoin
Description copied from class:NetworkConfig
Returns theJoinConfig
.- Overrides:
getJoin
in classNetworkConfig
- Returns:
- the join
-
setJoin
- Overrides:
setJoin
in classNetworkConfig
- Parameters:
join
- the join to set
-
getPublicAddress
- Overrides:
getPublicAddress
in classNetworkConfig
-
setPublicAddress
Description copied from class:NetworkConfig
Overrides the public address of a member. Behind a NAT, two endpoints may not be able to see/access each other. If both nodes set their public addresses to their defined addresses on NAT, then that way they can communicate with each other. It should be set in the format “host IP address:port number”.- Overrides:
setPublicAddress
in classNetworkConfig
-
getSocketInterceptorConfig
Description copied from class:NetworkConfig
Gets theSocketInterceptorConfig
. The value can benull
if no socket interception is needed.- Overrides:
getSocketInterceptorConfig
in classNetworkConfig
- Returns:
- the SocketInterceptorConfig
- See Also:
-
setSocketInterceptorConfig
Description copied from class:NetworkConfig
Sets theSocketInterceptorConfig
. The value can benull
if no socket interception is needed.- Overrides:
setSocketInterceptorConfig
in classNetworkConfig
- Parameters:
socketInterceptorConfig
- the SocketInterceptorConfig to set- Returns:
- the updated NetworkConfig
-
getSymmetricEncryptionConfig
Description copied from class:NetworkConfig
Gets theSymmetricEncryptionConfig
. The value can benull
which means that no symmetric encryption should be used.- Overrides:
getSymmetricEncryptionConfig
in classNetworkConfig
- Returns:
- the SymmetricEncryptionConfig
-
setSymmetricEncryptionConfig
public NetworkConfig setSymmetricEncryptionConfig(SymmetricEncryptionConfig symmetricEncryptionConfig) Description copied from class:NetworkConfig
Sets theSymmetricEncryptionConfig
. The value can benull
if no symmetric encryption should be used.- Overrides:
setSymmetricEncryptionConfig
in classNetworkConfig
- Parameters:
symmetricEncryptionConfig
- the SymmetricEncryptionConfig to set- Returns:
- the updated NetworkConfig
- See Also:
-
getSSLConfig
Description copied from class:NetworkConfig
Returns the currentSSLConfig
. It is possible that null is returned if no SSLConfig has been set.- Overrides:
getSSLConfig
in classNetworkConfig
- Returns:
- the SSLConfig
- See Also:
-
setSSLConfig
Description copied from class:NetworkConfig
Sets theSSLConfig
. null value indicates that no SSLConfig should be used.- Overrides:
setSSLConfig
in classNetworkConfig
- Parameters:
sslConfig
- the SSLConfig- Returns:
- the updated NetworkConfig
- See Also:
-
getMemberAddressProviderConfig
- Overrides:
getMemberAddressProviderConfig
in classNetworkConfig
-
setMemberAddressProviderConfig
public NetworkConfig setMemberAddressProviderConfig(MemberAddressProviderConfig memberAddressProviderConfig) - Overrides:
setMemberAddressProviderConfig
in classNetworkConfig
-
setIcmpFailureDetectorConfig
public NetworkConfig setIcmpFailureDetectorConfig(IcmpFailureDetectorConfig icmpFailureDetectorConfig) Description copied from class:NetworkConfig
Sets theIcmpFailureDetectorConfig
. The value can benull
if this detector isn't needed.- Overrides:
setIcmpFailureDetectorConfig
in classNetworkConfig
- Parameters:
icmpFailureDetectorConfig
- the IcmpFailureDetectorConfig to set- Returns:
- the updated NetworkConfig
- See Also:
-
getIcmpFailureDetectorConfig
Description copied from class:NetworkConfig
Returns the currentIcmpFailureDetectorConfig
. It is possible that null is returned if no IcmpFailureDetectorConfig has been set.- Overrides:
getIcmpFailureDetectorConfig
in classNetworkConfig
- Returns:
- the IcmpFailureDetectorConfig
- See Also:
-
toString
- Overrides:
toString
in classNetworkConfig
-
equals
- Overrides:
equals
in classNetworkConfig
-
hashCode
public int hashCode()- Overrides:
hashCode
in classNetworkConfig
-