@EachProperty(value="redis.caches") public class RedisCacheConfiguration extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
cacheName |
protected Charset |
charset |
protected Duration |
expireAfterAccess |
protected Duration |
expireAfterWrite |
protected Class<io.micronaut.core.serialize.ObjectSerializer> |
keySerializer |
protected String |
server |
protected Class<io.micronaut.core.serialize.ObjectSerializer> |
valueSerializer |
Constructor and Description |
---|
RedisCacheConfiguration(String cacheName,
io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getCacheName() |
Charset |
getCharset() |
Optional<Duration> |
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.
|
Optional<Duration> |
getExpireAfterWrite() |
Optional<Class<io.micronaut.core.serialize.ObjectSerializer>> |
getKeySerializer()
The
ObjectSerializer to use for serializing keys. |
Optional<String> |
getServer() |
Optional<Class<io.micronaut.core.serialize.ObjectSerializer>> |
getValueSerializer() |
void |
setCharset(Charset charset) |
void |
setExpireAfterAccess(Duration expireAfterAccess) |
void |
setExpireAfterWrite(Duration expireAfterWrite) |
protected String server
protected Class<io.micronaut.core.serialize.ObjectSerializer> keySerializer
protected Class<io.micronaut.core.serialize.ObjectSerializer> valueSerializer
protected Charset charset
protected Duration expireAfterWrite
protected Duration expireAfterAccess
protected final String cacheName
public RedisCacheConfiguration(@Parameter String cacheName, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
cacheName
- cacheNameapplicationConfiguration
- applicationConfigurationpublic Optional<String> getServer()
NamedRedisServersConfiguration
public Optional<Class<io.micronaut.core.serialize.ObjectSerializer>> getValueSerializer()
ObjectSerializer
type to use for serializing values.public Optional<Class<io.micronaut.core.serialize.ObjectSerializer>> getKeySerializer()
ObjectSerializer
to use for serializing keys. Defaults to DefaultStringKeySerializer
.ObjectSerializer
classpublic String getCacheName()
public Optional<Duration> getExpireAfterWrite()
public Optional<Duration> getExpireAfterAccess()
Duration
public Charset getCharset()
public void setExpireAfterWrite(Duration expireAfterWrite)
expireAfterWrite
- The cache expiration duration after writing into it.public void setExpireAfterAccess(Duration expireAfterAccess)
expireAfterAccess
- The cache expiration duration after accessing itpublic void setCharset(Charset charset)
charset
- The charset used to serialize and deserialize values