Interface Entry<V,C>

Type Parameters:
V - the type of the value of the entry
C - the type of the composed value of the entry
All Superinterfaces:
Serializable
All Known Implementing Classes:
ApiKeyEntryCache, ConfigChapterCacheEntry, LastSecretVersionsCacheEntry, LayerChapterCacheEntry, MaintenanceCacheEntry, OmissionCacheEntry, RawExtractor, SecretEntry, StaticView.SVCache, WebResourceChapterCacheEntry

public interface Entry<V,C> extends Serializable
Interface used to identify, load and serialize an entry within the Cache.
  • Method Summary

    Modifier and Type
    Method
    Description
    The method for obtaining the composed instance of the object.
    default V
    fromRaw(byte[] bb)
    Create the instance of the real entry value by deserializing the passed bytes array
    default Charset
    The charset to be used during the serialization/deserialization of this entity
    default long
    Defines the ttl in milliseconds for the entry to remain in the cloud cache.
    Defines the name of a cacheable object
    default long
    Defines the ttl in milliseconds that the entry remains in the local cache. this interval should be reset against any reading of the entry.
    default long
    Defines the ttl in milliseconds for the entry to remain in the local cache.
    default String
    Defines the name of a view for the cacheable object
    The method for obtaining the real value of the entry
    default byte[]
    toRaw(V obj)
    Serialize the real value of the entry into a bytes array.
  • Method Details

    • getKey

      String getKey()
      Defines the name of a cacheable object
      Returns:
      the name of a cacheable object
    • getView

      default String getView()
      Defines the name of a view for the cacheable object
      Returns:
      the name of the view for the cacheable object. Typically, the empty string indicates that the entry consists of only one view
    • load

      V load()
      The method for obtaining the real value of the entry
      Returns:
      the real value of the entry. This method must be used when the cache doesn't contains a version for this Entry
    • compose

      C compose(V v)
      The method for obtaining the composed instance of the object. This method allows the real instance of the object to be aggregated with other information, such as the composition of a system configuration with the default one
      Parameters:
      v - the real instance of the object
      Returns:
      the composed instance of the object. This method must be used after the invocation of the load() method when the cache doesn't contain a version for this entry.
    • getStoreTtl

      default long getStoreTtl()
      Defines the ttl in milliseconds for the entry to remain in the local cache. After this interval, the entry should be removed.
      Returns:
      the ttl or -1 if the entry will never expire
    • getReadTtl

      default long getReadTtl()
      Defines the ttl in milliseconds that the entry remains in the local cache. this interval should be reset against any reading of the entry. After this interval, the entry should be removed.
      Returns:
      the ttl or -1 if the entry will never expire
    • getClusterTtl

      default long getClusterTtl()
      Defines the ttl in milliseconds for the entry to remain in the cloud cache. After this interval, the entry should be removed.
      Returns:
      the ttl or -1 if the entry will never expire
    • toRaw

      default byte[] toRaw(V obj) throws IOException
      Serialize the real value of the entry into a bytes array.
      Parameters:
      obj - the real value of the entry
      Returns:
      the serialized bytes array
      Throws:
      IOException - if the serialization phase goes wrong
    • fromRaw

      default V fromRaw(byte[] bb) throws IOException
      Create the instance of the real entry value by deserializing the passed bytes array
      Parameters:
      bb - the bytes array containing the serialized object
      Returns:
      the real entry value instance
      Throws:
      IOException - if the deserialization phase goes wrong
    • getCharset

      default Charset getCharset()
      The charset to be used during the serialization/deserialization of this entity
      Returns:
      The charset to be used during the serialization/deserialization of this entity. Return value must not be null.