| java.lang.Object org.apache.roller.util.GenericThrottle
GenericThrottle | public class GenericThrottle (Code) | | A tool used to provide throttling support.
The basic idea is that if the # of hits from a client within a certain
interval of time is greater than the threshold value then the client is
considered to be abusive.
|
Constructor Summary | |
public | GenericThrottle(int thresh, int inter, int maxEntries) |
Method Summary | |
public boolean | isAbusive(String clientId) Check the current status of a client. | public boolean | processHit(String clientId) Process a new hit from the client. |
GenericThrottle | public GenericThrottle(int thresh, int inter, int maxEntries)(Code) | | |
isAbusive | public boolean isAbusive(String clientId)(Code) | | Check the current status of a client.
A client is considered abusive if the number of hits from the client
within the configured interval is greater than the set threshold.
|
processHit | public boolean processHit(String clientId)(Code) | | Process a new hit from the client.
Each call to this method increments the hit count for the client and
then returns a boolean value indicating if the hit has pushed the client
over the threshold.
|
|
|