类 RedisCache

java.lang.Object
com.walker.support.redis.cache.RedisCache
所有已实现的接口:
Cache, Expired, com.walker.infrastructure.core.ApplicationBeanDestroied, com.walker.infrastructure.core.ApplicationBeanInitialized, Serializable
直接已知子类:
RedisPageCache

public class RedisCache extends Object implements Cache, com.walker.infrastructure.core.ApplicationBeanInitialized, com.walker.infrastructure.core.ApplicationBeanDestroied
另请参阅:
  • 字段详细资料

    • logger

      protected final transient org.slf4j.Logger logger
  • 构造器详细资料

  • 方法详细资料

    • isSupportExpiredCache

      public boolean isSupportExpiredCache()
    • setSupportExpiredCache

      public void setSupportExpiredCache(boolean supportExpiredCache)
      设置是否支持缓存失效,因为redis失效是针对key,因此HashMap方式是作为整体失效的!
           1) 默认不支持缓存失效,此时使用Map方式存储数据
           2) 当设置运行失效时,必须采用字符串形式的数据结构
           3) 该选项只对hashmap数据结构有效。
       
      参数:
      supportExpiredCache -
    • getRedisHelper

      public RedisHelper getRedisHelper()
    • setRedisHelper

      public void setRedisHelper(RedisHelper redisHelper)
    • shutdown

      public void shutdown()
      指定者:
      shutdown 在接口中 com.walker.infrastructure.core.ApplicationBeanDestroied
    • startup

      public void startup()
      指定者:
      startup 在接口中 com.walker.infrastructure.core.ApplicationBeanInitialized
    • put

      public void put(String key, Object data)
      指定者:
      put 在接口中 Cache
    • put

      public void put(String key, Object data, long expiredSeconds)
      指定者:
      put 在接口中 Cache
    • putList

      public void putList(String key, List<Object> list, long expiredSeconds)
      指定者:
      putList 在接口中 Cache
    • putListAppend

      public void putListAppend(String key, Object data)
      指定者:
      putListAppend 在接口中 Cache
    • getList

      public List<Object> getList(String key, long start, long end, Class<?> clazz)
      获取整个集合值,0 到 -1代表所有值
      指定者:
      getList 在接口中 Cache
      参数:
      key -
      start -
      end -
      返回:
    • removeList

      public void removeList(String key, Object value)
      删除集合中的一个元素。
           从左往右删除list中元素A  (1:从左往右 -1:从右往左 0:删除全部)
       
      指定者:
      removeList 在接口中 Cache
      参数:
      key - 集合唯一key
      value - 元素内容,对象字符串
    • removeList

      public void removeList(String key)
      删除一个集合,待测试验证。
      指定者:
      removeList 在接口中 Cache
      参数:
      key -
    • getListSize

      public long getListSize(String key)
      获取集合元素数量。
      指定者:
      getListSize 在接口中 Cache
      参数:
      key -
      返回:
    • remove

      public Object remove(String key)
      指定者:
      remove 在接口中 Cache
    • remove

      public void remove(List<String> keys)
      指定者:
      remove 在接口中 Cache
    • getPersistentSize

      public long getPersistentSize()
      返回持久化的的缓存数据数量,如:redis持久的
      指定者:
      getPersistentSize 在接口中 Cache
      返回:
    • get

      public Object get(String key)
      指定者:
      get 在接口中 Cache
    • get

      public Object get(String key, Class<?> clazz)
      给定对象类型,返回缓存的对象。该方法在redis实现中用到
      指定者:
      get 在接口中 Cache
      参数:
      key -
      clazz -
      返回:
    • replace

      public void replace(String key, Object data)
      指定者:
      replace 在接口中 Cache
    • clear

      public void clear()
      指定者:
      clear 在接口中 Cache
    • updateCacheDataTimeStamp

      public void updateCacheDataTimeStamp(String key)
      指定者:
      updateCacheDataTimeStamp 在接口中 Cache
    • getCacheName

      public String getCacheName()
      指定者:
      getCacheName 在接口中 Cache
    • setCacheName

      public void setCacheName(String name)
      指定者:
      setCacheName 在接口中 Cache
    • isWriteOnDiskAfterShutdown

      public boolean isWriteOnDiskAfterShutdown()
      指定者:
      isWriteOnDiskAfterShutdown 在接口中 Cache
    • setWriteOnDiskAfterShutdown

      public void setWriteOnDiskAfterShutdown(boolean boo)
      指定者:
      setWriteOnDiskAfterShutdown 在接口中 Cache
    • getExpiredTime

      public long getExpiredTime()
      指定者:
      getExpiredTime 在接口中 Cache
      指定者:
      getExpiredTime 在接口中 Expired
    • setExpiredTime

      public void setExpiredTime(int seconds)
      指定者:
      setExpiredTime 在接口中 Cache
      指定者:
      setExpiredTime 在接口中 Expired
    • getIterator

      public Iterator<Cachable> getIterator()
      指定者:
      getIterator 在接口中 Cache
    • getKeys

      public Set<Object> getKeys()
      指定者:
      getKeys 在接口中 Cache
    • getIterator

      public List<String> getIterator(Class<?> clazz)
      指定者:
      getIterator 在接口中 Cache
    • setCacheOperateListener

      public void setCacheOperateListener(CacheOperateListener cacheOperateListener)
      指定者:
      setCacheOperateListener 在接口中 Cache
    • getRootData

      @Deprecated public String getRootData(String key)
      已过时。
      返回redis根下面的某个值。注意:该方法只有特殊场景使用,
      因为这相当于存储数据没有表名,后续很难统计数量。
      参数:
      key -
      返回:
    • size

      public long size()
      指定者:
      size 在接口中 Cache
    • queryListLimit

      public Collection<Object> queryListLimit(int maxSize)
      返回给定限制的缓存数据集合
      指定者:
      queryListLimit 在接口中 Cache
      参数:
      maxSize - 限制的最大数量
      返回: