public final class DefaultConnectionSpec extends ConnectionSpec.RefImpl
ConnectionSpec for details of these properties and flags.
The default Connection.Modality for the Connection is Connection.Modality.Synchronous.
This ConnectionSpec is configured to prefer bandwidth and relatively large (48K)
buffers (which is probably less than your OS's default buffer sizes anyway, but you never know).
Connection Retry limit is DefaultConnectionSpec#DEFAULT_RECONNECT_CNT.
Connection is spec'd for Keep Alive.
Socket timeout is DEFAULT_READ_TIMEOUT_MSEC
No codecs and/or compression classes are defined.
ConnectionSpec.RefImpl| Modifier and Type | Field and Description |
|---|---|
private static boolean |
DEFAULT_CF_CONNECT_IMMEDIATELY
def value:
true |
private static boolean |
DEFAULT_CF_PIPELINE
def value:
false |
private static boolean |
DEFAULT_CF_RELIABLE
def value:
false |
private static boolean |
DEFAULT_CF_SHARED
def value:
true |
private static boolean |
DEFAULT_CF_STATEFUL
def value:
true |
private static Connection.Modality |
DEFAULT_CP_CONN_MODALITY
def value:
Modality.Synchronous |
private static int |
DEFAULT_CP_MAX_CONNECT_ATTEMPT
def value:
3 |
(package private) static int |
DEFAULT_HEARTBEAT_SEC
def value:
1 sec. |
private static int |
DEFAULT_RCV_BUFF_SIZE
def value:
48KB |
(package private) static int |
DEFAULT_READ_TIMEOUT_MSEC
def value:
5000 msecs |
(package private) static int |
DEFAULT_REDIS_DB |
(package private) static java.lang.String |
DEFAULT_REDIS_HOST_NAME |
(package private) static byte[] |
DEFAULT_REDIS_PASSWORD |
(package private) static int |
DEFAULT_REDIS_PORT |
private static int |
DEFAULT_SND_BUFF_SIZE
def value:
48KB |
private static int |
DEFAULT_SO_PREF_BANDWIDTH
def value:
0 e.g. |
private static int |
DEFAULT_SO_PREF_CONN_TIME
def value:
3 e.g. |
private static int |
DEFAULT_SO_PREF_LATENCY
def value:
1 e.g. |
| Constructor and Description |
|---|
DefaultConnectionSpec()
Instantiates a default connection spec for the given host and port.
|
DefaultConnectionSpec(java.net.InetAddress address,
int port)
Deprecated.
|
DefaultConnectionSpec(java.net.InetAddress address,
int port,
int database,
byte[] credentials)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static ConnectionSpec |
newSpec() |
static ConnectionSpec |
newSpec(java.net.InetAddress address,
int port,
int database,
byte[] credentials)
Returns an instance of the
ConnectionSpec used by this Connection
as default spec, for the provided params. |
static ConnectionSpec |
newSpec(java.lang.String host,
int port,
int database,
byte[] credentials)
Returns an instance of the
ConnectionSpec used by this Connection
as default spec, for the provided params. |
private void |
setDefaultValues()
Set the default values for the
ConnectionSpec
other properties. |
getAddress, getConnectionFlag, getConnectionProperty, getCredentials, getDatabase, getHeartbeat, getMaxConnectWait, getModality, getPort, getReconnectCnt, getSocketFlag, getSocketProperty, setAddress, setConnectionFlag, setConnectionProperty, setCredentials, setCredentials, setDatabase, setHeartbeat, setMaxConnectWait, setModality, setPort, setReconnectCnt, setSocketFlag, setSocketPropertystatic final int DEFAULT_REDIS_PORT
static final java.lang.String DEFAULT_REDIS_HOST_NAME
static final int DEFAULT_REDIS_DB
static final byte[] DEFAULT_REDIS_PASSWORD
private static final int DEFAULT_RCV_BUFF_SIZE
48KBprivate static final int DEFAULT_SND_BUFF_SIZE
48KBstatic final int DEFAULT_READ_TIMEOUT_MSEC
5000 msecsstatic final int DEFAULT_HEARTBEAT_SEC
1 sec. (min timeout in redis confprivate static final int DEFAULT_SO_PREF_BANDWIDTH
0 e.g. higher priority pref is bandwidthprivate static final int DEFAULT_SO_PREF_LATENCY
1 e.g. second priority pref is latencyprivate static final int DEFAULT_SO_PREF_CONN_TIME
3 e.g. third priority pref is connection timeprivate static final boolean DEFAULT_CF_SHARED
trueprivate static final boolean DEFAULT_CF_RELIABLE
falseprivate static final boolean DEFAULT_CF_PIPELINE
falseprivate static final boolean DEFAULT_CF_CONNECT_IMMEDIATELY
trueprivate static final boolean DEFAULT_CF_STATEFUL
trueprivate static final Connection.Modality DEFAULT_CP_CONN_MODALITY
Modality.Synchronousprivate static final int DEFAULT_CP_MAX_CONNECT_ATTEMPT
3public DefaultConnectionSpec()
throws ClientRuntimeException
address - port - ClientRuntimeException - for invalid port, or null address values@Deprecated
public DefaultConnectionSpec(java.net.InetAddress address,
int port)
throws ClientRuntimeException
address - port - ClientRuntimeException - for invalid port, or null address values@Deprecated
public DefaultConnectionSpec(java.net.InetAddress address,
int port,
int database,
byte[] credentials)
throws ClientRuntimeException
address - port - database - credentials - ClientRuntimeException - for invalid port, or null address valuesprivate void setDefaultValues()
ConnectionSpec
other properties.ConnectionSpec,
Connection.Property,
Connection.Property,
Connection.Flag,
Connection.Socket.Flag,
Connection.Socket.Property,
DefaultConnectionFactory,
DefaultProtocolFactorypublic static final ConnectionSpec newSpec() throws ClientRuntimeException
ClientRuntimeExceptionpublic static final ConnectionSpec newSpec(java.lang.String host, int port, int database, byte[] credentials) throws ClientRuntimeException
ConnectionSpec used by this Connection
as default spec, for the provided params.host - port - database - credentials - redisversion - ClientRuntimeExceptionpublic static final ConnectionSpec newSpec(java.net.InetAddress address, int port, int database, byte[] credentials) throws ClientRuntimeException
ConnectionSpec used by this Connection
as default spec, for the provided params.address - port - database - credentials - redisversion - ClientRuntimeException