public class DataSourceProviderImpl extends Object implements DataSourceProvider
TenantAwareDataSourceProvider
with the current tenant.
Will throw IllegalStateException if invoked when there is no tenant present.| Constructor and Description |
|---|
DataSourceProviderImpl(TenantAwareDataSourceProvider tenantAwareDataSourceProvider,
com.atlassian.tenancy.api.TenantContext tenantContext) |
| Modifier and Type | Method and Description |
|---|---|
DatabaseType |
getDatabaseType()
Returns the database type.
|
DataSource |
getDataSource()
Returns the host application's SQL data source.
|
String |
getSchema()
Returns the name of the schema used with this database.
|
public DataSourceProviderImpl(TenantAwareDataSourceProvider tenantAwareDataSourceProvider, com.atlassian.tenancy.api.TenantContext tenantContext)
public DataSource getDataSource()
DataSourceProvidergetDataSource in interface DataSourceProviderpublic DatabaseType getDatabaseType()
DataSourceProviderReturns the database type.
Note: if DatabaseType.UNKNOWN is returned, it is up to the
calling code to 'guess' the type of the database. It is strongly advised to implement this method so
that it never returns DatabaseType.UNKNOWN.
getDatabaseType in interface DataSourceProviderpublic String getSchema()
DataSourceProviderReturns the name of the schema used with this database.
This is especially important for SQL Server, Postgres, and HSQLDB.
getSchema in interface DataSourceProvidernull if no schema is required.Copyright © 2018 Atlassian. All rights reserved.