ICache.NullClass
Modifier and Type | Field and Description |
---|---|
static String |
SPLIT_FOR_CACHENAME |
MAX_EXPIRE_IN_LOCAL, NULL_OBJ
Modifier and Type | Method and Description |
---|---|
Serializable |
_get(String key) |
static String |
cacheKey(String cacheName,
String key) |
void |
clear()
清空所有缓存
|
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)
对象还会存活多久。
|
get, get, getCacheName, setCacheName, setTimeToIdleSeconds, setTimeToLiveSeconds
public static final String SPLIT_FOR_CACHENAME
public 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()
ICache
public Serializable _get(String key)
public org.redisson.api.RBucket<Serializable> getBucket(String key)
public org.redisson.api.RedissonClient getRedisson()
public Long getTimeout()
public Long getTimeToIdleSeconds()
getTimeToIdleSeconds
in interface ICache
getTimeToIdleSeconds
in class AbsCache
public Long getTimeToLiveSeconds()
getTimeToLiveSeconds
in interface ICache
getTimeToLiveSeconds
in class AbsCache
public void put(String key, Serializable value)
ICache
public void putTemporary(String key, Serializable value)
ICache
Copyright © 2021. All rights reserved.