@Singleton @Requires(property="micronaut.multitenancy.tenantresolver.principal.enabled", value="true", defaultValue="false") public class PrincipalTenantResolver extends Object implements TenantResolver
ALL, DEFAULT, PREFIX
Constructor and Description |
---|
PrincipalTenantResolver() |
Modifier and Type | Method and Description |
---|---|
Serializable |
resolveTenantIdentifier()
Resolves the current tenant identifier.
|
protected Serializable |
resolveTenantIdentifierAtRequest(HttpRequest<Object> request) |
public Serializable resolveTenantIdentifier()
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
protected Serializable resolveTenantIdentifierAtRequest(HttpRequest<Object> request) throws TenantNotFoundException
request
- The HTTP requestTenantNotFoundException
- if tenant not found