K
- Key TypeV
- Value Type@EachProperty(value="microstream.cache") public class MicroStreamCacheConfigurationProperties<K,V> extends java.lang.Object implements MicroStreamCacheConfiguration<K,V>
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_ENABLED
Whether this cache is enabled by default.
|
static java.lang.String |
PREFIX |
Constructor and Description |
---|
MicroStreamCacheConfigurationProperties(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.lang.Class<K> |
getKeyType() |
java.lang.String |
getName() |
java.lang.String |
getStorage() |
java.lang.Class<V> |
getValueType() |
boolean |
isEnabled() |
java.lang.Boolean |
isManagementEnabled()
Whether management is enabled on this cache.
|
java.lang.Boolean |
isReadThrough()
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.
|
java.lang.Boolean |
isStatisticsEnabled()
Whether statistics collection is enabled in this cache.
|
java.lang.Boolean |
isStoreByValue()
When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.
|
java.lang.Boolean |
isWriteThrough()
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.
|
void |
setEnabled(boolean enabled)
Whether this cache is enabled.
|
void |
setKeyType(java.lang.Class<K> keyType) |
void |
setManagementEnabled(java.lang.Boolean managementEnabled)
Whether management is enabled on this cache.
|
void |
setReadThrough(java.lang.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.
|
void |
setStatisticsEnabled(java.lang.Boolean statisticsEnabled)
Whether statistics collection is enabled in this cache.
|
void |
setStorage(java.lang.String storage) |
void |
setStoreByValue(java.lang.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.
|
void |
setValueType(java.lang.Class<V> valueType) |
void |
setWriteThrough(java.lang.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.
|
public static final java.lang.String PREFIX
public static final boolean DEFAULT_ENABLED
public MicroStreamCacheConfigurationProperties(@Parameter java.lang.String name)
@NonNull public java.lang.Class<K> getKeyType()
getKeyType
in interface MicroStreamCacheConfiguration<K,V>
@NonNull public java.lang.Class<V> getValueType()
getValueType
in interface MicroStreamCacheConfiguration<K,V>
@Nullable public java.lang.String getStorage()
getStorage
in interface MicroStreamCacheConfiguration<K,V>
@Nullable public java.lang.Boolean isReadThrough()
MicroStreamCacheConfiguration
isReadThrough
in interface MicroStreamCacheConfiguration<K,V>
@Nullable public java.lang.Boolean isWriteThrough()
MicroStreamCacheConfiguration
isWriteThrough
in interface MicroStreamCacheConfiguration<K,V>
@Nullable public java.lang.Boolean isStoreByValue()
MicroStreamCacheConfiguration
isStoreByValue
in interface MicroStreamCacheConfiguration<K,V>
@Nullable public java.lang.Boolean isStatisticsEnabled()
MicroStreamCacheConfiguration
isStatisticsEnabled
in interface MicroStreamCacheConfiguration<K,V>
@Nullable public java.lang.Boolean isManagementEnabled()
MicroStreamCacheConfiguration
isManagementEnabled
in interface MicroStreamCacheConfiguration<K,V>
@NonNull public java.lang.String getName()
getName
in interface io.micronaut.core.naming.Named
public void setKeyType(@Nullable java.lang.Class<K> keyType)
keyType
- The required type of keys for the Cache.public void setValueType(@Nullable java.lang.Class<V> valueType)
valueType
- Determines type of values for the Cache.public void setStorage(@Nullable java.lang.String storage)
storage
- Name qualifier for MicroStream Storage Managerpublic void setReadThrough(java.lang.Boolean readThrough)
readThrough
- Whether to use "read-through" modepublic void setWriteThrough(java.lang.Boolean writeThrough)
writeThrough
- Whether to use "write-through" mode.public void setStoreByValue(java.lang.Boolean storeByValue)
storeByValue
- When a cache is storeByValue, any mutation to the key or value does not affect the key of value stored in the cache.public void setStatisticsEnabled(java.lang.Boolean statisticsEnabled)
statisticsEnabled
- Whether statistics collection is enabled in this cache.public void setManagementEnabled(java.lang.Boolean managementEnabled)
managementEnabled
- Whether management is enabled on this cache.public boolean isEnabled()
isEnabled
in interface io.micronaut.core.util.Toggleable
public void setEnabled(boolean enabled)
enabled
- Whether this cache is enabled.