public interface MultiTenantDataSource extends DataSource, Closeable
DataSource
with multi-tenancy support.
This datasource act as a wrapper for standard DataSource
interface and provides a specific DataSource
implementation for the current tenant when a Connection
is requested.
Standard implementation relies on two strategy interfaces for internal operations:
TenantResolver
to obtain the current tenant idTenantDataSourceProvider
to obtain the concrete DataSource
associated with a tenant idModifier and Type | Interface and Description |
---|---|
static interface |
MultiTenantDataSource.Builder |
Modifier and Type | Method and Description |
---|---|
static MultiTenantDataSource.Builder |
builder()
Builder to create a MultiTenantDataSource
|
void |
reset()
Reset tenant
DataSource s internal cache. |
void |
reset(String tenantId)
Reset internal cached
DataSource for given tenantId , if present. |
getConnection, getConnection
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
isWrapperFor, unwrap
void reset()
DataSource
s internal cache.void reset(String tenantId)
DataSource
for given tenantId
, if present.tenantId
- Tenant id to resetstatic MultiTenantDataSource.Builder builder()
Copyright © 2018 The Holon Platform. All rights reserved.