类 RedisCache

java.lang.Object
org.tio.utils.cache.AbsCache
org.tio.utils.cache.redis.RedisCache
所有已实现的接口:
ICache

public class RedisCache extends AbsCache
作者:
tanyaowu 2017年8月10日 下午1:35:01
  • 字段详细资料

  • 方法详细资料

    • cacheKey

      public static String cacheKey(String cacheName, String key)
    • getCache

      public static RedisCache getCache(String cacheName)
    • keyPrefix

      public static String keyPrefix(String cacheName)
    • register

      public static RedisCache register(org.redisson.api.RedissonClient redisson, String cacheName, Long timeToLiveSeconds, Long timeToIdleSeconds)
      timeToLiveSeconds和timeToIdleSeconds不允许同时为null
      参数:
      cacheName -
      timeToLiveSeconds -
      timeToIdleSeconds -
      返回:
    • clear

      public void clear()
      从接口复制的说明: ICache
      清空所有缓存
    • _get

      public Serializable _get(String key)
      指定者:
      _get 在类中 AbsCache
    • getBucket

      public org.redisson.api.RBucket<Serializable> getBucket(String key)
    • getRedisson

      public org.redisson.api.RedissonClient getRedisson()
    • getTimeout

      public Long getTimeout()
    • getTimeToIdleSeconds

      public Long getTimeToIdleSeconds()
      指定者:
      getTimeToIdleSeconds 在接口中 ICache
      覆盖:
      getTimeToIdleSeconds 在类中 AbsCache
      返回:
    • getTimeToLiveSeconds

      public Long getTimeToLiveSeconds()
      指定者:
      getTimeToLiveSeconds 在接口中 ICache
      覆盖:
      getTimeToLiveSeconds 在类中 AbsCache
      返回:
    • keys

      public Iterable<String> keys()
      从接口复制的说明: ICache
      获取所有的key
      返回:
    • put

      public void put(String key, Serializable value)
      从接口复制的说明: ICache
      将key value保存到缓存中
    • putTemporary

      public void putTemporary(String key, Serializable value)
      从接口复制的说明: ICache
      临时添加一个值,用于防止缓存穿透攻击
    • remove

      public void remove(String key)
      从接口复制的说明: ICache
      删除一个key
    • ttl

      public long ttl(String key)
      从接口复制的说明: ICache
      对象还会存活多久。
      返回:
      currTime in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.