Class FixedTenantResolver
java.lang.Object
io.micronaut.multitenancy.tenantresolver.FixedTenantResolver
- All Implemented Interfaces:
TenantResolver
@Requires(beans=FixedTenantResolverConfiguration.class) @Requires(property="micronaut.multitenancy.tenantresolver.fixed.enabled",value="true",defaultValue="false")
@Singleton
public class FixedTenantResolver
extends Object
implements TenantResolver
A
TenantResolver
that resolves to a fixed static named tenant id.- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.multitenancy.tenantresolver.TenantResolver
ALL, DEFAULT, PREFIX
-
Constructor Summary
ConstructorDescriptionFixedTenantResolver
(FixedTenantResolverConfiguration fixedTenantResolverConfiguration) Constructs a fixed tenant resolver. -
Method Summary
-
Constructor Details
-
FixedTenantResolver
Constructs a fixed tenant resolver.- Parameters:
fixedTenantResolverConfiguration
- Fixed tenant resolver configurationFixedTenantResolverConfiguration
.
-
-
Method Details
-
resolveTenantIdentifier
Description copied from interface:TenantResolver
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.
- Specified by:
resolveTenantIdentifier
in interfaceTenantResolver
- Returns:
- the tenant ID if resolved.
- Throws:
TenantNotFoundException
- if tenant not found
-