类 RedisCache
java.lang.Object
org.tio.utils.cache.AbsCache
org.tio.utils.cache.redis.RedisCache
- 所有已实现的接口:
ICache
- 作者:
- tanyaowu 2017年8月10日 下午1:35:01
-
嵌套类概要
从接口继承的嵌套类/接口 org.tio.utils.cache.ICache
ICache.NullClass -
字段概要
字段从接口继承的字段 org.tio.utils.cache.ICache
MAX_EXPIRE_IN_LOCAL, NULL_OBJ -
方法概要
修饰符和类型方法说明static Stringvoidclear()清空所有缓存org.redisson.api.RBucket<Serializable>static RedisCacheorg.redisson.api.RedissonClientstatic Stringkeys()获取所有的keyvoidput(String key, Serializable value) 将key value保存到缓存中voidputTemporary(String key, Serializable value) 临时添加一个值,用于防止缓存穿透攻击static RedisCacheregister(org.redisson.api.RedissonClient redisson, String cacheName, Long timeToLiveSeconds, Long timeToIdleSeconds) timeToLiveSeconds和timeToIdleSeconds不允许同时为nullvoid删除一个keylong对象还会存活多久。从类继承的方法 org.tio.utils.cache.AbsCache
get, get, getCacheName, setCacheName, setTimeToIdleSeconds, setTimeToLiveSeconds
-
字段详细资料
-
SPLIT_FOR_CACHENAME
- 另请参阅:
-
-
方法详细资料
-
cacheKey
-
getCache
-
keyPrefix
-
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
-
getBucket
-
getRedisson
public org.redisson.api.RedissonClient getRedisson() -
getTimeout
-
getTimeToIdleSeconds
- 指定者:
getTimeToIdleSeconds在接口中ICache- 覆盖:
getTimeToIdleSeconds在类中AbsCache- 返回:
-
getTimeToLiveSeconds
- 指定者:
getTimeToLiveSeconds在接口中ICache- 覆盖:
getTimeToLiveSeconds在类中AbsCache- 返回:
-
keys
从接口复制的说明:ICache获取所有的key- 返回:
-
put
从接口复制的说明:ICache将key value保存到缓存中 -
putTemporary
从接口复制的说明:ICache临时添加一个值,用于防止缓存穿透攻击 -
remove
从接口复制的说明:ICache删除一个key -
ttl
从接口复制的说明:ICache对象还会存活多久。- 返回:
- currTime in milliseconds -2 if the key does not exist. -1 if the key exists but has no associated expire.
-