public class ConnectionPropertiesImpl extends Object implements ConnectionProperties, Serializable
Modifier and Type | Field and Description |
---|---|
static String |
PROP_PREFIX
Prefix for property names.
|
SSL_MODE_DISABLE, SSL_MODE_REQUIRE
Constructor and Description |
---|
ConnectionPropertiesImpl() |
Modifier and Type | Method and Description |
---|---|
String |
disabledFeatures()
Any JDBC features could be force disabled.
|
void |
disabledFeatures(String features) |
HostAndPortRange[] |
getAddresses() |
int |
getConnectionTimeout()
Note: zero value means there is no limits.
|
DriverPropertyInfo[] |
getDriverPropertyInfo() |
int |
getPartitionAwarenessPartitionDistributionsCacheSize() |
int |
getPartitionAwarenessSqlCacheSize() |
String |
getPassword() |
Integer |
getQueryTimeout()
Note: zero value means there is no limits.
|
String |
getSchema() |
int |
getSocketReceiveBuffer() |
int |
getSocketSendBuffer() |
String |
getSslCipherSuites()
Gets cipher suites.
|
String |
getSslClientCertificateKeyStorePassword()
Gets key store password.
|
String |
getSslClientCertificateKeyStoreType()
Gets key store type used for context creation.
|
String |
getSslClientCertificateKeyStoreUrl()
Gets the key store URL.
|
String |
getSslFactory()
Gets the class name of the custom implementation of the Factory<SSLSocketFactory>.
|
String |
getSslKeyAlgorithm()
Gets algorithm that will be used to create a key manager.
|
String |
getSslMode()
Gets SSL connection mode.
|
String |
getSslProtocol()
Gets protocol for secure transport.
|
String |
getSslTrustCertificateKeyStorePassword()
Gets trust store password.
|
String |
getSslTrustCertificateKeyStoreType()
Gets trust store type.
|
String |
getSslTrustCertificateKeyStoreUrl()
Gets the trust store URL.
|
@Nullable Integer |
getUpdateBatchSize()
Note: Batch size of 1 prevents deadlock on update where keys sequence are different in several concurrent updates.
|
String |
getUrl() |
String |
getUserAttributesFactory()
Gets the class name of the custom implementation of the Factory<Map<String, String>>.
|
String |
getUsername() |
void |
init(String url,
Properties props) |
boolean |
isAutoCloseServerCursor() |
boolean |
isCollocated() |
@Nullable Boolean |
isDataPageScanEnabled() |
boolean |
isDistributedJoins() |
boolean |
isEnforceJoinOrder() |
boolean |
isKeepBinary()
Get keep binary configuration flag.
|
boolean |
isLazy() |
boolean |
isPartitionAwareness() |
boolean |
isReplicatedOnly() |
boolean |
isSkipReducerOnUpdate() |
boolean |
isSslTrustAll()
Gets trust any server certificate flag.
|
boolean |
isTcpNoDelay() |
String |
nestedTxMode() |
void |
nestedTxMode(String val) |
void |
setAddresses(HostAndPortRange[] addrs) |
void |
setAutoCloseServerCursor(boolean val) |
void |
setCollocated(boolean val) |
void |
setConnectionTimeout(@Nullable Integer timeout)
Note: zero value means there is no limits.
|
void |
setDataPageScanEnabled(@Nullable Boolean dataPageScanEnabled) |
void |
setDistributedJoins(boolean val) |
void |
setEnforceJoinOrder(boolean val) |
void |
setKeepBinary(boolean keepBinary)
Set to
true to keep binary objects in binary form. |
void |
setLazy(boolean val) |
void |
setPartitionAwareness(boolean partitionAwareness) |
void |
setPartitionAwarenessPartitionDistributionsCacheSize(int partitionAwarenessPartDistributionsCacheSize)
Sets partition distributions cache size that is used within partition awareness optimizations.
|
void |
setPartitionAwarenessSqlCacheSize(int partitionAwarenessSqlCacheSize)
Sets SQL cache size that is used within partition awareness optimizations.
|
void |
setPassword(String passwd) |
void |
setQueryTimeout(@Nullable Integer timeout)
Note: zero value means there is no limits.
|
void |
setReplicatedOnly(boolean val) |
void |
setSchema(String schema) |
void |
setSkipReducerOnUpdate(boolean val) |
void |
setSocketReceiveBuffer(int size) |
void |
setSocketSendBuffer(int size) |
void |
setSslCipherSuites(String sslCipherSuites)
Override default cipher suites.
|
void |
setSslClientCertificateKeyStorePassword(String passwd)
Sets key store password.
|
void |
setSslClientCertificateKeyStoreType(String ksType)
Sets key store type used in context initialization.
|
void |
setSslClientCertificateKeyStoreUrl(String url)
Sets path to the key store file.
|
void |
setSslFactory(String sslFactory)
Sets the class name of the custom implementation of the Factory<SSLSocketFactory>.
|
void |
setSslKeyAlgorithm(String keyAlgorithm)
Sets key manager algorithm that will be used to create a key manager.
|
void |
setSslMode(String mode)
Use SSL connection to Ignite node.
|
void |
setSslProtocol(String sslProtocol)
Sets protocol for secure transport.
|
void |
setSslTrustAll(boolean trustAll)
Sets to
true to trust any server certificate (revoked, expired or self-signed SSL certificates). |
void |
setSslTrustCertificateKeyStorePassword(String passwd)
Sets trust store password.
|
void |
setSslTrustCertificateKeyStoreType(String ksType)
Sets trust store type.
|
void |
setSslTrustCertificateKeyStoreUrl(String url)
Sets path to the trust store file.
|
void |
setTcpNoDelay(boolean val) |
void |
setUpdateBatchSize(@Nullable Integer updateBatchSize)
Note: Set to 1 to prevent deadlock on update where keys sequence are different in several concurrent updates.
|
void |
setUrl(String url) |
void |
setUserAttributesFactory(String cls)
Sets the class name of the custom implementation of the Factory<Map<String, String>>.
|
void |
setUsername(String name) |
Properties |
storeToProperties() |
public static final String PROP_PREFIX
public String getSchema()
getSchema
in interface ConnectionProperties
public void setSchema(String schema)
setSchema
in interface ConnectionProperties
schema
- Schema name of the connection.public String getUrl()
getUrl
in interface ConnectionProperties
public void setUrl(String url) throws SQLException
setUrl
in interface ConnectionProperties
url
- The URL of the connection.SQLException
- On invalid URL.public HostAndPortRange[] getAddresses()
getAddresses
in interface ConnectionProperties
public void setAddresses(HostAndPortRange[] addrs)
setAddresses
in interface ConnectionProperties
addrs
- Ignite nodes addresses.public boolean isDistributedJoins()
isDistributedJoins
in interface ConnectionProperties
public void setDistributedJoins(boolean val)
setDistributedJoins
in interface ConnectionProperties
val
- Distributed joins flag.public boolean isEnforceJoinOrder()
isEnforceJoinOrder
in interface ConnectionProperties
public void setEnforceJoinOrder(boolean val)
setEnforceJoinOrder
in interface ConnectionProperties
val
- Enforce join order flag.public boolean isCollocated()
isCollocated
in interface ConnectionProperties
public void setCollocated(boolean val)
setCollocated
in interface ConnectionProperties
val
- Collocated flag.public boolean isReplicatedOnly()
isReplicatedOnly
in interface ConnectionProperties
public void setReplicatedOnly(boolean val)
setReplicatedOnly
in interface ConnectionProperties
val
- Replicated only flag.public boolean isAutoCloseServerCursor()
isAutoCloseServerCursor
in interface ConnectionProperties
public void setAutoCloseServerCursor(boolean val)
setAutoCloseServerCursor
in interface ConnectionProperties
val
- Auto close server cursors flag.public int getSocketSendBuffer()
getSocketSendBuffer
in interface ConnectionProperties
public void setSocketSendBuffer(int size) throws SQLException
setSocketSendBuffer
in interface ConnectionProperties
size
- Socket send buffer size.SQLException
- On error.public int getSocketReceiveBuffer()
getSocketReceiveBuffer
in interface ConnectionProperties
public void setSocketReceiveBuffer(int size) throws SQLException
setSocketReceiveBuffer
in interface ConnectionProperties
size
- Socket receive buffer size.SQLException
- On error.public boolean isTcpNoDelay()
isTcpNoDelay
in interface ConnectionProperties
public void setTcpNoDelay(boolean val)
setTcpNoDelay
in interface ConnectionProperties
val
- TCP no delay flag.public boolean isLazy()
isLazy
in interface ConnectionProperties
public void setLazy(boolean val)
setLazy
in interface ConnectionProperties
val
- Lazy query execution flag.public boolean isSkipReducerOnUpdate()
isSkipReducerOnUpdate
in interface ConnectionProperties
public void setSkipReducerOnUpdate(boolean val)
setSkipReducerOnUpdate
in interface ConnectionProperties
val
- Skip reducer on update flag.public String getSslMode()
getSslMode
in interface ConnectionProperties
ConnectionProperties.setSslMode(String).
public void setSslMode(String mode)
"require"
SSL context must be configured.
ConnectionProperties.setSslClientCertificateKeyStoreUrl(java.lang.String)
property and related properties must be set up
or JSSE properties must be set up (see javax.net.ssl.keyStore
and other javax.net.ssl.*
properties)
In case set to "disable"
plain connection is used.
Available modes: "disable", "require"
. Default value is "disable"
setSslMode
in interface ConnectionProperties
mode
- SSL mode.public String getSslProtocol()
getSslProtocol
in interface ConnectionProperties
public void setSslProtocol(String sslProtocol)
See more at JSSE Reference Guide.
setSslProtocol
in interface ConnectionProperties
sslProtocol
- SSL protocol name.public String getSslCipherSuites()
getSslCipherSuites
in interface ConnectionProperties
public void setSslCipherSuites(String sslCipherSuites)
See more at JSSE Reference Guide.
setSslCipherSuites
in interface ConnectionProperties
sslCipherSuites
- SSL cipher suites.public String getSslKeyAlgorithm()
getSslKeyAlgorithm
in interface ConnectionProperties
public void setSslKeyAlgorithm(String keyAlgorithm)
See more at JSSE Reference Guide.
setSslKeyAlgorithm
in interface ConnectionProperties
keyAlgorithm
- Key algorithm name.public String getSslClientCertificateKeyStoreUrl()
getSslClientCertificateKeyStoreUrl
in interface ConnectionProperties
public void setSslClientCertificateKeyStoreUrl(String url)
ConnectionProperties.getSslMode()
is required
and key store URL isn't specified by Ignite properties
(e.g. at JDBC URL) the JSSE property javax.net.ssl.keyStore
will be used.setSslClientCertificateKeyStoreUrl
in interface ConnectionProperties
url
- Client certificate KeyStore URL.public String getSslClientCertificateKeyStorePassword()
getSslClientCertificateKeyStorePassword
in interface ConnectionProperties
public void setSslClientCertificateKeyStorePassword(String passwd)
ConnectionProperties.getSslMode()
is required
and key store password isn't specified by Ignite properties
(e.g. at JDBC URL) the JSSE property javax.net.ssl.keyStorePassword
will be used.setSslClientCertificateKeyStorePassword
in interface ConnectionProperties
passwd
- Client certificate KeyStore password.public String getSslClientCertificateKeyStoreType()
getSslClientCertificateKeyStoreType
in interface ConnectionProperties
public void setSslClientCertificateKeyStoreType(String ksType)
ConnectionProperties.getSslMode()
is required
and key store type isn't specified by Ignite properties
(e.g. at JDBC URL)the JSSE property javax.net.ssl.keyStoreType
will be used.
In case both Ignite properties and JSSE properties are not set the default 'JKS' type is used.
See more at JSSE Reference Guide.
setSslClientCertificateKeyStoreType
in interface ConnectionProperties
ksType
- Client certificate KeyStore type.public String getSslTrustCertificateKeyStoreUrl()
getSslTrustCertificateKeyStoreUrl
in interface ConnectionProperties
public void setSslTrustCertificateKeyStoreUrl(String url)
setSslTrustCertificateKeyStoreUrl(String)
, ConnectionProperties.setSslTrustAll(boolean)
properties must be set.
In case ConnectionProperties.getSslMode()
is required
and trust store URL isn't specified by Ignite properties
(e.g. at JDBC URL) the JSSE property javax.net.ssl.trustStore
will be used.setSslTrustCertificateKeyStoreUrl
in interface ConnectionProperties
url
- Trusted certificate KeyStore URL.public String getSslTrustCertificateKeyStorePassword()
getSslTrustCertificateKeyStorePassword
in interface ConnectionProperties
public void setSslTrustCertificateKeyStorePassword(String passwd)
ConnectionProperties.getSslMode()
is required
and trust store password isn't specified by Ignite properties
(e.g. at JDBC URL) the JSSE property javax.net.ssl.trustStorePassword
will be used.setSslTrustCertificateKeyStorePassword
in interface ConnectionProperties
passwd
- Trusted certificate KeyStore password.public String getSslTrustCertificateKeyStoreType()
getSslTrustCertificateKeyStoreType
in interface ConnectionProperties
public void setSslTrustCertificateKeyStoreType(String ksType)
ConnectionProperties.getSslMode()
is required
and trust store type isn't specified by Ignite properties
(e.g. at JDBC URL) the JSSE property javax.net.ssl.trustStoreType
will be used.
In case both Ignite properties and JSSE properties are not set the default 'JKS' type is used.setSslTrustCertificateKeyStoreType
in interface ConnectionProperties
ksType
- Trusted certificate KeyStore type.public boolean isSslTrustAll()
isSslTrustAll
in interface ConnectionProperties
public void setSslTrustAll(boolean trustAll)
true
to trust any server certificate (revoked, expired or self-signed SSL certificates).
Defaults is false
.
Note: Do not enable this option in production you are ever going to use
on a network you do not entirely trust. Especially anything going over the public internet.
setSslTrustAll
in interface ConnectionProperties
trustAll
- Trust all certificates flag.public String getSslFactory()
getSslFactory
in interface ConnectionProperties
public void setSslFactory(String sslFactory)
ConnectionProperties.getSslMode()
is required
and factory is specified the custom factory will be used
instead of JSSE socket factory. So, other SSL properties will be ignored.setSslFactory
in interface ConnectionProperties
sslFactory
- Custom class name that implements Factory<SSLSocketFactory>.public String nestedTxMode()
nestedTxMode
in interface ConnectionProperties
public void nestedTxMode(String val)
nestedTxMode
in interface ConnectionProperties
val
- Nested transactions handling strategy.public void setUsername(String name)
setUsername
in interface ConnectionProperties
name
- User name to authentication.public String getUsername()
getUsername
in interface ConnectionProperties
public void setPassword(String passwd)
setPassword
in interface ConnectionProperties
passwd
- User's password.public String getPassword()
getPassword
in interface ConnectionProperties
@Nullable public @Nullable Boolean isDataPageScanEnabled()
isDataPageScanEnabled
in interface ConnectionProperties
true
if data page scan support is enabled for this connection, false
if it's disabled
and null
for server default.public void setDataPageScanEnabled(@Nullable @Nullable Boolean dataPageScanEnabled)
setDataPageScanEnabled
in interface ConnectionProperties
dataPageScanEnabled
- true
if data page scan support is enabled for this connection,
if false
then it's disabled, if null
then server should use its default settings.public boolean isPartitionAwareness()
isPartitionAwareness
in interface ConnectionProperties
true
if jdbc thin partition awareness is enabled for this connection,
false
if it's disabled.public void setPartitionAwareness(boolean partitionAwareness)
setPartitionAwareness
in interface ConnectionProperties
partitionAwareness
- true
if jdbc thin partition awareness is enabled
for this connection, if false
then it's disabled.@Nullable public @Nullable Integer getUpdateBatchSize()
getUpdateBatchSize
in interface ConnectionProperties
public void setUpdateBatchSize(@Nullable @Nullable Integer updateBatchSize) throws SQLException
setUpdateBatchSize
in interface ConnectionProperties
updateBatchSize
- update internal bach size.SQLException
- On error.public int getPartitionAwarenessSqlCacheSize()
getPartitionAwarenessSqlCacheSize
in interface ConnectionProperties
public void setPartitionAwarenessSqlCacheSize(int partitionAwarenessSqlCacheSize) throws SQLException
setPartitionAwarenessSqlCacheSize
in interface ConnectionProperties
partitionAwarenessSqlCacheSize
- SQL cache size.SQLException
- On error.public int getPartitionAwarenessPartitionDistributionsCacheSize()
getPartitionAwarenessPartitionDistributionsCacheSize
in interface ConnectionProperties
public void setPartitionAwarenessPartitionDistributionsCacheSize(int partitionAwarenessPartDistributionsCacheSize) throws SQLException
setPartitionAwarenessPartitionDistributionsCacheSize
in interface ConnectionProperties
partitionAwarenessPartDistributionsCacheSize
- Partition distributions cache size.SQLException
- On error.public Integer getQueryTimeout()
getQueryTimeout
in interface ConnectionProperties
public void setQueryTimeout(@Nullable @Nullable Integer timeout) throws SQLException
setQueryTimeout
in interface ConnectionProperties
timeout
- Query timeout in seconds.SQLException
public int getConnectionTimeout()
getConnectionTimeout
in interface ConnectionProperties
public void setConnectionTimeout(@Nullable @Nullable Integer timeout) throws SQLException
setConnectionTimeout
in interface ConnectionProperties
timeout
- Connection timeout in milliseconds.SQLException
public String getUserAttributesFactory()
getUserAttributesFactory
in interface ConnectionProperties
public void setUserAttributesFactory(String cls)
GridRestRequest
or
ClientListenerAbstractConnectionContext
(depends on client type).setUserAttributesFactory
in interface ConnectionProperties
cls
- Custom class name that implements Factory<Map<String, String>>.public String disabledFeatures()
JdbcThinFeature
.
The string should contain enumeration of feature names, separated by the comma.disabledFeatures
in interface ConnectionProperties
public void disabledFeatures(String features)
disabledFeatures
in interface ConnectionProperties
features
- Disabled features. See JdbcThinFeature
.
The string should contain enumeration of feature names, separated by the comma.public boolean isKeepBinary()
isKeepBinary
in interface ConnectionProperties
public void setKeepBinary(boolean keepBinary)
true
to keep binary objects in binary form.
Defaults is false
.
setKeepBinary
in interface ConnectionProperties
keepBinary
- Whether to keep binary objects in binary form.public void init(String url, Properties props) throws SQLException
url
- URL connection.props
- Environment properties.SQLException
- On error.public DriverPropertyInfo[] getDriverPropertyInfo()
public Properties storeToProperties()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021