public class RequestMeta extends Object
| 构造器和说明 |
|---|
RequestMeta(long now,
String ip) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
enableRelive(long now) |
boolean |
equals(Object o) |
RequestMeta |
forbidden(List<Long> punishmentTime) |
Date |
getLastRequestTime() |
Date |
getReliveTime() |
List<Date> |
getRequestTimeList() |
int |
hashCode() |
boolean |
pushRequest(long now,
int maxRequests,
long window,
long minInterval) |
boolean |
pushRequest(long now,
LimitMeta limitMeta) |
void |
relive() |
boolean |
request(long now,
int maxRequests,
long window,
long minInterval) |
void |
setLastRequestTime(long lastRequestTime) |
String |
sinceLastTime() |
public RequestMeta(long now,
String ip)
public Date getReliveTime()
public void setLastRequestTime(long lastRequestTime)
public Date getLastRequestTime()
public boolean enableRelive(long now)
public void relive()
public RequestMeta forbidden(List<Long> punishmentTime)
public boolean pushRequest(long now,
int maxRequests,
long window,
long minInterval)
public boolean pushRequest(long now,
LimitMeta limitMeta)
public boolean request(long now,
int maxRequests,
long window,
long minInterval)
now - nowMillsmaxRequests - 请求限制最大次数window - 时间窗口minInterval - 最小请求间隔时间public String sinceLastTime()
Copyright © 2022. All rights reserved.