Class AccessLimitedStampManager
java.lang.Object
cn.herodotus.engine.cache.jetcache.stamp.AbstractStampManager<String,Long>
cn.herodotus.engine.web.service.stamp.AccessLimitedStampManager
- All Implemented Interfaces:
StampManager<String,Long>
Description: 防刷签章管理器
这里使用Long类型作为值的存储类型,是为了解决该Cache 同时可以存储Duration相关的数据
- Author:
- : gengwei.zheng
- Date:
- : 2021/8/25 21:43
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncalculateRemainingTime(Duration configuredDuration, String expireKey) 计算剩余过期时间Methods inherited from class cn.herodotus.engine.cache.jetcache.stamp.AbstractStampManager
check, delete, get, getCache, getExpire, lock, lockAndRun, put, setExpireMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cn.herodotus.engine.cache.jetcache.stamp.StampManager
containKey, create, create, create, lock, lock, lockAndRun, lockAndRun, put, put
-
Constructor Details
-
AccessLimitedStampManager
-
-
Method Details
-
getSecureProperties
-
nextStamp
-
calculateRemainingTime
计算剩余过期时间每次create或者put,缓存的过期时间都会被覆盖。(注意:Jetcache put 方法的参数名:expireAfterWrite)。 因为Jetcache没有Redis的incr之类的方法,那么每次放入Times值,都会更新过期时间,实际操作下来是变相的延长了过期时间。
- Parameters:
configuredDuration- 注解上配置的、且可以正常解析的Duration值expireKey- 时间标记存储Key值。- Returns:
- 还剩余的过期时间
Duration
-