Class AbstractRedisCacheConfiguration
java.lang.Object
io.micronaut.configuration.lettuce.cache.AbstractRedisCacheConfiguration
- Direct Known Subclasses:
DefaultRedisCacheConfiguration
,RedisCacheConfiguration
Allows configuration of caches stored in Redis.
- Since:
- 1.3
- Author:
- Graeme Rocher, Alex Katlein
-
Field Summary
-
Constructor Summary
ConstructorDescriptionAbstractRedisCacheConfiguration
(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionSpecifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last read.Returns the count used for the scan command inRedisCache.invalidateAll()
.TheObjectSerializer
to use for serializing keys.void
setCharset
(Charset charset) void
setExpirationAfterWritePolicy
(String expirationAfterWritePolicy) void
setExpireAfterAccess
(Duration expireAfterAccess) void
setExpireAfterWrite
(Duration expireAfterWrite) void
setInvalidateScanCount
(@NonNull Long invalidateScanCount) Sets the count used for the scan command inRedisCache.invalidateAll()
.
-
Field Details
-
server
-
keySerializer
-
valueSerializer
-
charset
-
expireAfterWrite
-
expireAfterAccess
-
expirationAfterWritePolicy
-
invalidateScanCount
-
-
Constructor Details
-
AbstractRedisCacheConfiguration
public AbstractRedisCacheConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) Constructor.- Parameters:
applicationConfiguration
- applicationConfiguration
-
-
Method Details
-
getServer
- Returns:
- The name of the server to use.
- See Also:
-
getValueSerializer
- Returns:
- The
ObjectSerializer
type to use for serializing values.
-
getKeySerializer
TheObjectSerializer
to use for serializing keys. Defaults toDefaultStringKeySerializer
.- Returns:
- The optional
ObjectSerializer
class
-
getExpireAfterWrite
- Returns:
- The expiry to use after the value is written
-
getExpireAfterAccess
Specifies that each entry should be automatically removed from the cache once a fixed duration has elapsed after the entry's creation, the most recent replacement of its value, or its last read.- Returns:
- The
Duration
-
getExpirationAfterWritePolicy
- Returns:
- The class path for an implementation of ExpirationAfterWritePolicy
-
getCharset
- Returns:
- The charset used to serialize and deserialize values
-
setExpireAfterWrite
- Parameters:
expireAfterWrite
- The cache expiration duration after writing into it.
-
setExpireAfterAccess
- Parameters:
expireAfterAccess
- The cache expiration duration after accessing it
-
setCharset
- Parameters:
charset
- The charset used to serialize and deserialize values
-
setExpirationAfterWritePolicy
- Parameters:
expirationAfterWritePolicy
- The class path for an implementation of ExpirationAfterWritePolicy
-
getInvalidateScanCount
Returns the count used for the scan command inRedisCache.invalidateAll()
. SeeScanArgs.limit(long)
. Defaults to 100L.- Returns:
- the count setting used in the redis scan in
RedisCache.invalidateAll()
. - Since:
- 6.5.0
-
setInvalidateScanCount
Sets the count used for the scan command inRedisCache.invalidateAll()
. SeeScanArgs.limit(long)
. Defaults to 100L.- Parameters:
invalidateScanCount
- the count setting to use with the redis scan inRedisCache.invalidateAll()
.- Since:
- 6.5.0
-