Interface ConnectionProperties
-
- All Known Implementing Classes:
ConnectionPropertiesImpl
public interface ConnectionPropertiesProvide access and manipulations with connection JDBC properties.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSSL_MODE_DISABLESSL mode: DISABLE.static StringSSL_MODE_REQUIRESSL mode: REQUIRE.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringdisabledFeatures()Any JDBC features could be force disabled.voiddisabledFeatures(String features)HostAndPortRange[]getAddresses()@org.jetbrains.annotations.Nullable intgetConnectionTimeout()Note: zero value means there is no limits.intgetPartitionAwarenessPartitionDistributionsCacheSize()intgetPartitionAwarenessSqlCacheSize()StringgetPassword()StringgetQueryEngine()@Nullable IntegergetQueryTimeout()Note: zero value means there is no limits.StringgetSchema()intgetSocketReceiveBuffer()intgetSocketSendBuffer()StringgetSslCipherSuites()Gets cipher suites.StringgetSslClientCertificateKeyStorePassword()Gets key store password.StringgetSslClientCertificateKeyStoreType()Gets key store type used for context creation.StringgetSslClientCertificateKeyStoreUrl()Gets the key store URL.StringgetSslFactory()Gets the class name of the custom implementation of the Factory<SSLSocketFactory>.StringgetSslKeyAlgorithm()Gets algorithm that will be used to create a key manager.StringgetSslMode()Gets SSL connection mode.StringgetSslProtocol()Gets protocol for secure transport.StringgetSslTrustCertificateKeyStorePassword()Gets trust store password.StringgetSslTrustCertificateKeyStoreType()Gets trust store type.StringgetSslTrustCertificateKeyStoreUrl()Gets the trust store URL.TransactionConcurrencygetTransactionConcurrency()StringgetTransactionLabel()intgetTransactionTimeout()@Nullable IntegergetUpdateBatchSize()Note: Batch size of 1 prevents deadlock on update where keys sequence are different in several concurrent updates.StringgetUrl()StringgetUserAttributesFactory()Gets the class name of the custom implementation of the Factory<Map<String, String>>.StringgetUsername()booleanisAutoCloseServerCursor()booleanisCollocated()@Nullable BooleanisDataPageScanEnabled()booleanisDistributedJoins()booleanisEnforceJoinOrder()booleanisKeepBinary()Get keep binary configuration flag.booleanisLazy()booleanisPartitionAwareness()booleanisReplicatedOnly()booleanisSkipReducerOnUpdate()booleanisSslTrustAll()Gets trust any server certificate flag.booleanisTcpNoDelay()voidsetAddresses(HostAndPortRange[] addrs)voidsetAutoCloseServerCursor(boolean autoCloseServerCursor)voidsetCollocated(boolean collocated)voidsetConnectionTimeout(@Nullable Integer connTimeout)Note: zero value means there is no limits.voidsetDataPageScanEnabled(@Nullable Boolean dataPageScanEnabled)voidsetDistributedJoins(boolean distributedJoins)voidsetEnforceJoinOrder(boolean enforceJoinOrder)voidsetKeepBinary(boolean keepBinary)Set totrueto keep binary objects in binary form.voidsetLazy(boolean lazy)voidsetPartitionAwareness(boolean partitionAwareness)voidsetPartitionAwarenessPartitionDistributionsCacheSize(int partitionAwarenessPartDistributionsCacheSize)Sets partition distributions cache size that is used within partition awareness optimizations.voidsetPartitionAwarenessSqlCacheSize(int partitionAwarenessSqlCacheSize)Sets SQL cache size that is used within partition awareness optimizations.voidsetPassword(String passwd)voidsetQueryEngine(String qryEngine)Sets SQL query engine for a connection.voidsetQueryTimeout(@Nullable Integer qryTimeout)Note: zero value means there is no limits.voidsetReplicatedOnly(boolean replicatedOnly)voidsetSchema(String schema)voidsetSkipReducerOnUpdate(boolean skipReducerOnUpdate)voidsetSocketReceiveBuffer(int size)voidsetSocketSendBuffer(int size)voidsetSslCipherSuites(String sslCipherSuites)Override default cipher suites.voidsetSslClientCertificateKeyStorePassword(String passwd)Sets key store password.voidsetSslClientCertificateKeyStoreType(String ksType)Sets key store type used in context initialization.voidsetSslClientCertificateKeyStoreUrl(String url)Sets path to the key store file.voidsetSslFactory(String sslFactory)Sets the class name of the custom implementation of the Factory<SSLSocketFactory>.voidsetSslKeyAlgorithm(String keyAlgorithm)Sets key manager algorithm that will be used to create a key manager.voidsetSslMode(String mode)Use SSL connection to Ignite node.voidsetSslProtocol(String sslProtocol)Sets protocol for secure transport.voidsetSslTrustAll(boolean trustAll)Sets totrueto trust any server certificate (revoked, expired or self-signed SSL certificates).voidsetSslTrustCertificateKeyStorePassword(String passwd)Sets trust store password.voidsetSslTrustCertificateKeyStoreType(String ksType)Sets trust store type.voidsetSslTrustCertificateKeyStoreUrl(String url)Sets path to the trust store file.voidsetTcpNoDelay(boolean tcpNoDelay)voidsetTransactionConcurrency(String transactionConcurrency)Sets transaction concurrency.voidsetTransactionLabel(String transactionLabel)Sets transaction label.voidsetTransactionTimeout(int transactionTimeout)Sets transaction timeout in milliseconds.voidsetUpdateBatchSize(@Nullable Integer updateBatchSize)Note: Set to 1 to prevent deadlock on update where keys sequence are different in several concurrent updates.voidsetUrl(String url)voidsetUserAttributesFactory(String sslFactory)Sets the class name of the custom implementation of the Factory<Map<String, String>>.voidsetUsername(String name)
-
-
-
Field Detail
-
SSL_MODE_DISABLE
static final String SSL_MODE_DISABLE
SSL mode: DISABLE.- See Also:
- Constant Field Values
-
SSL_MODE_REQUIRE
static final String SSL_MODE_REQUIRE
SSL mode: REQUIRE.- See Also:
- Constant Field Values
-
-
Method Detail
-
getSchema
String getSchema()
- Returns:
- Schema name of the connection.
-
setSchema
void setSchema(String schema)
- Parameters:
schema- Schema name of the connection.
-
getUrl
String getUrl()
- Returns:
- The URL of the connection.
-
setUrl
void setUrl(String url) throws SQLException
- Parameters:
url- The URL of the connection.- Throws:
SQLException- On invalid URL.
-
getAddresses
HostAndPortRange[] getAddresses()
- Returns:
- Ignite nodes addresses.
-
setAddresses
void setAddresses(HostAndPortRange[] addrs)
- Parameters:
addrs- Ignite nodes addresses.
-
isDistributedJoins
boolean isDistributedJoins()
- Returns:
- Distributed joins flag.
-
setDistributedJoins
void setDistributedJoins(boolean distributedJoins)
- Parameters:
distributedJoins- Distributed joins flag.
-
isEnforceJoinOrder
boolean isEnforceJoinOrder()
- Returns:
- Enforce join order flag.
-
setEnforceJoinOrder
void setEnforceJoinOrder(boolean enforceJoinOrder)
- Parameters:
enforceJoinOrder- Enforce join order flag.
-
isCollocated
boolean isCollocated()
- Returns:
- Collocated flag.
-
setCollocated
void setCollocated(boolean collocated)
- Parameters:
collocated- Collocated flag.
-
isReplicatedOnly
boolean isReplicatedOnly()
- Returns:
- Replicated only flag.
-
setReplicatedOnly
void setReplicatedOnly(boolean replicatedOnly)
- Parameters:
replicatedOnly- Replicated only flag.
-
isAutoCloseServerCursor
boolean isAutoCloseServerCursor()
- Returns:
- Auto close server cursors flag.
-
setAutoCloseServerCursor
void setAutoCloseServerCursor(boolean autoCloseServerCursor)
- Parameters:
autoCloseServerCursor- Auto close server cursors flag.
-
getSocketSendBuffer
int getSocketSendBuffer()
- Returns:
- Socket send buffer size.
-
setSocketSendBuffer
void setSocketSendBuffer(int size) throws SQLException- Parameters:
size- Socket send buffer size.- Throws:
SQLException- On error.
-
getSocketReceiveBuffer
int getSocketReceiveBuffer()
- Returns:
- Socket receive buffer size.
-
setSocketReceiveBuffer
void setSocketReceiveBuffer(int size) throws SQLException- Parameters:
size- Socket receive buffer size.- Throws:
SQLException- On error.
-
isTcpNoDelay
boolean isTcpNoDelay()
- Returns:
- TCP no delay flag.
-
setTcpNoDelay
void setTcpNoDelay(boolean tcpNoDelay)
- Parameters:
tcpNoDelay- TCP no delay flag.
-
isLazy
boolean isLazy()
- Returns:
- Lazy query execution flag.
-
setLazy
void setLazy(boolean lazy)
- Parameters:
lazy- Lazy query execution flag.
-
isSkipReducerOnUpdate
boolean isSkipReducerOnUpdate()
- Returns:
- Skip reducer on update flag.
-
setSkipReducerOnUpdate
void setSkipReducerOnUpdate(boolean skipReducerOnUpdate)
- Parameters:
skipReducerOnUpdate- Skip reducer on update flag.
-
getSslMode
String getSslMode()
Gets SSL connection mode.- Returns:
- Use SSL flag.
-
setSslMode
void setSslMode(String mode)
Use SSL connection to Ignite node. In case set to"require"SSL context must be configured.setSslClientCertificateKeyStoreUrl(java.lang.String)property and related properties must be set up or JSSE properties must be set up (seejavax.net.ssl.keyStoreand otherjavax.net.ssl.*properties) In case set to"disable"plain connection is used. Available modes:"disable", "require". Default value is"disable"- Parameters:
mode- SSL mode.
-
getSslProtocol
String getSslProtocol()
Gets protocol for secure transport.- Returns:
- SSL protocol name.
-
setSslProtocol
void setSslProtocol(String sslProtocol)
Sets protocol for secure transport. If not specified, TLS protocol will be used. Protocols implementations supplied by JSEE: SSLv3 (SSL), TLSv1 (TLS), TLSv1.1, TLSv1.2See more at JSSE Reference Guide.
- Parameters:
sslProtocol- SSL protocol name.
-
getSslCipherSuites
String getSslCipherSuites()
Gets cipher suites.- Returns:
- SSL cipher suites.
-
setSslCipherSuites
void setSslCipherSuites(String sslCipherSuites)
Override default cipher suites.See more at JSSE Reference Guide.
- Parameters:
sslCipherSuites- SSL cipher suites.
-
getSslKeyAlgorithm
String getSslKeyAlgorithm()
Gets algorithm that will be used to create a key manager.- Returns:
- Key manager algorithm.
-
setSslKeyAlgorithm
void setSslKeyAlgorithm(String keyAlgorithm)
Sets key manager algorithm that will be used to create a key manager. Notice that in most cased default value suites well, however, on Android platform this value need to be set to X509. Algorithms implementations supplied by JSEE: PKIX (X509 or SunPKIX), SunX509See more at JSSE Reference Guide.
- Parameters:
keyAlgorithm- Key algorithm name.
-
getSslClientCertificateKeyStoreUrl
String getSslClientCertificateKeyStoreUrl()
Gets the key store URL.- Returns:
- Client certificate KeyStore URL.
-
setSslClientCertificateKeyStoreUrl
void setSslClientCertificateKeyStoreUrl(String url)
Sets path to the key store file. This is a mandatory parameter since ssl context could not be initialized without key manager. In casegetSslMode()isrequiredand key store URL isn't specified by Ignite properties (e.g. at JDBC URL) the JSSE propertyjavax.net.ssl.keyStorewill be used.- Parameters:
url- Client certificate KeyStore URL.
-
getSslClientCertificateKeyStorePassword
String getSslClientCertificateKeyStorePassword()
Gets key store password.- Returns:
- Client certificate KeyStore password.
-
setSslClientCertificateKeyStorePassword
void setSslClientCertificateKeyStorePassword(String passwd)
Sets key store password. In casegetSslMode()isrequiredand key store password isn't specified by Ignite properties (e.g. at JDBC URL) the JSSE propertyjavax.net.ssl.keyStorePasswordwill be used.- Parameters:
passwd- Client certificate KeyStore password.
-
getSslClientCertificateKeyStoreType
String getSslClientCertificateKeyStoreType()
Gets key store type used for context creation.- Returns:
- Client certificate KeyStore type.
-
setSslClientCertificateKeyStoreType
void setSslClientCertificateKeyStoreType(String ksType)
Sets key store type used in context initialization. In casegetSslMode()isrequiredand key store type isn't specified by Ignite properties (e.g. at JDBC URL)the JSSE propertyjavax.net.ssl.keyStoreTypewill 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.
- Parameters:
ksType- Client certificate KeyStore type.
-
getSslTrustCertificateKeyStoreUrl
String getSslTrustCertificateKeyStoreUrl()
Gets the trust store URL.- Returns:
- Trusted certificate KeyStore URL.
-
setSslTrustCertificateKeyStoreUrl
void setSslTrustCertificateKeyStoreUrl(String url)
Sets path to the trust store file. This is an optional parameter, however one of thesetSslTrustCertificateKeyStoreUrl(String),setSslTrustAll(boolean)properties must be set. In casegetSslMode()isrequiredand trust store URL isn't specified by Ignite properties (e.g. at JDBC URL) the JSSE propertyjavax.net.ssl.trustStorewill be used.- Parameters:
url- Trusted certificate KeyStore URL.
-
getSslTrustCertificateKeyStorePassword
String getSslTrustCertificateKeyStorePassword()
Gets trust store password.- Returns:
- Trusted certificate KeyStore password.
-
setSslTrustCertificateKeyStorePassword
void setSslTrustCertificateKeyStorePassword(String passwd)
Sets trust store password. In casegetSslMode()isrequiredand trust store password isn't specified by Ignite properties (e.g. at JDBC URL) the JSSE propertyjavax.net.ssl.trustStorePasswordwill be used.- Parameters:
passwd- Trusted certificate KeyStore password.
-
getSslTrustCertificateKeyStoreType
String getSslTrustCertificateKeyStoreType()
Gets trust store type.- Returns:
- Trusted certificate KeyStore type.
-
setSslTrustCertificateKeyStoreType
void setSslTrustCertificateKeyStoreType(String ksType)
Sets trust store type. In casegetSslMode()isrequiredand trust store type isn't specified by Ignite properties (e.g. at JDBC URL) the JSSE propertyjavax.net.ssl.trustStoreTypewill be used. In case both Ignite properties and JSSE properties are not set the default 'JKS' type is used.- Parameters:
ksType- Trusted certificate KeyStore type.
-
isSslTrustAll
boolean isSslTrustAll()
Gets trust any server certificate flag.- Returns:
- Trust all certificates flag.
-
setSslTrustAll
void setSslTrustAll(boolean trustAll)
Sets totrueto 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.- Parameters:
trustAll- Trust all certificates flag.
-
getSslFactory
String getSslFactory()
Gets the class name of the custom implementation of the Factory<SSLSocketFactory>.- Returns:
- Custom class name that implements Factory<SSLSocketFactory>.
-
setSslFactory
void setSslFactory(String sslFactory)
Sets the class name of the custom implementation of the Factory<SSLSocketFactory>. IfgetSslMode()isrequiredand factory is specified the custom factory will be used instead of JSSE socket factory. So, other SSL properties will be ignored.- Parameters:
sslFactory- Custom class name that implements Factory<SSLSocketFactory>.
-
setUsername
void setUsername(String name)
- Parameters:
name- User name to authentication.
-
getUsername
String getUsername()
- Returns:
- User name to authentication.
-
setPassword
void setPassword(String passwd)
- Parameters:
passwd- User's password.
-
getPassword
String getPassword()
- Returns:
- User's password.
-
isDataPageScanEnabled
@Nullable @Nullable Boolean isDataPageScanEnabled()
- Returns:
trueif data page scan support is enabled for this connection,falseif it's disabled andnullfor server default.
-
setDataPageScanEnabled
void setDataPageScanEnabled(@Nullable @Nullable Boolean dataPageScanEnabled)- Parameters:
dataPageScanEnabled-trueif data page scan support is enabled for this connection, iffalsethen it's disabled, ifnullthen server should use its default settings.
-
isPartitionAwareness
boolean isPartitionAwareness()
- Returns:
trueif jdbc thin partition awareness is enabled for this connection,falseif it's disabled.
-
setPartitionAwareness
void setPartitionAwareness(boolean partitionAwareness)
- Parameters:
partitionAwareness-trueif jdbc thin partition awareness is enabled for this connection, iffalsethen it's disabled.
-
getUpdateBatchSize
@Nullable @Nullable Integer getUpdateBatchSize()
Note: Batch size of 1 prevents deadlock on update where keys sequence are different in several concurrent updates.- Returns:
- update internal bach size.
-
setUpdateBatchSize
void setUpdateBatchSize(@Nullable @Nullable Integer updateBatchSize) throws SQLExceptionNote: Set to 1 to prevent deadlock on update where keys sequence are different in several concurrent updates.- Parameters:
updateBatchSize- update internal bach size.- Throws:
SQLException- On error.
-
getPartitionAwarenessSqlCacheSize
int getPartitionAwarenessSqlCacheSize()
- Returns:
- SQL cache size that is used within partition awareness optimizations.
-
setPartitionAwarenessSqlCacheSize
void setPartitionAwarenessSqlCacheSize(int partitionAwarenessSqlCacheSize) throws SQLExceptionSets SQL cache size that is used within partition awareness optimizations.- Parameters:
partitionAwarenessSqlCacheSize- SQL cache size.- Throws:
SQLException- On error.
-
getPartitionAwarenessPartitionDistributionsCacheSize
int getPartitionAwarenessPartitionDistributionsCacheSize()
- Returns:
- Partition distributions cache size that is used within partition awareness optimizations.
-
setPartitionAwarenessPartitionDistributionsCacheSize
void setPartitionAwarenessPartitionDistributionsCacheSize(int partitionAwarenessPartDistributionsCacheSize) throws SQLExceptionSets partition distributions cache size that is used within partition awareness optimizations.- Parameters:
partitionAwarenessPartDistributionsCacheSize- Partition distributions cache size.- Throws:
SQLException- On error.
-
getQueryTimeout
@Nullable @Nullable Integer getQueryTimeout()
Note: zero value means there is no limits.- Returns:
- Query timeout in seconds.
-
setQueryTimeout
void setQueryTimeout(@Nullable @Nullable Integer qryTimeout) throws SQLExceptionNote: zero value means there is no limits.- Parameters:
qryTimeout- Query timeout in seconds.- Throws:
SQLException
-
getConnectionTimeout
@Nullable @org.jetbrains.annotations.Nullable int getConnectionTimeout()
Note: zero value means there is no limits.- Returns:
- Connection timeout in milliseconds.
-
setConnectionTimeout
void setConnectionTimeout(@Nullable @Nullable Integer connTimeout) throws SQLExceptionNote: zero value means there is no limits.- Parameters:
connTimeout- Connection timeout in milliseconds.- Throws:
SQLException
-
getUserAttributesFactory
String getUserAttributesFactory()
Gets the class name of the custom implementation of the Factory<Map<String, String>>. This factory should return user attributes which can be used on server node.- Returns:
- Custom class name that implements Factory<Map<String, String>>.
-
setUserAttributesFactory
void setUserAttributesFactory(String sslFactory)
Sets the class name of the custom implementation of the Factory<Map<String, String>>. This factory should return user attributes which can be used on server node. Sent attributes can be accessed on server nodes fromGridRestRequestorClientListenerAbstractConnectionContext(depends on client type).- Parameters:
sslFactory- Custom class name that implements Factory<Map<String, String>>.
-
disabledFeatures
String disabledFeatures()
Any JDBC features could be force disabled. SeeJdbcThinFeature. The string should contain enumeration of feature names, separated by the comma.- Returns:
- disabled features.
-
disabledFeatures
void disabledFeatures(String features)
- Parameters:
features- Disabled features. SeeJdbcThinFeature. The string should contain enumeration of feature names, separated by the comma.
-
isKeepBinary
boolean isKeepBinary()
Get keep binary configuration flag.- Returns:
- Keep binary configuration flag.
-
setKeepBinary
void setKeepBinary(boolean keepBinary)
Set totrueto keep binary objects in binary form.Defaults is
false.- Parameters:
keepBinary- Whether to keep binary objects in binary form.
-
getQueryEngine
String getQueryEngine()
- Returns:
- SQL query engine name to use by a connection.
-
setQueryEngine
void setQueryEngine(String qryEngine)
Sets SQL query engine for a connection.- Parameters:
qryEngine- SQL Query engine name.
-
getTransactionConcurrency
TransactionConcurrency getTransactionConcurrency()
- Returns:
- Transaction concurrency value.
-
setTransactionConcurrency
void setTransactionConcurrency(String transactionConcurrency)
Sets transaction concurrency.- Parameters:
transactionConcurrency- Transaction concurrecny.
-
getTransactionTimeout
int getTransactionTimeout()
- Returns:
- Transaction timeout in milliseconds.
-
setTransactionTimeout
void setTransactionTimeout(int transactionTimeout) throws SQLExceptionSets transaction timeout in milliseconds.- Parameters:
transactionTimeout- Transaction timeout in millicesonds.- Throws:
SQLException
-
getTransactionLabel
String getTransactionLabel()
- Returns:
- Transaction label.
-
setTransactionLabel
void setTransactionLabel(String transactionLabel)
Sets transaction label.- Parameters:
transactionLabel- Transaction label.
-
-