Class MicroStreamCacheConfigurationProperties<K,V>

java.lang.Object
io.micronaut.microstream.cache.MicroStreamCacheConfigurationProperties<K,V>
Type Parameters:
K - Key Type
V - Value Type
All Implemented Interfaces:
io.micronaut.core.naming.Named, io.micronaut.core.util.Toggleable, MicroStreamCacheConfiguration<K,V>

@EachProperty("microstream.cache") public class MicroStreamCacheConfigurationProperties<K,V> extends Object implements MicroStreamCacheConfiguration<K,V>
Since:
1.0.0
Author:
Sergio del Amo
  • Field Details

  • Constructor Details

    • MicroStreamCacheConfigurationProperties

      public MicroStreamCacheConfigurationProperties(@Parameter String name)
  • Method Details

    • getKeyType

      @NonNull public @NonNull Class<K> getKeyType()
      Specified by:
      getKeyType in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      The required type of keys for the Cache.
    • getValueType

      @NonNull public @NonNull Class<V> getValueType()
      Specified by:
      getValueType in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      Determines type of values for the Cache.
    • getStorage

      @Nullable public @Nullable String getStorage()
      Specified by:
      getStorage in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      Name qualifier for Storage Manager.
    • isReadThrough

      @Nullable public @Nullable Boolean isReadThrough()
      Description copied from interface: MicroStreamCacheConfiguration
      When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked.
      Specified by:
      isReadThrough in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      Whether to use "read-through" mode
    • isWriteThrough

      @Nullable public @Nullable Boolean isWriteThrough()
      Description copied from interface: MicroStreamCacheConfiguration
      When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.
      Specified by:
      isWriteThrough in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      Whether to use "write-through" mode.
    • isStoreByValue

      @Nullable public @Nullable Boolean isStoreByValue()
      Description copied from interface: MicroStreamCacheConfiguration
      When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
      Specified by:
      isStoreByValue in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      Whether the cache is Story by value.
    • isStatisticsEnabled

      @Nullable public @Nullable Boolean isStatisticsEnabled()
      Description copied from interface: MicroStreamCacheConfiguration
      Whether statistics collection is enabled in this cache.
      Specified by:
      isStatisticsEnabled in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      Whether statistics collection is enabled in this cache.
    • isManagementEnabled

      @Nullable public @Nullable Boolean isManagementEnabled()
      Description copied from interface: MicroStreamCacheConfiguration
      Whether management is enabled on this cache.
      Specified by:
      isManagementEnabled in interface MicroStreamCacheConfiguration<K,V>
      Returns:
      Whether management is enabled on this cache.
    • getName

      @NonNull public @NonNull String getName()
      Specified by:
      getName in interface io.micronaut.core.naming.Named
    • setKeyType

      public void setKeyType(@Nullable @Nullable Class<K> keyType)
      Parameters:
      keyType - The required type of keys for the Cache.
    • setValueType

      public void setValueType(@Nullable @Nullable Class<V> valueType)
      Parameters:
      valueType - Determines type of values for the Cache.
    • setStorage

      public void setStorage(@Nullable @Nullable String storage)
      Parameters:
      storage - Name qualifier for MicroStream Storage Manager
    • setReadThrough

      public void setReadThrough(Boolean readThrough)
      When in "read-through" mode, cache misses that occur due to cache entries not existing as a result of performing a "get" will appropriately cause the configured CacheLoader to be invoked. When you set a Storage Manager, "read-through" mode is activated.
      Parameters:
      readThrough - Whether to use "read-through" mode
    • setWriteThrough

      public void setWriteThrough(Boolean writeThrough)
      When in "write-through" mode, cache updates that occur as a result of performing "put" operations will appropriately cause the configured CacheWriter to be invoked.When you set a Storage Manager, "write-through" mode is activated.
      Parameters:
      writeThrough - Whether to use "write-through" mode.
    • setStoreByValue

      public void setStoreByValue(Boolean storeByValue)
      When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
      Parameters:
      storeByValue - When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
    • setStatisticsEnabled

      public void setStatisticsEnabled(Boolean statisticsEnabled)
      Whether statistics collection is enabled in this cache.
      Parameters:
      statisticsEnabled - Whether statistics collection is enabled in this cache.
    • setManagementEnabled

      public void setManagementEnabled(Boolean managementEnabled)
      Whether management is enabled on this cache.
      Parameters:
      managementEnabled - Whether management is enabled on this cache.
    • isEnabled

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

      public void setEnabled(boolean enabled)
      Whether this cache is enabled. Default Value: true
      Parameters:
      enabled - Whether this cache is enabled.