Class DomainBaseThrottleConfiguration
- java.lang.Object
-
- org.apache.synapse.commons.throttle.core.impl.domainbase.DomainBaseThrottleConfiguration
-
- All Implemented Interfaces:
ThrottleConfiguration
public class DomainBaseThrottleConfiguration extends Object implements ThrottleConfiguration
Holds all the controlling policy parameter for all domain names
-
-
Constructor Summary
Constructors Constructor Description DomainBaseThrottleConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCallerConfiguration(CallerConfiguration configuration)
To add a DomainBaseCallerConfigurationCallerConfiguration
getCallerConfiguration(String ID)
To get a DomainBaseCallerConfiguration - if a configuration for given key found ,it returns , other wise , the default configuration will return.String
getConfigurationKeyOfCaller(String callerID)
To get key for caller configuration if there is a configuration with callerID , it returns otherwise , on the first the ID contains one or more "." ,then recursively try to find the nearest root callerID.int
getType()
To get the type of the throttlestatic void
main(String[] args)
-
-
-
Method Detail
-
getCallerConfiguration
public CallerConfiguration getCallerConfiguration(String ID)
To get a DomainBaseCallerConfiguration - if a configuration for given key found ,it returns , other wise , the default configuration will return.- Specified by:
getCallerConfiguration
in interfaceThrottleConfiguration
- Parameters:
ID
- - The Remote caller id (domain name)- Returns:
- Returns the corresponding configuration for the caller with given ID
-
addCallerConfiguration
public void addCallerConfiguration(CallerConfiguration configuration)
To add a DomainBaseCallerConfiguration- Specified by:
addCallerConfiguration
in interfaceThrottleConfiguration
- Parameters:
configuration
- - The configuration of the caller
-
getConfigurationKeyOfCaller
public String getConfigurationKeyOfCaller(String callerID)
To get key for caller configuration if there is a configuration with callerID , it returns otherwise , on the first the ID contains one or more "." ,then recursively try to find the nearest root callerID. else if the ID doesn't contains ".", try to find a key with *.{ID} . Note : For valid ID , it should contain only zero or more "*." as a prefix. example: (if ID is a.a.a), check pattern *.a.a and a.a then *.*.a or *.a or a ) if ID a then check start with *.a- Specified by:
getConfigurationKeyOfCaller
in interfaceThrottleConfiguration
- Parameters:
callerID
- The id of the remote caller (callerID name)- Returns:
- String value -String representation of corrected epr-key for get configuration
-
getType
public int getType()
Description copied from interface:ThrottleConfiguration
To get the type of the throttle- Specified by:
getType
in interfaceThrottleConfiguration
- Returns:
- the type of the throttle
-
main
public static void main(String[] args)
-
-