public abstract static class SnowflakeIO.DataSourceConfiguration
extends java.lang.Object
implements java.io.Serializable
DataSource
, providing all properties allowing to create a DataSource
.Constructor and Description |
---|
DataSourceConfiguration() |
Modifier and Type | Method and Description |
---|---|
javax.sql.DataSource |
buildDatasource()
Builds
SnowflakeBasicDataSource based on the current configuration. |
static SnowflakeIO.DataSourceConfiguration |
create() |
static SnowflakeIO.DataSourceConfiguration |
create(javax.sql.DataSource dataSource)
Creates
SnowflakeIO.DataSourceConfiguration from existing instance of DataSource . |
abstract java.lang.String |
getAuthenticator() |
abstract ValueProvider<java.lang.String> |
getDatabase() |
abstract javax.sql.DataSource |
getDataSource() |
abstract java.lang.Integer |
getLoginTimeout() |
abstract ValueProvider<java.lang.String> |
getOauthToken() |
abstract ValueProvider<java.lang.String> |
getPassword() |
abstract java.lang.Integer |
getPortNumber() |
abstract java.security.PrivateKey |
getPrivateKey() |
abstract ValueProvider<java.lang.String> |
getPrivateKeyPassphrase() |
abstract java.lang.String |
getPrivateKeyPath() |
abstract ValueProvider<java.lang.String> |
getRawPrivateKey() |
abstract ValueProvider<java.lang.String> |
getRole() |
abstract ValueProvider<java.lang.String> |
getSchema() |
abstract ValueProvider<java.lang.String> |
getServerName() |
abstract java.lang.Boolean |
getSsl() |
abstract java.lang.String |
getUrl() |
abstract ValueProvider<java.lang.String> |
getUsername() |
abstract ValueProvider<java.lang.String> |
getWarehouse() |
SnowflakeIO.DataSourceConfiguration |
withAuthenticator(java.lang.String authenticator)
Sets authenticator for Snowflake.
|
SnowflakeIO.DataSourceConfiguration |
withDatabase(java.lang.String database)
Sets database to use.
|
SnowflakeIO.DataSourceConfiguration |
withDatabase(ValueProvider<java.lang.String> database) |
SnowflakeIO.DataSourceConfiguration |
withKeyPairAuth(java.lang.String username,
java.security.PrivateKey privateKey)
Sets key pair authentication.
|
SnowflakeIO.DataSourceConfiguration |
withKeyPairPathAuth(java.lang.String username,
java.lang.String privateKeyPath,
java.lang.String privateKeyPassphrase)
Sets key pair authentication.
|
SnowflakeIO.DataSourceConfiguration |
withKeyPairPathAuth(ValueProvider<java.lang.String> username,
java.lang.String privateKeyPath,
ValueProvider<java.lang.String> privateKeyPassphrase)
Sets key pair authentication.
|
SnowflakeIO.DataSourceConfiguration |
withKeyPairRawAuth(java.lang.String username,
java.lang.String rawPrivateKey,
java.lang.String privateKeyPassphrase)
Sets key pair authentication.
|
SnowflakeIO.DataSourceConfiguration |
withKeyPairRawAuth(ValueProvider<java.lang.String> username,
ValueProvider<java.lang.String> rawPrivateKey,
ValueProvider<java.lang.String> privateKeyPassphrase)
Sets key pair authentication.
|
SnowflakeIO.DataSourceConfiguration |
withLoginTimeout(java.lang.Integer loginTimeout)
Sets loginTimeout that will be used in
SnowflakeBasicDataSource.setLoginTimeout(int) . |
SnowflakeIO.DataSourceConfiguration |
withOAuth(java.lang.String token)
Sets OAuth authentication.
|
SnowflakeIO.DataSourceConfiguration |
withOAuth(ValueProvider<java.lang.String> token)
Sets OAuth authentication.
|
SnowflakeIO.DataSourceConfiguration |
withPortNumber(java.lang.Integer portNumber)
Sets port number to use to connect to Snowflake.
|
SnowflakeIO.DataSourceConfiguration |
withRole(java.lang.String role)
Sets user's role to be used when running queries on Snowflake.
|
SnowflakeIO.DataSourceConfiguration |
withRole(ValueProvider<java.lang.String> role)
Sets user's role to be used when running queries on Snowflake.
|
SnowflakeIO.DataSourceConfiguration |
withSchema(java.lang.String schema)
Sets schema to use when connecting to Snowflake.
|
SnowflakeIO.DataSourceConfiguration |
withSchema(ValueProvider<java.lang.String> schema) |
SnowflakeIO.DataSourceConfiguration |
withServerName(java.lang.String serverName)
Sets the name of the Snowflake server.
|
SnowflakeIO.DataSourceConfiguration |
withServerName(ValueProvider<java.lang.String> serverName) |
SnowflakeIO.DataSourceConfiguration |
withUrl(java.lang.String url)
Sets URL of Snowflake server in following format:
jdbc:snowflake://
|
SnowflakeIO.DataSourceConfiguration |
withUsernamePasswordAuth(java.lang.String username,
java.lang.String password)
Sets username/password authentication.
|
SnowflakeIO.DataSourceConfiguration |
withUsernamePasswordAuth(ValueProvider<java.lang.String> username,
ValueProvider<java.lang.String> password)
Sets username/password authentication.
|
SnowflakeIO.DataSourceConfiguration |
withWarehouse(java.lang.String warehouse)
Sets Snowflake Warehouse to use.
|
SnowflakeIO.DataSourceConfiguration |
withWarehouse(ValueProvider<java.lang.String> warehouse)
Sets Snowflake Warehouse to use.
|
@Nullable public abstract java.lang.String getUrl()
@Nullable public abstract ValueProvider<java.lang.String> getUsername()
@Nullable public abstract ValueProvider<java.lang.String> getPassword()
@Nullable public abstract java.security.PrivateKey getPrivateKey()
@Nullable public abstract java.lang.String getPrivateKeyPath()
@Nullable public abstract ValueProvider<java.lang.String> getRawPrivateKey()
@Nullable public abstract ValueProvider<java.lang.String> getPrivateKeyPassphrase()
@Nullable public abstract ValueProvider<java.lang.String> getOauthToken()
@Nullable public abstract ValueProvider<java.lang.String> getDatabase()
@Nullable public abstract ValueProvider<java.lang.String> getWarehouse()
@Nullable public abstract ValueProvider<java.lang.String> getSchema()
@Nullable public abstract ValueProvider<java.lang.String> getServerName()
@Nullable public abstract java.lang.Integer getPortNumber()
@Nullable public abstract ValueProvider<java.lang.String> getRole()
@Nullable public abstract java.lang.String getAuthenticator()
@Nullable public abstract java.lang.Integer getLoginTimeout()
@Nullable public abstract java.lang.Boolean getSsl()
@Nullable public abstract javax.sql.DataSource getDataSource()
public static SnowflakeIO.DataSourceConfiguration create()
public static SnowflakeIO.DataSourceConfiguration create(javax.sql.DataSource dataSource)
SnowflakeIO.DataSourceConfiguration
from existing instance of DataSource
.dataSource
- - an instance of DataSource
.public SnowflakeIO.DataSourceConfiguration withUsernamePasswordAuth(java.lang.String username, java.lang.String password)
username
- - Snowflake username.password
- - Password for provided Snowflake username.public SnowflakeIO.DataSourceConfiguration withUsernamePasswordAuth(ValueProvider<java.lang.String> username, ValueProvider<java.lang.String> password)
username
- - Snowflake username.password
- - Password for provided Snowflake username.public SnowflakeIO.DataSourceConfiguration withOAuth(java.lang.String token)
token
- - OAuth token.public SnowflakeIO.DataSourceConfiguration withOAuth(ValueProvider<java.lang.String> token)
token
- - OAuth token.public SnowflakeIO.DataSourceConfiguration withKeyPairAuth(java.lang.String username, java.security.PrivateKey privateKey)
username
- - Snowflake username.privateKey
- - Private key.public SnowflakeIO.DataSourceConfiguration withKeyPairPathAuth(ValueProvider<java.lang.String> username, java.lang.String privateKeyPath, ValueProvider<java.lang.String> privateKeyPassphrase)
username
- - Snowflake username.privateKeyPath
- - Private key path.privateKeyPassphrase
- - Passphrase for provided private key.public SnowflakeIO.DataSourceConfiguration withKeyPairPathAuth(java.lang.String username, java.lang.String privateKeyPath, java.lang.String privateKeyPassphrase)
username
- - Snowflake username.privateKeyPath
- - Private key path.privateKeyPassphrase
- - Passphrase for provided private key.public SnowflakeIO.DataSourceConfiguration withKeyPairRawAuth(ValueProvider<java.lang.String> username, ValueProvider<java.lang.String> rawPrivateKey, ValueProvider<java.lang.String> privateKeyPassphrase)
username
- - Snowflake username.rawPrivateKey
- - Raw private key.privateKeyPassphrase
- - Passphrase for provided private key.public SnowflakeIO.DataSourceConfiguration withKeyPairRawAuth(java.lang.String username, java.lang.String rawPrivateKey, java.lang.String privateKeyPassphrase)
username
- - Snowflake username.rawPrivateKey
- - Raw private key.privateKeyPassphrase
- - Passphrase for provided private key.public SnowflakeIO.DataSourceConfiguration withUrl(java.lang.String url)
Either withUrl or withServerName is required.
url
- String with URL of the Snowflake server.public SnowflakeIO.DataSourceConfiguration withDatabase(java.lang.String database)
database
- String with database name.public SnowflakeIO.DataSourceConfiguration withDatabase(ValueProvider<java.lang.String> database)
public SnowflakeIO.DataSourceConfiguration withWarehouse(ValueProvider<java.lang.String> warehouse)
warehouse
- ValueProvider with warehouse name.public SnowflakeIO.DataSourceConfiguration withWarehouse(java.lang.String warehouse)
warehouse
- String with warehouse name.public SnowflakeIO.DataSourceConfiguration withSchema(java.lang.String schema)
schema
- String with schema name.public SnowflakeIO.DataSourceConfiguration withSchema(ValueProvider<java.lang.String> schema)
public SnowflakeIO.DataSourceConfiguration withServerName(java.lang.String serverName)
Either withServerName or withUrl is required.
serverName
- String with server name.public SnowflakeIO.DataSourceConfiguration withServerName(ValueProvider<java.lang.String> serverName)
public SnowflakeIO.DataSourceConfiguration withPortNumber(java.lang.Integer portNumber)
portNumber
- Integer with port number.public SnowflakeIO.DataSourceConfiguration withRole(ValueProvider<java.lang.String> role)
role
- ValueProvider with role name.public SnowflakeIO.DataSourceConfiguration withRole(java.lang.String role)
role
- String with role name.public SnowflakeIO.DataSourceConfiguration withAuthenticator(java.lang.String authenticator)
authenticator
- String with authenticator name.public SnowflakeIO.DataSourceConfiguration withLoginTimeout(java.lang.Integer loginTimeout)
SnowflakeBasicDataSource.setLoginTimeout(int)
.loginTimeout
- Integer with timeout value.public javax.sql.DataSource buildDatasource()
SnowflakeBasicDataSource
based on the current configuration.