com.nepxion.aquarius.limit.LimitExecutor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aquarius-limit-aop Show documentation
Show all versions of aquarius-limit-aop Show documentation
Nepxion Aquarius is a list of distribution components based on Redis + Zookeeper with Nepxion Matrix AOP framework
package com.nepxion.aquarius.limit;
/**
* Title: Nepxion Aquarius
* Description: Nepxion Aquarius
* Copyright: Copyright (c) 2017-2050
* Company: Nepxion
* @author Haojun Ren
* @version 1.0
*/
public interface LimitExecutor {
/**
* 在给定的时间段里最多的访问限制次数(超出次数返回false);等下个时间段开始,才允许再次被访问(返回true),周而复始
* @param name 资源名字
* @param key 资源Key
* @param limitPeriod 给定的时间段(单位秒)
* @param limitCount 最多的访问限制次数
* @return boolean
*/
boolean tryAccess(String name, String key, int limitPeriod, int limitCount) throws Exception;
boolean tryAccess(String compositeKey, int limitPeriod, int limitCount) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy