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 java.lang.Object implements CookieTenantWriterConfigurationConfigurationPropertiesimplementation ofCookieTenantWriterConfiguration.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_COOKIENAMEThe default cookie name.static java.lang.StringDEFAULT_COOKIEPATHDefault Cookie Path.static booleanDEFAULT_ENABLEDThe default enable value.static booleanDEFAULT_HTTPONLYThe default http only value.static java.lang.StringPREFIXConfiguration Properties Prefix.
-
Constructor Summary
Constructors Constructor Description CookieTenantWriterConfigurationProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>getCookieDomain()java.util.Optional<java.time.temporal.TemporalAmount>getCookieMaxAge()java.lang.StringgetCookiename()java.lang.StringgetCookieName()java.util.Optional<java.lang.String>getCookiePath()java.util.Optional<io.micronaut.http.cookie.SameSite>getCookieSameSite()java.util.Optional<java.lang.Boolean>isCookieHttpOnly()java.util.Optional<java.lang.Boolean>isCookieSecure()booleanisEnabled()voidsetCookieDomain(java.lang.String cookieDomain)Sets the domain name of this Cookie.voidsetCookieHttpOnly(boolean cookieHttpOnly)Whether the Cookie can only be accessed via HTTP.voidsetCookieMaxAge(java.time.temporal.TemporalAmount cookieMaxAge)Sets the maximum age of the cookie.voidsetCookiename(java.lang.String cookiename)Cookie Name.voidsetCookiePath(java.lang.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 Detail
-
PREFIX
public static final java.lang.String PREFIX
Configuration Properties Prefix.- See Also:
- Constant Field Values
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
The default enable value.- See Also:
- Constant Field Values
-
DEFAULT_HTTPONLY
public static final boolean DEFAULT_HTTPONLY
The default http only value.- See Also:
- Constant Field Values
-
DEFAULT_COOKIENAME
public static final java.lang.String DEFAULT_COOKIENAME
The default cookie name.- See Also:
- Constant Field Values
-
DEFAULT_COOKIEPATH
public static final java.lang.String DEFAULT_COOKIEPATH
Default Cookie Path.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
public void setCookiename(java.lang.String cookiename)
Cookie Name. Default value ("tenantId").- Parameters:
cookiename- Cookie name
-
getCookiename
@NonNull public java.lang.String getCookiename()
- Specified by:
getCookienamein interfaceCookieTenantWriterConfiguration- Returns:
- an HTTP Header name. e.g. Authorization
-
getCookieName
@NonNull public java.lang.String getCookieName()
- Specified by:
getCookieNamein interfaceio.micronaut.http.cookie.CookieConfiguration
-
getCookieDomain
public java.util.Optional<java.lang.String> getCookieDomain()
- Specified by:
getCookieDomainin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- the domain name of this Cookie
-
getCookiePath
@Nullable public java.util.Optional<java.lang.String> getCookiePath()
- Specified by:
getCookiePathin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- The path of the cookie.
-
isCookieHttpOnly
public java.util.Optional<java.lang.Boolean> isCookieHttpOnly()
- Specified by:
isCookieHttpOnlyin interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- Whether the Cookie can only be accessed via HTTP.
-
isCookieSecure
public java.util.Optional<java.lang.Boolean> isCookieSecure()
- Specified by:
isCookieSecurein interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- True if the cookie is secure
-
getCookieMaxAge
public java.util.Optional<java.time.temporal.TemporalAmount> getCookieMaxAge()
- Specified by:
getCookieMaxAgein interfaceio.micronaut.http.cookie.CookieConfiguration- Returns:
- The max age to use for the cookie
-
setCookieDomain
public void setCookieDomain(@Nullable java.lang.String cookieDomain)Sets the domain name of this Cookie. Default value ("tenantId").- Parameters:
cookieDomain- the domain name of this Cookie
-
setCookiePath
public void setCookiePath(@Nullable java.lang.String cookiePath)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
public void setCookieMaxAge(java.time.temporal.TemporalAmount cookieMaxAge)
Sets the maximum age of the cookie.- Parameters:
cookieMaxAge- The maximum age of the cookie
-
getCookieSameSite
public java.util.Optional<io.micronaut.http.cookie.SameSite> 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
-
-