@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 java.lang.Object implements TenantResolver
ALL, DEFAULT, PREFIX
Constructor and Description |
---|
SessionTenantResolver(SessionTenantResolverConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
java.io.Serializable |
resolveTenantIdentifier()
Resolves the current tenant identifier.
|
protected java.io.Serializable |
resolveTenantIdentifierAtRequest(HttpRequest<java.lang.Object> request) |
public SessionTenantResolver(SessionTenantResolverConfiguration configuration)
configuration
- SessionTenantResolverConfiguration
configuration.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 foundprotected java.io.Serializable resolveTenantIdentifierAtRequest(HttpRequest<java.lang.Object> request) throws TenantNotFoundException
request
- The HTTP requestTenantNotFoundException
- if tenant not found