Package org.apache.ignite.internal.jdbc.thin

## Interface ConnectionProperties

All Known Implementing Classes:
  `ConnectionPropertiesImpl`

    public interface ConnectionProperties

Provide access and manipulations with connection JDBC properties.

### Field Summary

Fields
`static String` `SSL_MODE_DISABLE` SSL mode: DISABLE.
`static String` `SSL_MODE_REQUIRE` SSL mode: REQUIRE.

### Method Summary

All Methods Instance Methods Abstract Methods
`String` `disabledFeatures()` Any JDBC features could be force disabled.
`void` `disabledFeatures​(String features)`
`HostAndPortRange[]` `getAddresses()`
`@org.jetbrains.annotations.Nullable int` `getConnectionTimeout()` Note: zero value means there is no limits.
`int` `getPartitionAwarenessPartitionDistributionsCacheSize()`
`int` `getPartitionAwarenessSqlCacheSize()`
`String` `getPassword()`
`String` `getQueryEngine()`
`@Nullable 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.
`TransactionConcurrency` `getTransactionConcurrency()`
`String` `getTransactionLabel()`
`int` `getTransactionTimeout()`
`@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()`
`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()`
`void` `setAddresses​(HostAndPortRange[] addrs)`
`void` `setAutoCloseServerCursor​(boolean autoCloseServerCursor)`
`void` `setCollocated​(boolean collocated)`
`void` `setConnectionTimeout​(@Nullable Integer connTimeout)` Note: zero value means there is no limits.
`void` `setDataPageScanEnabled​(@Nullable Boolean dataPageScanEnabled)`
`void` `setDistributedJoins​(boolean distributedJoins)`
`void` `setEnforceJoinOrder​(boolean enforceJoinOrder)`
`void` `setKeepBinary​(boolean keepBinary)` Set to `true` to keep binary objects in binary form.
`void` `setLazy​(boolean lazy)`
`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` `setQueryEngine​(String qryEngine)` Sets SQL query engine for a connection.
`void` `setQueryTimeout​(@Nullable Integer qryTimeout)` Note: zero value means there is no limits.
`void` `setReplicatedOnly​(boolean replicatedOnly)`
`void` `setSchema​(String schema)`
`void` `setSkipReducerOnUpdate​(boolean skipReducerOnUpdate)`
`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 tcpNoDelay)`
`void` `setTransactionConcurrency​(String transactionConcurrency)` Sets transaction concurrency.
`void` `setTransactionLabel​(String transactionLabel)` Sets transaction label.
`void` `setTransactionTimeout​(int transactionTimeout)` Sets transaction timeout in milliseconds.
`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 sslFactory)` Sets the class name of the custom implementation of the Factory<Map<String, String>>.
`void` `setUsername​(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 (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"`

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.2

See 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), SunX509

See 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 case `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.

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 case `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.

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 case `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.

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 the `setSslTrustCertificateKeyStoreUrl(String)`, `setSslTrustAll(boolean)` properties must be set. In case `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.

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 case `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.

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 case `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.

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 to `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.

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>. If `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.

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:
  `true` if data page scan support is enabled for this connection, `false` if it's disabled and `null` for server default.

#### setDataPageScanEnabled

    void setDataPageScanEnabled​(@Nullable
                                @Nullable Boolean dataPageScanEnabled)

Parameters:
  `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.

#### isPartitionAwareness

    boolean isPartitionAwareness()

Returns:
  `true` if jdbc thin partition awareness is enabled for this connection, `false` if it's disabled.

#### setPartitionAwareness

    void setPartitionAwareness​(boolean partitionAwareness)

Parameters:
  `partitionAwareness` - `true` if jdbc thin partition awareness is enabled for this connection, if `false` then 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 SQLException

Note: 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 SQLException

Sets 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 SQLException

Sets 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 SQLException

Note: 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 SQLException

Note: 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 from `GridRestRequest` or `ClientListenerAbstractConnectionContext` (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. See `JdbcThinFeature`. The string should contain enumeration of feature names, separated by the comma.

Returns:
  disabled features.

#### disabledFeatures

    void disabledFeatures​(String features)

Parameters:
  `features` - Disabled features. See `JdbcThinFeature`. 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 to `true` to 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 SQLException

Sets 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.