Class SystemPropertyTenantResolver
java.lang.Object
io.micronaut.multitenancy.tenantresolver.SystemPropertyTenantResolver
- All Implemented Interfaces:
 TenantResolver
@Singleton
@Requires(beans=SystemPropertyTenantResolverConfiguration.class) @Requires(property="micronaut.multitenancy.tenantresolver.systemproperty.enabled",value="true",defaultValue="false")
public class SystemPropertyTenantResolver
extends Object
implements TenantResolver
A 
TenantResolver that resolves from a System property called "tenantId". Useful for testing.- Since:
 - 1.0
 - Author:
 - Sergio del Amo
 
- 
Field Summary
Fields inherited from interface io.micronaut.multitenancy.tenantresolver.TenantResolver
ALL, DEFAULT, PREFIX - 
Constructor Summary
ConstructorsConstructorDescriptionSystemPropertyTenantResolver(SystemPropertyTenantResolverConfiguration systemPropertyTenantResolverConfiguration) Constructs a system property tenant resolver. - 
Method Summary
 
- 
Constructor Details
- 
SystemPropertyTenantResolver
public SystemPropertyTenantResolver(SystemPropertyTenantResolverConfiguration systemPropertyTenantResolverConfiguration) Constructs a system property tenant resolver.- Parameters:
 systemPropertyTenantResolverConfiguration-SystemPropertyTenantResolverConfigurationConfiguration for system property tenant resolver.
 
 - 
 - 
Method Details
- 
resolveTenantIdentifier
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:
 resolveTenantIdentifierin interfaceTenantResolver- Returns:
 - the tenant ID if resolved.
 - Throws:
 TenantNotFoundException- if tenant not found.
 
 -