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 java.lang.Object implements TenantResolver
ATenantResolverthat resolves to a fixed static named tenant id.- Since:
- 1.0.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.multitenancy.tenantresolver.TenantResolver
ALL, DEFAULT, PREFIX
-
-
Constructor Summary
Constructors Constructor Description FixedTenantResolver(FixedTenantResolverConfiguration fixedTenantResolverConfiguration)Constructs a fixed tenant resolver.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.SerializableresolveTenantIdentifier()Resolves the current tenant identifier.
-
-
-
Constructor Detail
-
FixedTenantResolver
public FixedTenantResolver(FixedTenantResolverConfiguration fixedTenantResolverConfiguration)
Constructs a fixed tenant resolver.- Parameters:
fixedTenantResolverConfiguration- Fixed tenant resolver configurationFixedTenantResolverConfiguration.
-
-
Method Detail
-
resolveTenantIdentifier
@NonNull public java.io.Serializable resolveTenantIdentifier() throws TenantNotFoundExceptionDescription 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
-
-