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 Object
implements TenantWriter
Write the tenant id in an HTTP header.
- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
Modifier and TypeFieldDescriptionprotected final HttpHeaderTenantWriterConfiguration
TheHttpHeaderTenantWriter
configuration.Fields inherited from interface io.micronaut.multitenancy.writer.TenantWriter
PREFIX
-
Constructor Summary
ConstructorDescriptionHttpHeaderTenantWriter
(HttpHeaderTenantWriterConfiguration httpHeaderTenantWriterConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
void
writeTenant
(io.micronaut.http.MutableHttpRequest<?> request, Serializable tenant) Writes the token to the request.
-
Field Details
-
httpHeaderTenantWriterConfiguration
TheHttpHeaderTenantWriter
configuration.
-
-
Constructor Details
-
HttpHeaderTenantWriter
public HttpHeaderTenantWriter(HttpHeaderTenantWriterConfiguration httpHeaderTenantWriterConfiguration) - Parameters:
httpHeaderTenantWriterConfiguration
- TheHttpHeaderTenantWriter
configuration
-
-
Method Details
-
getHeaderName
- Returns:
- the HTTP Header name where the token will be written to
-
writeTenant
Writes the token to the request.- Specified by:
writeTenant
in interfaceTenantWriter
- Parameters:
request
- TheMutableHttpRequest
instancetenant
- Tenant Id
-