001package io.ebean.config;
002
003import javax.sql.DataSource;
004
005/**
006 * For multi-tenancy via DB supply the DataSource given the tenantId.
007 */
008@FunctionalInterface
009public interface TenantDataSourceProvider {
010
011  /**
012   * Return the DataSource to use for the given current tenant.
013   */
014  DataSource dataSource(Object tenantId);
015
016  /**
017   * Shutdown all the DataSources.
018   */
019  default void shutdown(boolean deregisterDriver) {}
020}