Interface Cache<K,V>

All Known Implementing Classes:
DefaultCache, DisabledCache

public interface Cache<K,V>
A Cache efficiently stores temporary objects primarily to improve an application's performance.

This interface provides an abstraction (wrapper) API on top of an underlying cache framework's cache instance (e.g. JCache, Ehcache, Hazelcast, JCS, OSCache, JBossCache, TerraCotta, Coherence, GigaSpaces, etc, etc), allowing a Okta SDK user to configure any cache mechanism they choose.

Since:
0.5.0
  • Method Summary

    Modifier and Type
    Method
    Description
    get(K key)
    Returns the cached value stored under the specified key or null if there is no cache entry for that key.
    put(K key, V value)
    Adds a cache entry.
    remove(K key)
    Removes the cached value stored under the specified key.
  • Method Details

    • get

      V get(K key)
      Returns the cached value stored under the specified key or null if there is no cache entry for that key.
      Parameters:
      key - the key that the value was previous added with
      Returns:
      the cached object or null if there is no entry for the specified key
    • put

      V put(K key, V value)
      Adds a cache entry.
      Parameters:
      key - the key used to identify the object being stored.
      value - the value to be stored in the cache.
      Returns:
      the previous value associated with the given key or null if there was no previous value
    • remove

      V remove(K key)
      Removes the cached value stored under the specified key.
      Parameters:
      key - the key used to identify the object being stored.
      Returns:
      the removed value or null if there was no value cached.