Package org.apache.ignite
Class IgniteJdbcThinDataSource
- java.lang.Object
- 
- org.apache.ignite.IgniteJdbcThinDataSource
 
- 
- All Implemented Interfaces:
- Serializable,- Wrapper,- CommonDataSource,- DataSource
 
 public class IgniteJdbcThinDataSource extends Object implements DataSource, Serializable JDBC thin DataSource implementation.- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description IgniteJdbcThinDataSource()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description String[]getAddresses()StringgetCipherSuites()Gets cipher suites.ConnectiongetConnection()ConnectiongetConnection(String username, String pwd)intgetLoginTimeout()PrintWritergetLogWriter()LoggergetParentLogger()StringgetPassword()StringgetSchema()intgetSocketReceiveBuffer()intgetSocketSendBuffer()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.StringgetUrl()StringgetURL()Different application servers us different format (URL & url).StringgetUsername()booleanisAutoCloseServerCursor()booleanisCollocated()booleanisDistributedJoins()booleanisEnforceJoinOrder()booleanisLazy()booleanisReplicatedOnly()booleanisSkipReducerOnUpdate()booleanisSslTrustAll()Gets trust any server certificate flag.booleanisTcpNoDelay()booleanisWrapperFor(Class<?> iface)voidsetAddresses(String... addrsStr)Sets the addresses of the Ignite nodes to connect; address string format:host[:portRangeFrom[..portRangeTo]].voidsetAutoCloseServerCursor(boolean autoCloseServerCursor)voidsetCipherSuites(String cipherSuites)Override default cipher suites.voidsetCollocated(boolean collocated)voidsetDistributedJoins(boolean distributedJoins)voidsetEnforceJoinOrder(boolean enforceJoinOrder)voidsetLazy(boolean lazy)voidsetLoginTimeout(int seconds)voidsetLogWriter(PrintWriter out)voidsetPassword(String passwd)voidsetReplicatedOnly(boolean replicatedOnly)voidsetSchema(String schema)voidsetSkipReducerOnUpdate(boolean skipReducerOnUpdate)voidsetSocketReceiveBuffer(int size)voidsetSocketSendBuffer(int size)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)voidsetUrl(String url)voidsetURL(String url)Different application servers us different format (URL & url).voidsetUsername(String name)<T> Tunwrap(Class<T> iface)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface javax.sql.CommonDataSourcecreateShardingKeyBuilder
 - 
Methods inherited from interface javax.sql.DataSourcecreateConnectionBuilder
 
- 
 
- 
- 
- 
Method Detail- 
getConnectionpublic Connection getConnection() throws SQLException - Specified by:
- getConnectionin interface- DataSource
- Throws:
- SQLException
 
 - 
getConnectionpublic Connection getConnection(String username, String pwd) throws SQLException - Specified by:
- getConnectionin interface- DataSource
- Throws:
- SQLException
 
 - 
unwrappublic <T> T unwrap(Class<T> iface) throws SQLException - Specified by:
- unwrapin interface- Wrapper
- Throws:
- SQLException
 
 - 
isWrapperForpublic boolean isWrapperFor(Class<?> iface) throws SQLException - Specified by:
- isWrapperForin interface- Wrapper
- Throws:
- SQLException
 
 - 
getLogWriterpublic PrintWriter getLogWriter() throws SQLException - Specified by:
- getLogWriterin interface- CommonDataSource
- Specified by:
- getLogWriterin interface- DataSource
- Throws:
- SQLException
 
 - 
setLogWriterpublic void setLogWriter(PrintWriter out) throws SQLException - Specified by:
- setLogWriterin interface- CommonDataSource
- Specified by:
- setLogWriterin interface- DataSource
- Throws:
- SQLException
 
 - 
setLoginTimeoutpublic void setLoginTimeout(int seconds) throws SQLException- Specified by:
- setLoginTimeoutin interface- CommonDataSource
- Specified by:
- setLoginTimeoutin interface- DataSource
- Throws:
- SQLException
 
 - 
