Interface IApiCache

All Known Implementing Classes:
ApiEhcache, ApiMemcached

public interface IApiCache
Etag (key-value) Cache interface, allows RestListeners and ApiListeners to save and retrieve etags.
Since:
7.0-B2
Author:
Niels Meijer
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all items in the cache.
    boolean
    Checks whether or not an object has previously been stored in the cache
    void
    Closes the cache.
    get(String key)
    Retrieve an object from the cache
    void
    put(String key, Object value)
    Place an object in the cache
    void
    put(String key, Object value, int ttl)
    Place an object in the cache
    boolean
    Remove an object from the cache
  • Method Details

    • get

      Object get(String key)
      Retrieve an object from the cache
      Parameters:
      key - name of the object to fetch
      Returns:
      null or value of the stored object
    • put

      void put(String key, Object value)
      Place an object in the cache
      Parameters:
      key - name of the object to store
      value - value of the object
    • put

      void put(String key, Object value, int ttl)
      Place an object in the cache
      Parameters:
      key - name of the object to store
      value - value of the object
      ttl - time to live, when the object expires
    • remove

      boolean remove(String key)
      Remove an object from the cache
      Parameters:
      key - name of the object to remove
      Returns:
      returns true when successfully removed the object
    • containsKey

      boolean containsKey(String key)
      Checks whether or not an object has previously been stored in the cache
      Parameters:
      key - name of the object to find
      Returns:
      true when found
    • clear

      void clear()
      Removes all items in the cache.
    • destroy

      void destroy()
      Closes the cache.