Class CacheDefinition

java.lang.Object
io.vertigo.core.node.definition.AbstractDefinition<CacheDefinition>
io.vertigo.datastore.cache.definitions.CacheDefinition
All Implemented Interfaces:
io.vertigo.core.node.definition.Definition

public final class CacheDefinition extends io.vertigo.core.node.definition.AbstractDefinition<CacheDefinition>
The cache definition defines the configuration of a cache. This definition - has a name; - and 3 params that define the strategy of caching - max elements in memory - time to live - time to idle
Author:
pchretien
  • Field Details

  • Constructor Details

    • CacheDefinition

      public CacheDefinition(String name, boolean serializeElements, int maxElementsInMemory, int timeToLiveSeconds, int timeToIdleSeconds, boolean isReloadedByList)
      Constructor.
      Parameters:
      name - the name of the cache
      serializeElements - If elements are serialized
      maxElementsInMemory - Max elements stored in memory
      timeToLiveSeconds - Time to live (in seconds)
      timeToIdleSeconds - Time to live when idle (in seconds)
  • Method Details

    • shouldSerializeElements

      public boolean shouldSerializeElements()
      Returns:
      elements should be serialized
    • getMaxElementsInMemory

      public int getMaxElementsInMemory()
      Returns:
      Max elements stored in memory
    • getTimeToLiveSeconds

      public int getTimeToLiveSeconds()
      Returns:
      Time to live (in seconds)
    • getTimeToIdleSeconds

      public int getTimeToIdleSeconds()
      Returns:
      Time tio idle (in seconds)
    • isReloadedByList

      public boolean isReloadedByList()