Class SubdomainTenantResolver
java.lang.Object
io.micronaut.multitenancy.tenantresolver.AbstractSubdomainTenantResolver
io.micronaut.multitenancy.tenantresolver.SubdomainTenantResolver
- All Implemented Interfaces:
HttpRequestTenantResolver
,TenantResolver
@Singleton
@Secondary
@Requires(bean=io.micronaut.http.server.util.HttpHostResolver.class) @Requires(property="micronaut.multitenancy.tenantresolver.subdomain.enabled",value="true",defaultValue="false")
public class SubdomainTenantResolver
extends AbstractSubdomainTenantResolver
Tenant resolver that resolves the tenant from the Subdomain. It requires a bean of type
HttpHostResolver
.
It does not support every domain suffix. For example, it does not support second-level domains.- Author:
- Sergio del Amo
- See Also:
-
Field Summary
Fields inherited from class io.micronaut.multitenancy.tenantresolver.AbstractSubdomainTenantResolver
httpHostResolver
Fields inherited from interface io.micronaut.multitenancy.tenantresolver.TenantResolver
ALL, DEFAULT, PREFIX
-
Constructor Summary
ConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.SubdomainTenantResolver
(io.micronaut.http.server.util.HttpHostResolver httpHostResolver) -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull Serializable
resolveSubdomain
(@NonNull String host) Methods inherited from class io.micronaut.multitenancy.tenantresolver.AbstractSubdomainTenantResolver
resolveTenantIdentifier, resolveTenantIdentifier
-
Constructor Details
-
SubdomainTenantResolver
@Inject public SubdomainTenantResolver(io.micronaut.http.server.util.HttpHostResolver httpHostResolver) - Parameters:
httpHostResolver
- HTTP host resolver.- Since:
- 5.0.3
-
SubdomainTenantResolver
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
resolveSubdomain
- Specified by:
resolveSubdomain
in classAbstractSubdomainTenantResolver
- Parameters:
host
- Host- Returns:
- The subdomain.
-
SubdomainTenantResolver(HttpHostResolver)