Package io.micronaut.multitenancy.writer
Class CookieTenantWriterConfigurationProperties
java.lang.Object
io.micronaut.multitenancy.writer.CookieTenantWriterConfigurationProperties
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable,io.micronaut.http.cookie.CookieConfiguration,CookieTenantWriterConfiguration
@ConfigurationProperties("micronaut.multitenancy.tenantwriter.cookie")
public class CookieTenantWriterConfigurationProperties
extends Object
implements CookieTenantWriterConfiguration
ConfigurationProperties implementation of CookieTenantWriterConfiguration.- Since:
- 1.0
- Author:
- Sergio del Amo
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull String@NonNull StringOptional<io.micronaut.http.cookie.SameSite>booleanvoidsetCookieDomain(@Nullable String cookieDomain) Sets the domain name of this Cookie.voidsetCookieHttpOnly(boolean cookieHttpOnly) Whether the Cookie can only be accessed via HTTP.voidsetCookieMaxAge(TemporalAmount cookieMaxAge) Sets the maximum age of the cookie.voidsetCookiename(String cookiename) Cookie Name.voidsetCookiePath(@Nullable String cookiePath) Sets the path of the cookie.voidsetCookieSameSite(io.micronaut.http.cookie.SameSite sameSite) Determines if this thisCookiecan be sent along cross-site requests.voidsetCookieSecure(boolean cookieSecure) Sets whether the cookie is secured.voidsetEnabled(boolean enabled) EnablesCookieTenantWriter.
-
Field Details
-
PREFIX
Configuration Properties Prefix.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_HTTPONLY
public static final boolean DEFAULT_HTTPONLYThe default http only value.- See Also:
-
DEFAULT_COOKIENAME
The default cookie name.- See Also:
-
DEFAULT_COOKIEPATH
Default Cookie Path.- See Also:
-
-
Constructor Details
-
CookieTenantWriterConfigurationProperties
public CookieTenantWriterConfigurationProperties()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) EnablesCookieTenantWriter. Default value (false).- Parameters:
enabled- enabled flag
-
setCookiename
Cookie Name. Default value ("tenantId").- Parameters:
cookiename- Cookie name
-
getCookiename
- Specified by:
getCookienamein interfaceCookieTenantWriterConfiguration- Returns:
- an HTTP Header name. e.g. Authorization
-
getCookieName
- Specified by:
getCookieNamein interfaceio.micronaut.http.cookie.CookieConfiguration
-
getCookieDomain
- Specified by:
getCookieDomainin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- the domain name of this Cookie
-
getCookiePath
- Specified by:
getCookiePathin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- The path of the cookie.
-
isCookieHttpOnly
- Specified by:
isCookieHttpOnlyin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- Whether the Cookie can only be accessed via HTTP.
-
isCookieSecure
- Specified by:
isCookieSecurein interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- True if the cookie is secure
-
getCookieMaxAge
- Specified by:
getCookieMaxAgein interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- The max age to use for the cookie
-
setCookieDomain
Sets the domain name of this Cookie. Default value ("tenantId").- Parameters:
cookieDomain- the domain name of this Cookie
-
setCookiePath
Sets the path of the cookie. Default value ("/".- Parameters:
cookiePath- The path of the cookie.
-
setCookieHttpOnly
public void setCookieHttpOnly(boolean cookieHttpOnly) Whether the Cookie can only be accessed via HTTP. Default value (true.- Parameters:
cookieHttpOnly- Whether the Cookie can only be accessed via HTTP.
-
setCookieSecure
public void setCookieSecure(boolean cookieSecure) Sets whether the cookie is secured. Defaults to the secure status of the request.- Parameters:
cookieSecure- True if the cookie is secure
-
setCookieMaxAge
Sets the maximum age of the cookie.- Parameters:
cookieMaxAge- The maximum age of the cookie
-
getCookieSameSite
- Specified by:
getCookieSameSitein interfaceio.micronaut.http.cookie.CookieConfiguration
-
setCookieSameSite
public void setCookieSameSite(io.micronaut.http.cookie.SameSite sameSite) Determines if this thisCookiecan be sent along cross-site requests. For more information, please look here- Parameters:
sameSite- SameSite value
-