getLoginTimeoutpublic int getLoginTimeout() throws SQLException- Specified by:
- getLoginTimeoutin interface- CommonDataSource
- Specified by:
- getLoginTimeoutin interface- DataSource
- Throws:
- SQLException
 
 - 
getParentLoggerpublic Logger getParentLogger() throws SQLFeatureNotSupportedException - Specified by:
- getParentLoggerin interface- CommonDataSource
- Throws:
- SQLFeatureNotSupportedException
 
 - 
getURLpublic String getURL() Different application servers us different format (URL & url).- Returns:
- Connection URL.
 
 - 
setURLpublic void setURL(String url) throws SQLException Different application servers us different format (URL & url).- Parameters:
- url- Connection URL.
- Throws:
- SQLException- On error whrn URL is invalid.
 
 - 
getAddressespublic String[] getAddresses() - Returns:
- Ignite nodes addresses.
 
 - 
setAddressespublic void setAddresses(String... addrsStr) throws SQLException Sets the addresses of the Ignite nodes to connect; address string format:host[:portRangeFrom[..portRangeTo]]. Examples:- "127.0.0.1"
- "127.0.0.1:10800"
- "127.0.0.1:10800..10810"
- "mynode0.mydomain.org:10800..10810", "mynode1.mydomain.org:10800..10810", "127.0.0.1:10800"
 - Parameters:
- addrsStr- Ignite nodes addresses.
- Throws:
- SQLException- On invalid addresses.
 
 - 
getSchemapublic String getSchema() - Returns:
- Schema name of the connection.
 
 - 
setSchemapublic void setSchema(String schema) - Parameters:
- schema- Schema name of the connection.
 
 - 
getUrlpublic String getUrl() - Returns:
- The URL of the connection.
 
 - 
setUrlpublic void setUrl(String url) throws SQLException - Parameters:
- url- The URL of the connection.
- Throws:
- SQLException- On invalid URL.
 
 - 
isDistributedJoinspublic boolean isDistributedJoins() - Returns:
- Distributed joins flag.
 
 - 
setDistributedJoinspublic void setDistributedJoins(boolean distributedJoins) - Parameters:
- distributedJoins- Distributed joins flag.
 
 - 
isEnforceJoinOrderpublic boolean isEnforceJoinOrder() - Returns:
- Enforce join order flag.
 
 - 
setEnforceJoinOrderpublic void setEnforceJoinOrder(boolean enforceJoinOrder) - Parameters:
- enforceJoinOrder- Enforce join order flag.
 
 - 
isCollocatedpublic boolean isCollocated() - Returns:
- Collocated flag.
 
 - 
setCollocatedpublic void setCollocated(boolean collocated) - Parameters:
- collocated- Collocated flag.
 
 - 
isReplicatedOnlypublic boolean isReplicatedOnly() - Returns:
- Replicated only flag.
 
 - 
setReplicatedOnlypublic void setReplicatedOnly(boolean replicatedOnly) - Parameters:
- replicatedOnly- Replicated only flag.
 
 - 
isAutoCloseServerCursorpublic boolean isAutoCloseServerCursor() - Returns:
- Auto close server cursors flag.
 
 - 
setAutoCloseServerCursorpublic void setAutoCloseServerCursor(boolean autoCloseServerCursor) - Parameters:
- autoCloseServerCursor- Auto close server cursors flag.
 
 - 
getSocketSendBufferpublic int getSocketSendBuffer() - Returns:
- Socket send buffer size.
 
 - 
setSocketSendBufferpublic void setSocketSendBuffer(int size) throws SQLException- Parameters:
- size- Socket send buffer size.
- Throws:
- SQLException- On error.
 
 - 
getSocketReceiveBufferpublic int getSocketReceiveBuffer() - Returns:
- Socket receive buffer size.
 
 - 
setSocketReceiveBufferpublic void setSocketReceiveBuffer(int size) throws SQLException- Parameters:
- size- Socket receive buffer size.
- Throws:
- SQLException- On error.
 
 - 
isTcpNoDelaypublic boolean isTcpNoDelay() - Returns:
- TCP no delay flag.
 
 - 
