Interface TenantResolver

All Known Implementing Classes:
AbstractSubdomainTenantResolver, CookieTenantResolver, FixedTenantResolver, HttpHeaderTenantResolver, InternetDomainNameSubdomainTenantResolver, PrincipalTenantResolver, PublicSuffixListSubdomainTenantResolver, SessionTenantResolver, SubdomainTenantResolver, SystemPropertyTenantResolver
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface TenantResolver
An interface for applications that implement Multi Tenancy to implement in order to resolve the current identifier.
Since:
1.0
Author:
Sergio del Amo
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant for a mapping to all tenants.
    static final String
    The name of the default tenant.
    static final String
    Tenant Resolver Configuration Prefix.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NonNull Serializable
    Resolves the current tenant identifier.
  • Field Details

  • Method Details

    • resolveTenantIdentifier

      @NonNull @NonNull Serializable resolveTenantIdentifier() throws TenantNotFoundException

      Resolves the current tenant identifier.

      In a Multi Tenant setup where a single database is being used amongst multiple tenants this would be the object that is used as the tenantId property for each domain class.

      Returns:
      The tenant identifier
      Throws:
      TenantNotFoundException - if tenant not found