Class CacheDefinition

  • All Implemented Interfaces:
    io.vertigo.core.node.definition.Definition

    public final class CacheDefinition
    extends io.vertigo.core.node.definition.AbstractDefinition
    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
    • Constructor Detail

      • 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 Detail

      • 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()