public abstract class Bucket4JBaseConfiguration extends Object
Bucket4JAutoConfigurationServletFilter and
the Bucket4JAutoConfigurationZuul configuration classes| Constructor and Description |
|---|
Bucket4JBaseConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
FilterConfiguration |
buildFilterConfig(Bucket4JBootProperties.Bucket4JConfiguration config,
javax.cache.CacheManager cacheManager,
org.springframework.expression.ExpressionParser expressionParser,
org.springframework.beans.factory.BeanFactory beanFactory)
This method
|
Condition |
executeCondition(Bucket4JBootProperties.RateLimit rateLimit,
org.springframework.expression.ExpressionParser expressionParser,
org.springframework.beans.factory.BeanFactory beanFactory)
Creates the lambda for the execute condition which will be evaluated on each request.
|
KeyFilter |
getKeyFilter(String url,
Bucket4JBootProperties.RateLimit rateLimit,
org.springframework.expression.ExpressionParser expressionParser,
org.springframework.beans.factory.BeanFactory beanFactory)
Creates the key filter lambda which is responsible to decide how the rate limit will be performed.
|
javax.cache.Cache<String,io.github.bucket4j.grid.GridBucketState> |
jCache(String cacheName,
javax.cache.CacheManager cacheManager)
This methods
|
Condition |
skipCondition(Bucket4JBootProperties.RateLimit rateLimit,
org.springframework.expression.ExpressionParser expressionParser,
org.springframework.beans.factory.BeanFactory beanFactory)
Creates the lambda for the skip condition which will be evaluated on each request
|
public javax.cache.Cache<String,io.github.bucket4j.grid.GridBucketState> jCache(String cacheName, javax.cache.CacheManager cacheManager)
cacheName - the name of the cache to retrievecacheManager - public FilterConfiguration buildFilterConfig(Bucket4JBootProperties.Bucket4JConfiguration config, javax.cache.CacheManager cacheManager, org.springframework.expression.ExpressionParser expressionParser, org.springframework.beans.factory.BeanFactory beanFactory)
config - cacheManager - expressionParser - beanFactory - public KeyFilter getKeyFilter(String url, Bucket4JBootProperties.RateLimit rateLimit, org.springframework.expression.ExpressionParser expressionParser, org.springframework.beans.factory.BeanFactory beanFactory)
url - is used to generated a unique cache keyrateLimit - the Bucket4JBootProperties.RateLimit configuration which holds the skip condition stringexpressionParser - is used to evaluate the expression if the filter key type is EXPRESSION.beanFactory - used to get full access to all java beans in the SpElpublic Condition skipCondition(Bucket4JBootProperties.RateLimit rateLimit, org.springframework.expression.ExpressionParser expressionParser, org.springframework.beans.factory.BeanFactory beanFactory)
rateLimit - the Bucket4JBootProperties.RateLimit configuration which holds the skip condition stringexpressionParser - is used to evaluate the skip expressionbeanFactory - used to get full access to all java beans in the SpElpublic Condition executeCondition(Bucket4JBootProperties.RateLimit rateLimit, org.springframework.expression.ExpressionParser expressionParser, org.springframework.beans.factory.BeanFactory beanFactory)
rateLimit - the Bucket4JBootProperties.RateLimit configuration which holds the execute condition stringexpressionParser - is used to evaluate the execution expressionbeanFactory - used to get full access to all java beans in the SpElCopyright © 2017 Pivotal Software, Inc.. All rights reserved.