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 Details

  • Constructor Details

    • CookieTenantWriterConfigurationProperties

      public CookieTenantWriterConfigurationProperties()
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Specified by:
      isEnabled in interface io.micronaut.core.util.Toggleable
    • setEnabled

      public void setEnabled(boolean enabled)
      Enables CookieTenantWriter. Default value (false).
      Parameters:
      enabled - enabled flag
    • setCookiename

      public void setCookiename(String cookiename)
      Cookie Name. Default value ("tenantId").
      Parameters:
      cookiename - Cookie name
    • getCookiename

      @NonNull public @NonNull String getCookiename()
      Specified by:
      getCookiename in interface CookieTenantWriterConfiguration
      Returns:
      an HTTP Header name. e.g. Authorization
    • getCookieName

      @NonNull public @NonNull String getCookieName()
      Specified by:
      getCookieName in interface io.micronaut.http.cookie.CookieConfiguration
    • getCookieDomain

      public Optional<String> getCookieDomain()
      Specified by:
      getCookieDomain in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      the domain name of this Cookie
    • getCookiePath

      @Nullable public @Nullable Optional<String> getCookiePath()
      Specified by:
      getCookiePath in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      The path of the cookie.
    • isCookieHttpOnly

      public Optional<Boolean> isCookieHttpOnly()
      Specified by:
      isCookieHttpOnly in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      Whether the Cookie can only be accessed via HTTP.
    • isCookieSecure

      public Optional<Boolean> isCookieSecure()
      Specified by:
      isCookieSecure in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      True if the cookie is secure
    • getCookieMaxAge

      public Optional<TemporalAmount> getCookieMaxAge()
      Specified by:
      getCookieMaxAge in interface io.micronaut.http.cookie.CookieConfiguration
      Returns:
      The max age to use for the cookie
    • setCookieDomain

      public void setCookieDomain(@Nullable @Nullable 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 @Nullable 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(TemporalAmount cookieMaxAge)
      Sets the maximum age of the cookie.
      Parameters:
      cookieMaxAge - The maximum age of the cookie
    • getCookieSameSite

      public Optional<io.micronaut.http.cookie.SameSite> getCookieSameSite()
      Specified by:
      getCookieSameSite in interface io.micronaut.http.cookie.CookieConfiguration
    • setCookieSameSite

      public void setCookieSameSite(io.micronaut.http.cookie.SameSite sameSite)
      Determines if this this Cookie can be sent along cross-site requests. For more information, please look here
      Parameters:
      sameSite - SameSite value