@Singleton @Requires(beans=SystemPropertyTenantResolverConfiguration.class) @Requires(property="micronaut.multitenancy.tenantresolver.systemproperty.enabled",value="true",defaultValue="false") public class SystemPropertyTenantResolver extends java.lang.Object implements TenantResolver
TenantResolver
that resolves from a System property called . Useful for testing.ALL, DEFAULT, PREFIX
Constructor and Description |
---|
SystemPropertyTenantResolver(SystemPropertyTenantResolverConfiguration systemPropertyTenantResolverConfiguration)
Constructs a system property tenant resolver.
|
Modifier and Type | Method and Description |
---|---|
java.io.Serializable |
resolveTenantIdentifier()
Resolves the current tenant identifier.
|
public SystemPropertyTenantResolver(SystemPropertyTenantResolverConfiguration systemPropertyTenantResolverConfiguration)
systemPropertyTenantResolverConfiguration
- SystemPropertyTenantResolverConfiguration
Configuration for system property tenant resolver.public java.io.Serializable resolveTenantIdentifier() throws TenantNotFoundException
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.
resolveTenantIdentifier
in interface TenantResolver
TenantNotFoundException
- if tenant not found.