Interface RedisCache

All Superinterfaces:
Cache
All Known Implementing Classes:
RedisCacheImpl

public interface RedisCache extends Cache
  • Method Summary

    Modifier and Type
    Method
    Description
    <K, V> io.smallrye.mutiny.Uni<V>
    get(K key, jakarta.enterprise.util.TypeLiteral<V> type, Function<K,V> valueLoader)
    Allows retrieving a value from the Redis cache.
    <K, V> io.smallrye.mutiny.Uni<V>
    get(K key, Class<V> clazz, Function<K,V> valueLoader)
    Allows retrieving a value from the Redis cache.
    <K, V> io.smallrye.mutiny.Uni<V>
    get(K key, Function<K,V> valueLoader)
     
    <K, V> io.smallrye.mutiny.Uni<V>
    getAsync(K key, jakarta.enterprise.util.TypeLiteral<V> type, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
    Allows retrieving a value from the Redis cache.
    <K, V> io.smallrye.mutiny.Uni<V>
    getAsync(K key, Class<V> clazz, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
    Allows retrieving a value from the Redis cache.
    <K, V> io.smallrye.mutiny.Uni<V>
    getAsync(K key, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
     
    Deprecated.
    should have never been exposed publicly
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrDefault(K key, jakarta.enterprise.util.TypeLiteral<V> type, V defaultValue)
    Returns Uni that completes with a value present in the cache under the given key.
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrDefault(K key, Class<V> clazz, V defaultValue)
    Returns Uni that completes with a value present in the cache under the given key.
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrDefault(K key, V defaultValue)
    Returns Uni that completes with a value present in the cache under the given key.
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrNull(K key)
    Returns Uni that completes with a value present in the cache under the given key.
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrNull(K key, jakarta.enterprise.util.TypeLiteral<V> type)
    Returns Uni that completes with a value present in the cache under the given key.
    <K, V> io.smallrye.mutiny.Uni<V>
    getOrNull(K key, Class<V> clazz)
    Returns Uni that completes with a value present in the cache under the given key.
    <K, V> io.smallrye.mutiny.Uni<Void>
    put(K key, Supplier<V> supplier)
    Put a value in the cache.
    <K, V> io.smallrye.mutiny.Uni<Void>
    put(K key, V value)
    Put a value in the cache.

    Methods inherited from interface io.quarkus.cache.Cache

    as, getDefaultKey, getName, invalidate, invalidateAll, invalidateIf
  • Method Details

    • getDefaultValueType

      @Deprecated Class<?> getDefaultValueType()
      Deprecated.
      should have never been exposed publicly
      When configured, gets the default type of the value stored in the cache. The configured type is used in methods get(Object, Function), getAsync(Object, Function), getOrDefault(Object, Object) and getOrNull(Object).
      Returns:
      the type, null if not configured or if not a Class.
    • get

      <K, V> io.smallrye.mutiny.Uni<V> get(K key, Function<K,V> valueLoader)
      Specified by:
      get in interface Cache
    • getAsync

      <K, V> io.smallrye.mutiny.Uni<V> getAsync(K key, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
      Specified by:
      getAsync in interface Cache
    • get

      <K, V> io.smallrye.mutiny.Uni<V> get(K key, Class<V> clazz, Function<K,V> valueLoader)
      Allows retrieving a value from the Redis cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      clazz - the class of the value
      valueLoader - the value loader called when there is no value stored in the cache
      Returns:
      the Uni emitting the cached value.
    • get

      <K, V> io.smallrye.mutiny.Uni<V> get(K key, jakarta.enterprise.util.TypeLiteral<V> type, Function<K,V> valueLoader)
      Allows retrieving a value from the Redis cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      type - the type of the value
      valueLoader - the value loader called when there is no value stored in the cache
      Returns:
      the Uni emitting the cached value.
    • getAsync

      <K, V> io.smallrye.mutiny.Uni<V> getAsync(K key, Class<V> clazz, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
      Allows retrieving a value from the Redis cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      clazz - the class of the value
      valueLoader - the value loader called when there is no value stored in the cache
      Returns:
      the Uni emitting the cached value.
    • getAsync

      <K, V> io.smallrye.mutiny.Uni<V> getAsync(K key, jakarta.enterprise.util.TypeLiteral<V> type, Function<K,io.smallrye.mutiny.Uni<V>> valueLoader)
      Allows retrieving a value from the Redis cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      type - the type of the value
      valueLoader - the value loader called when there is no value stored in the cache
      Returns:
      the Uni emitting the cached value.
    • put

      <K, V> io.smallrye.mutiny.Uni<Void> put(K key, V value)
      Put a value in the cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      value - the value
      Returns:
      a Uni emitting null when the operation completes
    • put

      <K, V> io.smallrye.mutiny.Uni<Void> put(K key, Supplier<V> supplier)
      Put a value in the cache.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      supplier - supplier of the value
      Returns:
      a Uni emitting null when the operation completes
    • getOrDefault

      <K, V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, V defaultValue)
      Returns Uni that completes with a value present in the cache under the given key. If there is no value in the cache under the key, the Uni completes with the given defaultValue.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      defaultValue - the default value
      Returns:
      a Uni emitting the value cached under key, or defaultValue if there is no cached value
    • getOrDefault

      <K, V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, Class<V> clazz, V defaultValue)
      Returns Uni that completes with a value present in the cache under the given key. If there is no value in the cache under the key, the Uni completes with the given defaultValue.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      clazz - class of the value
      defaultValue - the default value
      Returns:
      a Uni emitting the value cached under key, or defaultValue if there is no cached value
    • getOrDefault

      <K, V> io.smallrye.mutiny.Uni<V> getOrDefault(K key, jakarta.enterprise.util.TypeLiteral<V> type, V defaultValue)
      Returns Uni that completes with a value present in the cache under the given key. If there is no value in the cache under the key, the Uni completes with the given defaultValue.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      type - type of the value
      defaultValue - the default value
      Returns:
      a Uni emitting the value cached under key, or defaultValue if there is no cached value
    • getOrNull

      <K, V> io.smallrye.mutiny.Uni<V> getOrNull(K key)
      Returns Uni that completes with a value present in the cache under the given key. If there is no value in the cache under the key, the Uni completes with null.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      Returns:
      a Uni emitting the value cached under key, or null if there is no cached value
    • getOrNull

      <K, V> io.smallrye.mutiny.Uni<V> getOrNull(K key, Class<V> clazz)
      Returns Uni that completes with a value present in the cache under the given key. If there is no value in the cache under the key, the Uni completes with null.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      clazz - the class of the value
      Returns:
      a Uni emitting the value cached under key, or null if there is no cached value
    • getOrNull

      <K, V> io.smallrye.mutiny.Uni<V> getOrNull(K key, jakarta.enterprise.util.TypeLiteral<V> type)
      Returns Uni that completes with a value present in the cache under the given key. If there is no value in the cache under the key, the Uni completes with null.
      Type Parameters:
      K - the type of key
      V - the type of value
      Parameters:
      key - the key
      type - the type of the value
      Returns:
      a Uni emitting the value cached under key, or null if there is no cached value