public class RedisHashCache
extends org.springframework.data.redis.cache.RedisCache
RedisCache 进行了扩展, 添加了对 Hash类型的缓存的支持Cache implementation using for Redis as underlying store.
Use RedisCacheManager to create RedisHashCache instances.RedisCacheConfiguration,
RedisHashCacheWriter| 限定符 | 构造器和说明 |
|---|---|
protected |
RedisHashCache(String name,
top.dcenter.ums.security.core.oauth.repository.jdbc.cache.RedisHashCacheWriter cacheWriter,
org.springframework.data.redis.cache.RedisCacheConfiguration cacheConfig)
Create new
RedisHashCache. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
protected String |
convertKey(Object key)
Convert
key to a String representation used for cache key creation. |
protected String |
createCacheKey(Object key)
Customization hook for creating cache key before it gets serialized.
|
protected Object |
deserializeCacheValue(byte[] value)
Deserialize the given value to the actual cache value.
|
void |
evict(Object key) |
<T> T |
get(Object key,
Callable<T> valueLoader) |
org.springframework.data.redis.cache.RedisCacheConfiguration |
getCacheConfiguration()
Get
RedisCacheConfiguration used. |
String |
getName() |
org.springframework.data.redis.cache.RedisCacheWriter |
getNativeCache() |
protected Object |
lookup(Object key) |
protected Object |
preProcessCacheValue(Object value)
Customization hook called before passing object to
RedisSerializer. |
void |
put(Object key,
Object value) |
org.springframework.cache.Cache.ValueWrapper |
putIfAbsent(Object key,
Object value) |
protected byte[] |
serializeCacheKey(String cacheKey)
Serialize the key.
|
protected byte[] |
serializeCacheValue(Object value)
Serialize the value to cache.
|
fromStoreValue, get, get, isAllowNullValues, toStoreValue, toValueWrapperprotected RedisHashCache(String name, top.dcenter.ums.security.core.oauth.repository.jdbc.cache.RedisHashCacheWriter cacheWriter, org.springframework.data.redis.cache.RedisCacheConfiguration cacheConfig)
RedisHashCache.name - must not be null.cacheWriter - must not be null.cacheConfig - must not be null.protected Object lookup(@NonNull Object key)
lookup 在类中 org.springframework.data.redis.cache.RedisCache@NonNull public String getName()
getName 在接口中 org.springframework.cache.CachegetName 在类中 org.springframework.data.redis.cache.RedisCache@NonNull public org.springframework.data.redis.cache.RedisCacheWriter getNativeCache()
getNativeCache 在接口中 org.springframework.cache.CachegetNativeCache 在类中 org.springframework.data.redis.cache.RedisCachepublic <T> T get(@NonNull
Object key,
@NonNull
Callable<T> valueLoader)
get 在接口中 org.springframework.cache.Cacheget 在类中 org.springframework.data.redis.cache.RedisCachepublic void put(@NonNull
Object key,
@Nullable
Object value)
put 在接口中 org.springframework.cache.Cacheput 在类中 org.springframework.data.redis.cache.RedisCachepublic org.springframework.cache.Cache.ValueWrapper putIfAbsent(@NonNull
Object key,
@Nullable
Object value)
putIfAbsent 在接口中 org.springframework.cache.CacheputIfAbsent 在类中 org.springframework.data.redis.cache.RedisCachepublic void evict(@NonNull
Object key)
evict 在接口中 org.springframework.cache.Cacheevict 在类中 org.springframework.data.redis.cache.RedisCachepublic void clear()
clear 在接口中 org.springframework.cache.Cacheclear 在类中 org.springframework.data.redis.cache.RedisCache@NonNull public org.springframework.data.redis.cache.RedisCacheConfiguration getCacheConfiguration()
RedisCacheConfiguration used.getCacheConfiguration 在类中 org.springframework.data.redis.cache.RedisCacheRedisCacheConfiguration. Never null.@Nullable protected Object preProcessCacheValue(@Nullable Object value)
RedisSerializer.preProcessCacheValue 在类中 org.springframework.data.redis.cache.RedisCachevalue - can be null.@NonNull
protected byte[] serializeCacheKey(@NonNull
String cacheKey)
serializeCacheKey 在类中 org.springframework.data.redis.cache.RedisCachecacheKey - must not be null.@NonNull
protected byte[] serializeCacheValue(@Nullable
Object value)
serializeCacheValue 在类中 org.springframework.data.redis.cache.RedisCachevalue - must not be null.@Nullable protected Object deserializeCacheValue(@NonNull byte[] value)
deserializeCacheValue 在类中 org.springframework.data.redis.cache.RedisCachevalue - must not be null.@NonNull protected String createCacheKey(@NonNull Object key)
createCacheKey 在类中 org.springframework.data.redis.cache.RedisCachekey - will never be null.@NonNull protected String convertKey(@NonNull Object key)
key to a String representation used for cache key creation.convertKey 在类中 org.springframework.data.redis.cache.RedisCachekey - will never be null.IllegalStateException - if key cannot be converted to String.Copyright © 2021. All rights reserved.