MAX_EXPIRE_IN_LOCAL| 限定符和类型 | 方法和说明 |
|---|---|
static String |
cacheKey(String cacheName,
String key) |
void |
clear()
清空所有缓存
|
Serializable |
get(String key)
根据key获取value
|
<T> T |
get(String key,
Class<T> clazz)
根据key获取value
|
org.redisson.api.RBucket<Serializable> |
getBucket(String key) |
static RedisCache |
getCache(String cacheName) |
org.redisson.api.RedissonClient |
getRedisson() |
Long |
getTimeout() |
Long |
getTimeToIdleSeconds() |
Long |
getTimeToLiveSeconds() |
static String |
keyPrefix(String cacheName) |
Iterable<String> |
keys()
获取所有的key
|
void |
put(String key,
Serializable value)
将key value保存到缓存中
|
void |
putTemporary(String key,
Serializable value)
临时添加一个值,用于防止缓存穿透攻击
|
static RedisCache |
register(org.redisson.api.RedissonClient redisson,
String cacheName,
Long timeToLiveSeconds,
Long timeToIdleSeconds)
timeToLiveSeconds和timeToIdleSeconds不允许同时为null
|
void |
remove(String key)
删除一个key
|
long |
ttl(String key)
对象还会存活多久。
|
getCacheName, setCacheNamepublic static RedisCache getCache(String cacheName)
public static RedisCache register(org.redisson.api.RedissonClient redisson, String cacheName, Long timeToLiveSeconds, Long timeToIdleSeconds)
cacheName - timeToLiveSeconds - timeToIdleSeconds - public void clear()
ICachepublic Serializable get(String key)
ICachepublic org.redisson.api.RBucket<Serializable> getBucket(String key)
public org.redisson.api.RedissonClient getRedisson()
public Long getTimeout()
public Long getTimeToIdleSeconds()
public Long getTimeToLiveSeconds()
public void put(String key, Serializable value)
ICachepublic void putTemporary(String key, Serializable value)
ICacheCopyright © 2018. All rights reserved.