Class AbstractRedisCacheConfiguration

java.lang.Object
io.micronaut.configuration.lettuce.cache.AbstractRedisCacheConfiguration
Direct Known Subclasses:
DefaultRedisCacheConfiguration, RedisCacheConfiguration

public abstract class AbstractRedisCacheConfiguration extends Object
Allows configuration of caches stored in Redis.
Since:
1.3
Author:
Graeme Rocher, Alex Katlein
  • Field Details

    • server

      protected String server
    • keySerializer

      protected Class<io.micronaut.core.serialize.ObjectSerializer> keySerializer
    • valueSerializer

      protected Class<io.micronaut.core.serialize.ObjectSerializer> valueSerializer
    • charset

      protected Charset charset
    • expireAfterWrite

      protected Duration expireAfterWrite
    • expireAfterAccess

      protected Duration expireAfterAccess
    • expirationAfterWritePolicy

      protected String expirationAfterWritePolicy
  • Constructor Details

    • AbstractRedisCacheConfiguration

      public AbstractRedisCacheConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
      Constructor.
      Parameters:
      applicationConfiguration - applicationConfiguration
  • Method Details

    • getServer

      public Optional<String> getServer()
      Returns:
      The name of the server to use.
      See Also:
    • getValueSerializer

      public Optional<Class<io.micronaut.core.serialize.ObjectSerializer>> getValueSerializer()
      Returns:
      The ObjectSerializer type to use for serializing values.
    • getKeySerializer

      public Optional<Class<io.micronaut.core.serialize.ObjectSerializer>> getKeySerializer()
      The ObjectSerializer to use for serializing keys. Defaults to DefaultStringKeySerializer.
      Returns:
      The optional ObjectSerializer class
    • getExpireAfterWrite

      public Optional<Duration> getExpireAfterWrite()
      Returns:
      The expiry to use after the value is written
    • getExpireAfterAccess

      public 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.
      Returns:
      The Duration
    • getExpirationAfterWritePolicy

      public Optional<String> getExpirationAfterWritePolicy()
      Returns:
      The class path for an implementation of ExpirationAfterWritePolicy
    • getCharset

      public Charset getCharset()
      Returns:
      The charset used to serialize and deserialize values
    • setExpireAfterWrite

      public void setExpireAfterWrite(Duration expireAfterWrite)
      Parameters:
      expireAfterWrite - The cache expiration duration after writing into it.
    • setExpireAfterAccess

      public void setExpireAfterAccess(Duration expireAfterAccess)
      Parameters:
      expireAfterAccess - The cache expiration duration after accessing it
    • setCharset

      public void setCharset(Charset charset)
      Parameters:
      charset - The charset used to serialize and deserialize values
    • setExpirationAfterWritePolicy

      public void setExpirationAfterWritePolicy(String expirationAfterWritePolicy)
      Parameters:
      expirationAfterWritePolicy - The class path for an implementation of ExpirationAfterWritePolicy