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
ConstructorsConstructorDescriptionFixedTenantResolver(FixedTenantResolverConfiguration fixedTenantResolverConfiguration) Constructs a fixed tenant resolver. -
Method Summary
Modifier and TypeMethodDescription@NonNull StringResolves the current tenant identifier.@NonNull SerializableDeprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
FixedTenantResolver
Constructs a fixed tenant resolver.- Parameters:
fixedTenantResolverConfiguration- Fixed tenant resolver configurationFixedTenantResolverConfiguration.
-
-
Method Details
-
resolveTenantIdentifier
@Deprecated(forRemoval=true, since="5.5.0") @NonNull public @NonNull Serializable resolveTenantIdentifier() throws TenantNotFoundExceptionDeprecated, for removal: This API element is subject to removal in a future version.UseresolveTenantId()insteadDescription copied from interface:TenantResolverResolves 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:
resolveTenantIdentifierin interfaceTenantResolver- Returns:
- the tenant ID if resolved.
- Throws:
TenantNotFoundException- if tenant not found
-
resolveTenantId
Description copied from interface:TenantResolverResolves 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:
resolveTenantIdin interfaceTenantResolver- Returns:
- the tenant ID if resolved.
- Throws:
TenantNotFoundException- if tenant not found
-
resolveTenantId()instead