public class ClientNetworkConfig extends Object
Constructor and Description |
---|
ClientNetworkConfig() |
Modifier and Type | Method and Description |
---|---|
ClientNetworkConfig |
addAddress(String... addresses)
Adds given addresses to candidate address list that client will use to establish initial connection
|
ClientNetworkConfig |
addOutboundPort(int port)
Add outbound port to the outbound port list
|
ClientNetworkConfig |
addOutboundPortDefinition(String portDef)
Add outbound port definition to the outbound port definition list
|
List<String> |
getAddresses()
Returns the list of candidate addresses that client will use to establish initial connection
|
ClientAwsConfig |
getAwsConfig()
Returns the current
ClientAwsConfig . |
ClientIcmpPingConfig |
getClientIcmpPingConfig()
ICMP ping is used to detect if machine that a remote hazelcast member runs on alive or not
|
int |
getConnectionAttemptLimit()
See
setConnectionAttemptLimit(int) for details |
int |
getConnectionAttemptPeriod()
Period for the next attempt to find a member to connect.
|
int |
getConnectionTimeout()
Timeout value in millis for nodes to accept client connection requests.
|
DiscoveryConfig |
getDiscoveryConfig()
Returns the configuration of the Hazelcast Discovery SPI and configured discovery providers
|
Collection<String> |
getOutboundPortDefinitions()
Returns the outbound port definitions.
|
Collection<Integer> |
getOutboundPorts()
Returns the outbound ports.
|
SocketInterceptorConfig |
getSocketInterceptorConfig() |
SocketOptions |
getSocketOptions() |
SSLConfig |
getSSLConfig()
Returns the current
SSLConfig . |
boolean |
isRedoOperation()
See
setRedoOperation(boolean) for details |
boolean |
isSmartRouting()
See
setSmartRouting(boolean) for details |
ClientNetworkConfig |
setAddresses(List<String> addresses)
Sets given addresses as candidate address list that client will use to establish initial connection
|
ClientNetworkConfig |
setAwsConfig(ClientAwsConfig clientAwsConfig)
Sets configuration to connect nodes in aws environment.
|
ClientNetworkConfig |
setClientIcmpPingConfig(ClientIcmpPingConfig clientIcmpPingConfig)
ICMP ping is used to detect if machine that a remote hazelcast member runs on alive or not
|
ClientNetworkConfig |
setConnectionAttemptLimit(int connectionAttemptLimit)
While client is trying to connect initially to one of the members in the
addressList ,
all might be not available. |
ClientNetworkConfig |
setConnectionAttemptPeriod(int connectionAttemptPeriod)
Period for the next attempt to find a member to connect.
|
ClientNetworkConfig |
setConnectionTimeout(int connectionTimeout) |
void |
setDiscoveryConfig(DiscoveryConfig discoveryConfig)
Defines the Discovery Provider SPI configuration
|
ClientNetworkConfig |
setOutboundPortDefinitions(Collection<String> outboundPortDefinitions)
Set outbound port definitions
|
ClientNetworkConfig |
setOutboundPorts(Collection<Integer> outboundPorts)
Set outbond ports
|
ClientNetworkConfig |
setRedoOperation(boolean redoOperation)
If true, client will redo the operations that were executing on the server and client lost the connection.
|
ClientNetworkConfig |
setSmartRouting(boolean smartRouting)
If
true , client will route the key based operations to owner of the key on best-effort basis. |
ClientNetworkConfig |
setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig) |
ClientNetworkConfig |
setSocketOptions(SocketOptions socketOptions) |
ClientNetworkConfig |
setSSLConfig(SSLConfig sslConfig)
Sets the
SSLConfig . |
public DiscoveryConfig getDiscoveryConfig()
public void setDiscoveryConfig(DiscoveryConfig discoveryConfig)
discoveryConfig
- the Discovery Provider SPI configurationIllegalArgumentException
- if discoveryConfig is nullpublic boolean isSmartRouting()
setSmartRouting(boolean)
for detailspublic ClientNetworkConfig setSmartRouting(boolean smartRouting)
true
, client will route the key based operations to owner of the key on best-effort basis.
Note that it uses a cached version of PartitionService.getPartitions()
and doesn't
guarantee that the operation will always be executed on the owner. The cached table is updated every 10 seconds.
If smartRouting == false
, all operations will be routed to single member. Operations will need two
hops if the chosen member is not owner of the key. Client will have only single open connection. Useful, if
there are many clients and we want to avoid each of them connecting to each member.
Default value is true
.
smartRouting
- true if smart routing should be enabled.ClientNetworkConfig
for chainingpublic SocketInterceptorConfig getSocketInterceptorConfig()
public ClientNetworkConfig setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)
socketInterceptorConfig
- will be called with the Socket,
each time client creates a connection to any Member.ClientNetworkConfig
for chainingpublic int getConnectionAttemptPeriod()
public ClientNetworkConfig setConnectionAttemptPeriod(int connectionAttemptPeriod)
connectionAttemptPeriod
- time to wait before another attempt in millisClientNetworkConfig
for chainingpublic int getConnectionAttemptLimit()
setConnectionAttemptLimit(int)
for detailspublic ClientNetworkConfig setConnectionAttemptLimit(int connectionAttemptLimit)
addressList
,
all might be not available. Instead of giving up, throwing Exception and stopping client, it will
attempt to retry as much as connectionAttemptLimit
times.connectionAttemptLimit
- number of times to attempt to connect
A zero value means try forever.
A negative value means default valueClientNetworkConfig
for chainingpublic int getConnectionTimeout()
public ClientNetworkConfig setConnectionTimeout(int connectionTimeout)
connectionTimeout
- Timeout value in millis for nodes to accept client connection requests.
A zero value means wait until connection established or an error occurs.ClientNetworkConfig
for chainingpublic ClientNetworkConfig addAddress(String... addresses)
addresses
- to be added to initial address listClientNetworkConfig
for chainingpublic ClientNetworkConfig setAddresses(List<String> addresses)
addresses
- to be added to initial address listClientNetworkConfig
for chainingpublic List<String> getAddresses()
public boolean isRedoOperation()
setRedoOperation(boolean)
for detailspublic ClientNetworkConfig setRedoOperation(boolean redoOperation)
RuntimeException
that is wrapping IOException
.
TODO clear what is the exception hereredoOperation
- true if redo operations are enabledClientNetworkConfig
for chainingpublic SocketOptions getSocketOptions()
public ClientNetworkConfig setSocketOptions(SocketOptions socketOptions)
socketOptions
- TCP Socket optionsClientNetworkConfig
for chainingpublic SSLConfig getSSLConfig()
SSLConfig
. It is possible that null is returned if no SSLConfig has been
set.setSSLConfig(SSLConfig)
public ClientNetworkConfig setSSLConfig(SSLConfig sslConfig)
SSLConfig
. null value indicates that no SSLConfig should be used.sslConfig
- the SSLConfig.getSSLConfig()
public ClientNetworkConfig setAwsConfig(ClientAwsConfig clientAwsConfig)
clientAwsConfig
- the ClientAwsConfiggetAwsConfig()
public ClientAwsConfig getAwsConfig()
ClientAwsConfig
. It is possible that null is returned if no SSLConfig has beensetAwsConfig(ClientAwsConfig)
public Collection<String> getOutboundPortDefinitions()
public Collection<Integer> getOutboundPorts()
public ClientNetworkConfig setOutboundPortDefinitions(Collection<String> outboundPortDefinitions)
outboundPortDefinitions
- outbound port definitionspublic ClientNetworkConfig setOutboundPorts(Collection<Integer> outboundPorts)
outboundPorts
- outbound portspublic ClientNetworkConfig addOutboundPort(int port)
port
- outbound portpublic ClientNetworkConfig addOutboundPortDefinition(String portDef)
portDef
- outbound port definitionpublic ClientIcmpPingConfig getClientIcmpPingConfig()
public ClientNetworkConfig setClientIcmpPingConfig(ClientIcmpPingConfig clientIcmpPingConfig)
clientIcmpPingConfig
- configuration for client icmp pingCopyright © 2018 Hazelcast, Inc.. All rights reserved.