Package io.micronaut.multitenancy.writer
Class HttpHeaderTenantWriter
- java.lang.Object
-
- io.micronaut.multitenancy.writer.HttpHeaderTenantWriter
-
- All Implemented Interfaces:
TenantWriter
@Singleton @Requires(property="micronaut.multitenancy.tenantwriter.httpheader.enabled") @Requires(beans=HttpHeaderTenantWriterConfiguration.class) public class HttpHeaderTenantWriter extends java.lang.Object implements TenantWriter
Write the tenant id in an HTTP header.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected HttpHeaderTenantWriterConfigurationhttpHeaderTenantWriterConfigurationTheHttpHeaderTenantWriterconfiguration.-
Fields inherited from interface io.micronaut.multitenancy.writer.TenantWriter
PREFIX
-
-
Constructor Summary
Constructors Constructor Description HttpHeaderTenantWriter(HttpHeaderTenantWriterConfiguration httpHeaderTenantWriterConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringgetHeaderName()voidwriteTenant(io.micronaut.http.MutableHttpRequest<?> request, java.io.Serializable tenant)Writes the token to the request.
-
-
-
Field Detail
-
httpHeaderTenantWriterConfiguration
protected final HttpHeaderTenantWriterConfiguration httpHeaderTenantWriterConfiguration
TheHttpHeaderTenantWriterconfiguration.
-
-
Constructor Detail
-
HttpHeaderTenantWriter
public HttpHeaderTenantWriter(HttpHeaderTenantWriterConfiguration httpHeaderTenantWriterConfiguration)
- Parameters:
httpHeaderTenantWriterConfiguration- TheHttpHeaderTenantWriterconfiguration
-
-
Method Detail
-
getHeaderName
protected java.lang.String getHeaderName()
- Returns:
- the HTTP Header name where the token will be written to
-
writeTenant
public void writeTenant(io.micronaut.http.MutableHttpRequest<?> request, java.io.Serializable tenant)Writes the token to the request.- Specified by:
writeTenantin interfaceTenantWriter- Parameters:
request- TheMutableHttpRequestinstancetenant- Tenant Id
-
-