public abstract class AbstractCountStampManager extends AbstractStampManager<String,Long>
Description: 计数类型的缓存
这里的泛型使用了 Long 主要是为了兼顾存储 System.currentTimeMillis()。否则类型不一致,还要建两个 Stamp
| 构造器和说明 |
|---|
AbstractCountStampManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
counting(String identity,
int maxTimes)
在缓存有效期内进行计数
|
int |
counting(String identity,
int maxTimes,
Duration expire)
在缓存有效期内进行计数
|
int |
counting(String identity,
int maxTimes,
Duration expire,
boolean useMd5)
在缓存有效期内进行计数
|
int |
counting(String identity,
int maxTimes,
Duration expire,
boolean useMd5,
String function)
在缓存有效期内进行计数
|
int |
counting(String identity,
int maxTimes,
Duration expire,
String function)
在缓存有效期内进行计数
|
check, delete, get, getCache, getExpire, lock, lockAndRun, put, setExpireclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainKey, create, create, create, lock, lock, lockAndRun, lockAndRun, nextStamp, put, putpublic int counting(String identity, int maxTimes) throws MaximumLimitExceededException
identity - 缓存 Key 的区分标识maxTimes - 允许的最大限制次数MaximumLimitExceededException - 超出最大限制次数错误public int counting(String identity, int maxTimes, Duration expire) throws MaximumLimitExceededException
identity - 缓存 Key 的区分标识maxTimes - 允许的最大限制次数expire - 过期时间MaximumLimitExceededException - 超出最大限制次数错误public int counting(String identity, int maxTimes, Duration expire, String function) throws MaximumLimitExceededException
identity - 缓存 Key 的区分标识maxTimes - 允许的最大限制次数expire - 过期时间function - 用于在日志中区分是哪个功能在调用。MaximumLimitExceededException - 超出最大限制次数错误public int counting(String identity, int maxTimes, Duration expire, boolean useMd5) throws MaximumLimitExceededException
identity - 缓存 Key 的区分标识maxTimes - 允许的最大限制次数expire - 过期时间useMd5 - 是否用 MD5 对区分标识进行混淆加密MaximumLimitExceededException - 超出最大限制次数错误public int counting(String identity, int maxTimes, Duration expire, boolean useMd5, String function) throws MaximumLimitExceededException
identity - 缓存 Key 的区分标识maxTimes - 允许的最大限制次数expire - 过期时间useMd5 - 是否用 MD5 对区分标识进行混淆加密function - 用于在日志中区分是哪个功能在调用。MaximumLimitExceededException - 超出最大限制次数错误Copyright © 2022. All rights reserved.