public class ClientNetworkConfig extends Object
Constructor and Description |
---|
ClientNetworkConfig() |
ClientNetworkConfig(ClientNetworkConfig networkConfig) |
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
|
boolean |
equals(Object o) |
List<String> |
getAddresses()
Returns the list of candidate addresses that client will use to establish initial connection
|
ClientAwsConfig |
getAwsConfig()
Returns the current
ClientAwsConfig . |
AzureConfig |
getAzureConfig()
Returns the current
AzureConfig . |
ClientIcmpPingConfig |
getClientIcmpPingConfig()
ICMP ping is used to detect if machine that a remote hazelcast member runs on alive or not
|
ClientCloudConfig |
getCloudConfig() |
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
|
EurekaConfig |
getEurekaConfig()
Returns the current
EurekaConfig . |
GcpConfig |
getGcpConfig()
Returns the current
GcpConfig . |
KubernetesConfig |
getKubernetesConfig()
Returns the current
KubernetesConfig . |
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 . |
int |
hashCode() |
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 |
setAzureConfig(AzureConfig azureConfig)
Sets configuration to connect nodes in Azure environment.
|
ClientNetworkConfig |
setClientIcmpPingConfig(ClientIcmpPingConfig clientIcmpPingConfig)
ICMP ping is used to detect if machine that a remote hazelcast member runs on alive or not
|
void |
setCloudConfig(ClientCloudConfig cloudConfig) |
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 |
setEurekaConfig(EurekaConfig eurekaConfig)
Sets configuration to connect nodes in Eureka environment.
|
ClientNetworkConfig |
setGcpConfig(GcpConfig gcpConfig)
Sets configuration to connect nodes in GCP environment.
|
ClientNetworkConfig |
setKubernetesConfig(KubernetesConfig kubernetesConfig)
Sets configuration to connect nodes in Kubernetes environment.
|
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 ClientNetworkConfig()
public ClientNetworkConfig(ClientNetworkConfig networkConfig)
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
.setAwsConfig(ClientAwsConfig)
public ClientNetworkConfig setGcpConfig(GcpConfig gcpConfig)
gcpConfig
- the GcpConfiggetGcpConfig()
public GcpConfig getGcpConfig()
GcpConfig
.setGcpConfig(GcpConfig)
public ClientNetworkConfig setAzureConfig(AzureConfig azureConfig)
azureConfig
- the AzureConfiggetAzureConfig()
public AzureConfig getAzureConfig()
AzureConfig
.setAzureConfig(AzureConfig)
public ClientNetworkConfig setKubernetesConfig(KubernetesConfig kubernetesConfig)
kubernetesConfig
- the KubernetesConfiggetKubernetesConfig()
public KubernetesConfig getKubernetesConfig()
KubernetesConfig
.setKubernetesConfig(KubernetesConfig)
public ClientNetworkConfig setEurekaConfig(EurekaConfig eurekaConfig)
eurekaConfig
- the EurekaConfiggetEurekaConfig()
public EurekaConfig getEurekaConfig()
EurekaConfig
.setEurekaConfig(EurekaConfig)
public ClientCloudConfig getCloudConfig()
public void setCloudConfig(ClientCloudConfig cloudConfig)
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 © 2020 Hazelcast, Inc.. All Rights Reserved.