public abstract class CallerContext extends Object implements Serializable, Cloneable
| Constructor and Description |
|---|
CallerContext(String ID) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canAccess(ThrottleContext throttleContext,
CallerConfiguration configuration,
long currentTime)
Check whether that caller can access or not ,based on current state and pre-defined policy
|
void |
cleanUpCallers(CallerConfiguration configuration,
ThrottleContext throttleContext,
long currentTime)
Clean up the callers - remove all callers that have expired their time window
|
CallerContext |
clone() |
int |
getGlobalCounter() |
String |
getID() |
int |
getLocalCounter() |
long |
getNextTimeWindow()
Returns the next time window
|
abstract int |
getType()
Gets type of throttle that this caller belong ex : ip/domain
|
UUID |
getUuid() |
void |
incrementGlobalCounter(int incrementBy) |
void |
resetLocalCounter() |
void |
setGlobalCounter(int counter) |
public CallerContext(String ID)
public CallerContext clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic UUID getUuid()
public String getID()
public void cleanUpCallers(CallerConfiguration configuration, ThrottleContext throttleContext, long currentTime)
configuration - -The Configuration for this callerthrottleContext - -The Throttle that caller having passcurrentTime - -The system current timepublic boolean canAccess(ThrottleContext throttleContext, CallerConfiguration configuration, long currentTime) throws ThrottleException
throttleContext - -The Context for this caller - runtime stateconfiguration - -The Configuration for this caller - data from policycurrentTime - -The current system timeThrottleException - throws for invalid throttle configurationpublic long getNextTimeWindow()
public void incrementGlobalCounter(int incrementBy)
public int getGlobalCounter()
public void setGlobalCounter(int counter)
public int getLocalCounter()
public void resetLocalCounter()
public abstract int getType()
Copyright © 2005–2015 Apache Software Foundation. All rights reserved.