public abstract class ThrottleContext extends Object
Constructor and Description |
---|
ThrottleContext(ThrottleConfiguration throttleConfiguration,
ThrottleReplicator throttleReplicator)
default constructor – expects a throttle configuration.
|
Modifier and Type | Method and Description |
---|---|
void |
addAndFlushCallerContext(CallerContext callerContext,
String id)
To add the caller and replicates the states of the given caller
|
void |
addCallerContext(CallerContext callerContext,
String id)
setting callerContext - put callersMap against time and
put time against remote caller id (ip/domain)
|
void |
cleanupCallers(long time)
This method will clean up callers which has next access time below from provided time
This will first check the prohibited period and then it will check next access time lesser than unit time before a
cleanup a caller
|
void |
flushCallerContext(CallerContext callerContext,
String id)
To replicates the states of the already exist caller
|
CallerContext |
getCallerContext(String id)
To get the runtime states of a remote caller
|
org.apache.axis2.context.ConfigurationContext |
getConfigurationContext() |
ThrottleConfiguration |
getThrottleConfiguration()
To get the ThrottleConfiguration
|
String |
getThrottleId() |
abstract int |
getType() |
void |
processCleanList(long time)
/**
processing cleaning list- only process callerContexts which unit time already had over
|
void |
removeAndDestroyShareParamsOfCaller(String id)
Removes the caller and destroy shared params of caller
|
void |
removeAndFlushCaller(String id)
Removes the caller and replicate the states
|
void |
removeCallerContext(String id)
removing a caller with a given id - caller will remove from clean list
|
void |
replicateTimeWindow(String id)
Replicate the time window of this caller
|
void |
setConfigurationContext(org.apache.axis2.context.ConfigurationContext configurationContext) |
void |
setThrottleId(String throttleId) |
public ThrottleContext(ThrottleConfiguration throttleConfiguration, ThrottleReplicator throttleReplicator)
throttleConfiguration
- - configuration data according to the policypublic ThrottleConfiguration getThrottleConfiguration()
public CallerContext getCallerContext(String id)
id
- the remote caller id ex: domain , ippublic void addCallerContext(CallerContext callerContext, String id)
callerContext
- - The remote caller's runtime data.id
- - The id of the remote callerpublic void removeCallerContext(String id)
id
- Caller IDpublic void processCleanList(long time)
time
- - the current System TimeThrottleException
public void setThrottleId(String throttleId)
public String getThrottleId()
public org.apache.axis2.context.ConfigurationContext getConfigurationContext()
public void setConfigurationContext(org.apache.axis2.context.ConfigurationContext configurationContext)
public abstract int getType()
public void addAndFlushCallerContext(CallerContext callerContext, String id)
callerContext
- The states of the callerid
- The id of the callerpublic void flushCallerContext(CallerContext callerContext, String id)
callerContext
- The states of the callerid
- The id of the remote callerpublic void removeAndFlushCaller(String id)
id
- The Id of the callerpublic void removeAndDestroyShareParamsOfCaller(String id)
id
- The Id of the callerpublic void replicateTimeWindow(String id)
id
- public void cleanupCallers(long time)
time
- to clean up the caller contextsCopyright © 2005–2018 Apache Software Foundation. All rights reserved.