setTcpNoDelaypublic void setTcpNoDelay(boolean tcpNoDelay) - Parameters:
- tcpNoDelay- TCP no delay flag.
 
 - 
isLazypublic boolean isLazy() - Returns:
- Lazy query execution flag.
 
 - 
setLazypublic void setLazy(boolean lazy) - Parameters:
- lazy- Lazy query execution flag.
 
 - 
isSkipReducerOnUpdatepublic boolean isSkipReducerOnUpdate() - Returns:
- Skip reducer on update flag.
 
 - 
setSkipReducerOnUpdatepublic void setSkipReducerOnUpdate(boolean skipReducerOnUpdate) - Parameters:
- skipReducerOnUpdate- Skip reducer on update flag.
 
 - 
getSslModepublic String getSslMode() Gets SSL connection mode.- Returns:
- Use SSL flag.
 
 - 
setSslModepublic 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.
 
 - 
getSslProtocolpublic String getSslProtocol() Gets protocol for secure transport.- Returns:
- SSL protocol name.
 
 - 
setSslProtocolpublic 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.
 
 - 
getCipherSuitespublic String getCipherSuites() Gets cipher suites.- Returns:
- SSL cipher suites.
 
 - 
setCipherSuitespublic void setCipherSuites(String cipherSuites) Override default cipher suites.See more at JSSE Reference Guide. - Parameters:
- cipherSuites- SSL cipher suites.
 
 - 
getSslKeyAlgorithmpublic String getSslKeyAlgorithm() Gets algorithm that will be used to create a key manager.- Returns:
- Key manager algorithm.
 
 - 
setSslKeyAlgorithmpublic 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.
 
 - 
getSslClientCertificateKeyStoreUrlpublic String getSslClientCertificateKeyStoreUrl() Gets the key store URL.- Returns:
- Client certificate KeyStore URL.
 
 - 
setSslClientCertificateKeyStoreUrlpublic 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.
 
 - 
getSslClientCertificateKeyStorePasswordpublic String getSslClientCertificateKeyStorePassword() Gets key store password.- Returns:
- Client certificate KeyStore password.
 
 - 
setSslClientCertificateKeyStorePasswordpublic 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.
 
 - 
getSslClientCertificateKeyStoreTypepublic String getSslClientCertificateKeyStoreType() Gets key store type used for context creation.- Returns:
- Client certificate KeyStore type.
 
 - 
setSslClientCertificateKeyStoreTypepublic 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.
 
 - 
getSslTrustCertificateKeyStoreUrlpublic String getSslTrustCertificateKeyStoreUrl() Gets the trust store URL.- Returns:
- Trusted certificate KeyStore URL.
 
 - 
setSslTrustCertificateKeyStoreUrlpublic 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.
 
 - 
getSslTrustCertificateKeyStorePasswordpublic String getSslTrustCertificateKeyStorePassword() Gets trust store password.- Returns:
- Trusted certificate KeyStore password.
 
 - 
setSslTrustCertificateKeyStorePasswordpublic 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.
 
 - 
getSslTrustCertificateKeyStoreTypepublic String getSslTrustCertificateKeyStoreType() Gets trust store type.- Returns:
- Trusted certificate KeyStore type.
 
 - 
setSslTrustCertificateKeyStoreTypepublic 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.
 
 - 
isSslTrustAllpublic boolean isSslTrustAll() Gets trust any server certificate flag.- Returns:
- Trust all certificates flag.
 
 - 
setSslTrustAllpublic 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.
 
 - 
getSslFactorypublic String getSslFactory() Gets the class name of the custom implementation of the Factory<SSLSocketFactory>.- Returns:
- Custom class name that implements Factory<SSLSocketFactory>.
 
 - 
setSslFactorypublic 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>.
 
 - 
setUsernamepublic void setUsername(String name) - Parameters:
- name- User name to authentication.
 
 - 
getUsernamepublic String getUsername() - Returns:
- User name to authentication.
 
 - 
setPasswordpublic void setPassword(String passwd) - Parameters:
- passwd- User's password.
 
 - 
getPasswordpublic String getPassword() - Returns:
- User's password.
 
 
- 
 
-