public class MultiConnectionConfig
extends java.lang.Object
LiveViewMultiConnection
.Constructor and Description |
---|
MultiConnectionConfig(java.util.List<ConnectionConfig> configs,
MultiConnectionListener listener)
Use this constructor if you need to configure the servers differently.
|
MultiConnectionConfig(java.util.List<java.lang.String> uris,
java.lang.String username,
java.lang.String password,
MultiConnectionListener listener)
Use this constructor if the servers all use the same username and password (which can be null)
|
Modifier and Type | Method and Description |
---|---|
java.util.List<ConnectionConfig> |
getConfigs() |
ConnectionMode |
getConnectionMode() |
MultiConnectionListener |
getListener() |
int |
getMaxRandomReconnectDelaySeconds() |
long |
getRetryIntervalMillis() |
long |
getTimeoutMillis()
The amount of time to consider a connection attempt failed.
|
void |
setClientCapabilities(java.util.EnumSet<LiveViewClientCapability> capabilities)
Declare your client capabilities to be something less than the current default.
|
void |
setConnectionMode(ConnectionMode connectionMode) |
void |
setListener(MultiConnectionListener listener) |
void |
setMaxRandomReconnectDelaySeconds(int maxRandomReconnectDelaySeconds)
When any connection with queries is lost, The LiveViewMultiConnection will wait a random amount of time
from 0 to this value in seconds before trying to reconnect those queries to another server.
|
void |
setRetryIntervalMillis(long retryIntervalMillis)
This is the wait between retry attempts.
|
void |
setTimeoutMillis(long timeoutMillis)
The amount of time to consider a connection attempt failed.
|
public MultiConnectionConfig(java.util.List<ConnectionConfig> configs, MultiConnectionListener listener)
configs
- List of ConnectionConfigslistener,
- if you want to be notified of connection events. May be null.public MultiConnectionConfig(java.util.List<java.lang.String> uris, java.lang.String username, java.lang.String password, MultiConnectionListener listener) throws LiveViewException
uris
- The uris to the serversusername
- username on all the servers. May be null.password
- password on all the servers. May be null.listener,
- if you want to be notified of connection events. May be null.LiveViewException
public java.util.List<ConnectionConfig> getConfigs()
public MultiConnectionListener getListener()
public void setListener(MultiConnectionListener listener)
listener
- the listener to setpublic ConnectionMode getConnectionMode()
public void setConnectionMode(ConnectionMode connectionMode)
connectionMode
- the connectionMode to setpublic long getTimeoutMillis()
public void setTimeoutMillis(long timeoutMillis)
timeoutMillis
- public void setClientCapabilities(java.util.EnumSet<LiveViewClientCapability> capabilities)
capabilities
- LiveViewClientCapability.CURRENT_LV_CLIENT_CAPABILITY
public long getRetryIntervalMillis()
public void setRetryIntervalMillis(long retryIntervalMillis)
retryIntervalMillis
- the retryIntervalMillis to set. 10 ms is the minimum accepted.public int getMaxRandomReconnectDelaySeconds()
public void setMaxRandomReconnectDelaySeconds(int maxRandomReconnectDelaySeconds)
maxRandomReconnectDelaySeconds
- the maxRandomReconnectDelaySeconds to set