Class RedisHttpSessionConfiguration
- java.lang.Object
-
- io.micronaut.session.SessionConfiguration
-
- io.micronaut.session.http.HttpSessionConfiguration
-
- io.micronaut.configuration.lettuce.session.RedisHttpSessionConfiguration
-
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable,io.micronaut.http.cookie.CookieConfiguration
@ConfigurationProperties("redis") public class RedisHttpSessionConfiguration extends io.micronaut.session.http.HttpSessionConfiguration implements io.micronaut.core.util.ToggleableConfiguration properties for Redis session.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor Description RedisHttpSessionConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetActiveSessionsKey()java.nio.charset.CharsetgetCharset()java.time.DurationgetExpiredSessionCheck()java.lang.StringgetNamespace()java.util.Optional<java.lang.String>getServerName()java.lang.StringgetSessionCreatedTopic()java.util.Optional<java.lang.Class<io.micronaut.core.serialize.ObjectSerializer>>getValueSerializer()io.micronaut.configuration.lettuce.session.RedisHttpSessionConfiguration.WriteModegetWriteMode()booleanisEnableKeyspaceEvents()voidsetActiveSessionsKey(java.lang.String activeSessionsKey)Sets the key to store active sessions in.voidsetCharset(java.nio.charset.Charset charset)Sets the charset to use to serialize values.voidsetEnableKeyspaceEvents(boolean enableKeyspaceEvents)Sets whether keyspace events should be enabled at startup.voidsetExpiredSessionCheck(java.time.Duration expiredSessionCheck)Sets the duration to check for expired sessions.voidsetNamespace(java.lang.String namespace)Sets the namespace to use.voidsetServerName(java.lang.String serverName)Sets the server name.voidsetSessionCreatedTopic(java.lang.String sessionCreatedTopic)Sets the topic to publish session created events to.voidsetValueSerializer(java.lang.Class<io.micronaut.core.serialize.ObjectSerializer> valueSerializer)Sets the default value serializer to use.voidsetWriteMode(io.micronaut.configuration.lettuce.session.RedisHttpSessionConfiguration.WriteMode writeMode)Sets the write mode to use.-
Methods inherited from class io.micronaut.session.http.HttpSessionConfiguration
getCookieDomain, getCookieMaxAge, getCookieName, getCookiePath, getCookieSameSite, getDomainName, getHeaderNames, getPrefix, isBase64Encode, isCookieHttpOnly, isCookieSecure, isRememberMe, setBase64Encode, setCookieDomain, setCookieMaxAge, setCookieName, setCookiePath, setCookieSameSite, setCookieSecure, setDomainName, setHeaderNames, setPrefix, setRememberMe
-
Methods inherited from class io.micronaut.session.SessionConfiguration
getExecutorService, getMaxActiveSessions, getMaxInactiveInterval, isPromptExpiration, setExecutorService, setMaxActiveSessions, setMaxInactiveInterval, setPromptExpiration
-
-
-
-
Method Detail
-
getNamespace
public java.lang.String getNamespace()
- Returns:
- The key prefix to use for reading and writing sessions
-
getServerName
public java.util.Optional<java.lang.String> getServerName()
- Returns:
- The name of the a configured Redis server to use.
-
getSessionCreatedTopic
public java.lang.String getSessionCreatedTopic()
- Returns:
- The topic to use to publish the creation of new sessions.
-
getActiveSessionsKey
public java.lang.String getActiveSessionsKey()
- Returns:
- The key of the sorted set used to maintain a set of active sessions.
-
getValueSerializer
public java.util.Optional<java.lang.Class<io.micronaut.core.serialize.ObjectSerializer>> getValueSerializer()
- Returns:
- The
ObjectSerializertype to use for serializing values. Defaults toJdkSerializer
-
getCharset
public java.nio.charset.Charset getCharset()
- Returns:
- The charset to use when encoding sessions
-
isEnableKeyspaceEvents
public boolean isEnableKeyspaceEvents()
- Returns:
- Whether keyspace events should be enabled programmatically
-
getWriteMode
public io.micronaut.configuration.lettuce.session.RedisHttpSessionConfiguration.WriteMode getWriteMode()
- Returns:
- The
RedisHttpSessionConfiguration.WriteModeto use. Defaults toRedisHttpSessionConfiguration.WriteMode.BATCH
-
getExpiredSessionCheck
public java.time.Duration getExpiredSessionCheck()
- Returns:
- The duration with which to check for expired sessions
-
setNamespace
public void setNamespace(java.lang.String namespace)
Sets the namespace to use.- Parameters:
namespace- The namespace
-
setServerName
public void setServerName(java.lang.String serverName)
Sets the server name.- Parameters:
serverName- The server name
-
setSessionCreatedTopic
public void setSessionCreatedTopic(java.lang.String sessionCreatedTopic)
Sets the topic to publish session created events to.- Parameters:
sessionCreatedTopic- The session created topic
-
setActiveSessionsKey
public void setActiveSessionsKey(java.lang.String activeSessionsKey)
Sets the key to store active sessions in.- Parameters:
activeSessionsKey- The active session key
-
setValueSerializer
public void setValueSerializer(java.lang.Class<io.micronaut.core.serialize.ObjectSerializer> valueSerializer)
Sets the default value serializer to use.- Parameters:
valueSerializer- The value serializer
-
setCharset
public void setCharset(java.nio.charset.Charset charset)
Sets the charset to use to serialize values.- Parameters:
charset- The default charset
-
setEnableKeyspaceEvents
public void setEnableKeyspaceEvents(boolean enableKeyspaceEvents)
Sets whether keyspace events should be enabled at startup.- Parameters:
enableKeyspaceEvents- True if keyspace event should be enabled
-
setWriteMode
public void setWriteMode(io.micronaut.configuration.lettuce.session.RedisHttpSessionConfiguration.WriteMode writeMode)
Sets the write mode to use.- Parameters:
writeMode- The write mode
-
setExpiredSessionCheck
public void setExpiredSessionCheck(java.time.Duration expiredSessionCheck)
Sets the duration to check for expired sessions.- Parameters:
expiredSessionCheck- The expired session check
-
-