类 RedisStateCache

java.lang.Object
com.xingyuv.justauth.support.cache.RedisStateCache
所有已实现的接口:
AuthStateCache

public class RedisStateCache extends Object implements AuthStateCache

Redis作为JustAuth的State的缓存

作者:
yangkai.shen
  • 字段详细资料

    • redisTemplate

      private final org.springframework.data.redis.core.RedisTemplate<String,String> redisTemplate
    • cacheProperties

      private final CacheProperties cacheProperties
  • 构造器详细资料

    • RedisStateCache

      public RedisStateCache()
  • 方法详细资料

    • cache

      public void cache(String key, String value)
      存入缓存
      指定者:
      cache 在接口中 AuthStateCache
      参数:
      key - 缓存key
      value - 缓存内容
    • cache

      public void cache(String key, String value, long timeout)
      存入缓存
      指定者:
      cache 在接口中 AuthStateCache
      参数:
      key - 缓存key
      value - 缓存内容
      timeout - 指定缓存过期时间(毫秒)
    • get

      public String get(String key)
      获取缓存内容
      指定者:
      get 在接口中 AuthStateCache
      参数:
      key - 缓存key
      返回:
      缓存内容
    • containsKey

      public boolean containsKey(String key)
      是否存在key,如果对应key的value值已过期,也返回false
      指定者:
      containsKey 在接口中 AuthStateCache
      参数:
      key - 缓存key
      返回:
      true:存在key,并且value没过期;false:key不存在或者已过期