Package com.hazelcast.client.config
Class ClientConnectionStrategyConfig
- java.lang.Object
-
- com.hazelcast.client.config.ClientConnectionStrategyConfig
-
public class ClientConnectionStrategyConfig extends java.lang.Object
Client connection strategy configuration is used for setting custom strategies and configuring strategy parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClientConnectionStrategyConfig.ReconnectMode
Reconnect options.
-
Constructor Summary
Constructors Constructor Description ClientConnectionStrategyConfig()
ClientConnectionStrategyConfig(ClientConnectionStrategyConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
ConnectionRetryConfig
getConnectionRetryConfig()
Connection Retry Config is controls the period among the retries and when should a client gave up retrying.ClientConnectionStrategyConfig.ReconnectMode
getReconnectMode()
int
hashCode()
boolean
isAsyncStart()
Client instance creation won't block onHazelcastClient.newHazelcastClient()
if this value is trueClientConnectionStrategyConfig
setAsyncStart(boolean asyncStart)
Set true for non blockingHazelcastClient.newHazelcastClient()
.ClientConnectionStrategyConfig
setConnectionRetryConfig(ConnectionRetryConfig connectionRetryConfig)
Connection Retry Config is controls the period among the retries and when should a client gave up retrying.ClientConnectionStrategyConfig
setReconnectMode(ClientConnectionStrategyConfig.ReconnectMode reconnectMode)
How a client reconnect to cluster after a disconnect can be configured.java.lang.String
toString()
-
-
-
Constructor Detail
-
ClientConnectionStrategyConfig
public ClientConnectionStrategyConfig()
-
ClientConnectionStrategyConfig
public ClientConnectionStrategyConfig(ClientConnectionStrategyConfig config)
-
-
Method Detail
-
isAsyncStart
public boolean isAsyncStart()
Client instance creation won't block onHazelcastClient.newHazelcastClient()
if this value is true- Returns:
- if client connects to cluster asynchronously
-
setAsyncStart
public ClientConnectionStrategyConfig setAsyncStart(boolean asyncStart)
Set true for non blockingHazelcastClient.newHazelcastClient()
. The client creation won't wait to connect to cluster. The client instace will throw exception until it connects to cluster and become ready. If set to false,HazelcastClient.newHazelcastClient()
will block until a cluster connection established and it's ready to use client instance default value is false- Parameters:
asyncStart
- true for async client creation- Returns:
- the updated ClientConnectionStrategyConfig
-
getReconnectMode
public ClientConnectionStrategyConfig.ReconnectMode getReconnectMode()
- Returns:
- reconnect mode
-
setReconnectMode
public ClientConnectionStrategyConfig setReconnectMode(ClientConnectionStrategyConfig.ReconnectMode reconnectMode)
How a client reconnect to cluster after a disconnect can be configured. This parameter is used by default strategy and custom implementations may ignore it if configured. default value isClientConnectionStrategyConfig.ReconnectMode.ON
- Parameters:
reconnectMode
- the reconnect mode- Returns:
- the updated ClientConnectionStrategyConfig
-
getConnectionRetryConfig
public ConnectionRetryConfig getConnectionRetryConfig()
Connection Retry Config is controls the period among the retries and when should a client gave up retrying. Exponential behaviour can be chosen or jitter can be added to wait periods.- Returns:
- connection retry config
-
setConnectionRetryConfig
public ClientConnectionStrategyConfig setConnectionRetryConfig(ConnectionRetryConfig connectionRetryConfig)
Connection Retry Config is controls the period among the retries and when should a client gave up retrying. Exponential behaviour can be chosen or jitter can be added to wait periods.- Parameters:
connectionRetryConfig
- the connection retry config- Returns:
- the updated ClientConnectionStrategyConfig
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-