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(javax.sql.DataSource dataSource)
Creates
SnowflakeIO.DataSourceConfiguration from existing instance of DataSource . |
static SnowflakeIO.DataSourceConfiguration |
create(SnowflakeCredentials credentials)
Creates
SnowflakeIO.DataSourceConfiguration from instance of SnowflakeCredentials . |
abstract java.lang.String |
getDatabase() |
abstract javax.sql.DataSource |
getDataSource() |
abstract java.lang.Integer |
getLoginTimeout() |
abstract java.lang.String |
getOauthToken() |
abstract java.lang.String |
getPassword() |
abstract java.lang.Integer |
getPortNumber() |
abstract java.security.PrivateKey |
getPrivateKey() |
abstract java.lang.String |
getRole() |
abstract java.lang.String |
getSchema() |
abstract java.lang.String |
getServerName() |
abstract java.lang.Boolean |
getSsl() |
abstract java.lang.String |
getUrl() |
abstract java.lang.String |
getUsername() |
abstract java.lang.Boolean |
getValidate() |
abstract java.lang.String |
getWarehouse() |
SnowflakeIO.DataSourceConfiguration |
withDatabase(java.lang.String database)
Sets database to use.
|
SnowflakeIO.DataSourceConfiguration |
withLoginTimeout(java.lang.Integer loginTimeout)
Sets loginTimeout that will be used in
SnowflakeBasicDataSource:setLoginTimeout . |
SnowflakeIO.DataSourceConfiguration |
withoutValidation()
Disables validation of connection parameters prior to pipeline submission.
|
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 |
withSchema(java.lang.String schema)
Sets schema to use when connecting to Snowflake.
|
SnowflakeIO.DataSourceConfiguration |
withServerName(java.lang.String serverName)
Sets the name of the Snowflake server.
|
SnowflakeIO.DataSourceConfiguration |
withUrl(java.lang.String url)
Sets URL of Snowflake server in following format:
jdbc:snowflake://
|
SnowflakeIO.DataSourceConfiguration |
withWarehouse(java.lang.String warehouse)
Sets Snowflake Warehouse to use.
|
@Nullable public abstract java.lang.String getUrl()
@Nullable public abstract java.lang.String getUsername()
@Nullable public abstract java.lang.String getPassword()
@Nullable public abstract java.security.PrivateKey getPrivateKey()
@Nullable public abstract java.lang.String getOauthToken()
@Nullable public abstract java.lang.String getDatabase()
@Nullable public abstract java.lang.String getWarehouse()
@Nullable public abstract java.lang.String getSchema()
@Nullable public abstract java.lang.String getServerName()
@Nullable public abstract java.lang.Integer getPortNumber()
@Nullable public abstract java.lang.String getRole()
@Nullable public abstract java.lang.Integer getLoginTimeout()
@Nullable public abstract java.lang.Boolean getSsl()
@Nullable public abstract java.lang.Boolean getValidate()
@Nullable public abstract javax.sql.DataSource getDataSource()
public static SnowflakeIO.DataSourceConfiguration create(javax.sql.DataSource dataSource)
SnowflakeIO.DataSourceConfiguration
from existing instance of DataSource
.dataSource
- - an instance of DataSource
.public static SnowflakeIO.DataSourceConfiguration create(SnowflakeCredentials credentials)
SnowflakeIO.DataSourceConfiguration
from instance of SnowflakeCredentials
.credentials
- - an instance of SnowflakeCredentials
.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 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 withServerName(java.lang.String serverName)
Either withServerName or withUrl is required.
serverName
- - String with server name.public SnowflakeIO.DataSourceConfiguration withPortNumber(java.lang.Integer portNumber)
portNumber
- - Integer with port number.public SnowflakeIO.DataSourceConfiguration withRole(java.lang.String role)
role
- - String with role name.public SnowflakeIO.DataSourceConfiguration withLoginTimeout(java.lang.Integer loginTimeout)
SnowflakeBasicDataSource:setLoginTimeout
.loginTimeout
- - Integer with timeout value.public SnowflakeIO.DataSourceConfiguration withoutValidation()
public javax.sql.DataSource buildDatasource()
SnowflakeBasicDataSource
based on the current configuration.