com.holonplatform.jdbc.internal

## Class DefaultMultiTenantDataSource.DefaultBuilder

- java.lang.Object
- - com.holonplatform.jdbc.internal.DefaultMultiTenantDataSource.DefaultBuilder

- All Implemented Interfaces:
    MultiTenantDataSource.Builder
  Enclosing class:
    DefaultMultiTenantDataSource

      public static class DefaultMultiTenantDataSource.DefaultBuilder
      extends Object
      implements MultiTenantDataSource.Builder

  Default `MultiTenantDataSource` builder.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `MultiTenantDataSource` | `build()` Build `MultiTenantDataSource`
    `MultiTenantDataSource.Builder` | `provider(TenantDataSourceProvider provider)` Set the `TenantDataSourceProvider` to use to obtain configured DataSource instances according to current tenant id.
    `MultiTenantDataSource.Builder` | `resolver(com.holonplatform.core.tenancy.TenantResolver resolver)` Set the `TenantResolver` to use to obtain the current tenant id.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultBuilder

          public DefaultBuilder()

  - ### Method Detail

    - #### resolver

          public MultiTenantDataSource.Builder resolver(com.holonplatform.core.tenancy.TenantResolver resolver)

      Description copied from interface: `MultiTenantDataSource.Builder`
      Set the `TenantResolver` to use to obtain the current tenant id.

      If not setted, the default context resource `TenantResolver.getCurrent()` is used if available.

      Specified by:
        `resolver` in interface `MultiTenantDataSource.Builder`
      Parameters:
        `resolver` - the TenantResolver to set
      Returns:
        this

    - #### provider

          public MultiTenantDataSource.Builder provider(TenantDataSourceProvider provider)

      Description copied from interface: `MultiTenantDataSource.Builder`
      Set the `TenantDataSourceProvider` to use to obtain configured DataSource instances according to current tenant id.

      If not setted, the default context resource `TenantDataSourceProvider.getCurrent()` is used if available.

      Specified by:
        `provider` in interface `MultiTenantDataSource.Builder`
      Parameters:
        `provider` - the TenantDataSourceProvider to set
      Returns:
        this

    - #### build

          public MultiTenantDataSource build()

      Description copied from interface: `MultiTenantDataSource.Builder`
      Build `MultiTenantDataSource`
      Specified by:
        `build` in interface `MultiTenantDataSource.Builder`
      Returns:
        MultiTenantDataSource

Copyright © 2019 The Holon Platform. All rights reserved.