public class RedisCacheStorage<K,V> extends Object implements IRemoteCacheStore<K,V>, org.springframework.beans.factory.InitializingBean
| 构造器和说明 |
|---|
RedisCacheStorage() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
V |
get(K key)
获取key对应的数据
|
Map<K,V> |
hget(String cacheId) |
V |
hget(String cacheId,
K key)
获取key对应的数据
|
void |
hremove(String cacheId) |
void |
hremove(String cacheId,
K key)
删除
|
void |
hremoveMulti(String cacheId,
K... keys) |
boolean |
hset(String cacheId,
K key,
V value)
存入数据
|
void |
initializationStrongCache(String cacheId,
Map<K,V> map) |
void |
remove(K key)
删除指定的缓存信息
|
void |
removeMulti(K... keys)
删除多个key的缓存信息
|
boolean |
set(K key,
V value)
存入数据,默认时效:3600 * 24
|
boolean |
set(K key,
V value,
int exp)
存入有时效的数据
|
void |
setExpire(int expire) |
void |
setRedisTemplate(org.springframework.data.redis.core.RedisTemplate redisTemplate) |
public void setRedisTemplate(org.springframework.data.redis.core.RedisTemplate redisTemplate)
public boolean set(K key, V value)
存入数据,默认时效:3600 * 24
set 在接口中 IRemoteCacheStore<K,V>key - keyvalue - valuepublic boolean set(K key, V value, int exp)
存入有时效的数据
set 在接口中 IRemoteCacheStore<K,V>key - keyvalue - valueexp - exppublic void remove(K key)
删除指定的缓存信息
remove 在接口中 IRemoteCacheStore<K,V>key - keypublic void removeMulti(K... keys)
删除多个key的缓存信息
removeMulti 在接口中 IRemoteCacheStore<K,V>keys - keyspublic boolean hset(String cacheId, K key, V value)
cacheId - cacheIdkey - keyvalue - valuepublic void hremove(String cacheId)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanExceptionpublic void setExpire(int expire)
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.