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