|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造函数 | 方法 | 详细信息: 字段 | 构造函数 | 方法 | |||||||||
java.lang.Objecttot.util.FloodControl
public class FloodControl
| 方法摘要 | |
|---|---|
static void |
ensureNotReachMaximum(java.lang.Integer action,
java.lang.String strIP)
This is a utility method to ensure that the action has not reached the mamximum. |
static int |
getActionsPerHour(java.lang.Integer action)
|
static void |
increaseCount(java.lang.Integer action,
java.lang.String strIP)
Increase the number of action. |
static boolean |
reachMaximum(java.lang.Integer action,
java.lang.String strIP)
Check that an action of an IP has reach the maximum number of allowed times |
static void |
resetActionHistory(java.lang.Integer action,
java.lang.String strIP)
Reset the action history. |
static void |
setOption(java.lang.Integer action,
int actionsPerHour)
To set the mamximum number of actions per hour for an action. |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法详细信息 |
|---|
public static void setOption(java.lang.Integer action,
int actionsPerHour)
action - Integer the action that want to set the optionactionsPerHour - int the maximum number of actions per hourpublic static int getActionsPerHour(java.lang.Integer action)
public static boolean reachMaximum(java.lang.Integer action,
java.lang.String strIP)
action - Integer the action to checkstrIP - String the IP to check
public static void ensureNotReachMaximum(java.lang.Integer action,
java.lang.String strIP)
throws FloodException
action - Integer the action to ensurestrIP - String the IP to ensure
FloodException - if it reached the maximumreachMaximum(Integer, String)
public static void increaseCount(java.lang.Integer action,
java.lang.String strIP)
action - Integer the action to increase the number of timesstrIP - String the IP to increase the number of times
public static void resetActionHistory(java.lang.Integer action,
java.lang.String strIP)
action - IntegerstrIP - String
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造函数 | 方法 | 详细信息: 字段 | 构造函数 | 方法 | |||||||||