public class RedisCache<K,V> extends Object implements org.apache.shiro.cache.Cache<K,V>
| Constructor and Description |
|---|
RedisCache(RedisManager cache)
通过一个JedisManager实例构造RedisCache
|
RedisCache(RedisManager cache,
String prefix)
Constructs a cache instance with the specified
Redis manager and using a custom key prefix.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
V |
get(K key) |
String |
getKeyPrefix()
Returns the Redis session keys
prefix.
|
Set<K> |
keys() |
V |
put(K key,
V value) |
V |
remove(K key) |
void |
setKeyPrefix(String keyPrefix)
Sets the Redis sessions key
prefix.
|
int |
size() |
Collection<V> |
values() |
public RedisCache(RedisManager cache)
public RedisCache(RedisManager cache, String prefix)
cache - The cache manager instanceprefix - The Redis key prefixpublic String getKeyPrefix()
public void setKeyPrefix(String keyPrefix)
keyPrefix - The prefixpublic void clear()
throws org.apache.shiro.cache.CacheException
public Collection<V> values()
Copyright © 2017. All rights reserved.