Class Bucket4jBandwidthLimitProperties
java.lang.Object
org.apereo.cas.configuration.model.support.bucket4j.Bucket4jBandwidthLimitProperties
- All Implemented Interfaces:
Serializable
,CasFeatureModule
@RequiresModule(name="cas-server-support-bucket4j-core")
public class Bucket4jBandwidthLimitProperties
extends Object
implements CasFeatureModule, Serializable
This is
Bucket4jBandwidthLimitProperties
.- Since:
- 6.5.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Describe options available for refill strategy.Nested classes/interfaces inherited from interface org.apereo.cas.configuration.features.CasFeatureModule
CasFeatureModule.FeatureCatalog
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
Number of tokens/requests that can be used within the time window.Time window in which capacity can be allowed.long
By default initial size of bucket equals to capacity.long
The number of tokens that should be used to refill the bucket given the specified refill duration.Duration to use to refill the bucket.Describes how the bucket should be refilled.setCapacity
(long capacity) Number of tokens/requests that can be used within the time window.setDuration
(String duration) Time window in which capacity can be allowed.setInitialTokens
(long initialTokens) By default initial size of bucket equals to capacity.setRefillCount
(long refillCount) The number of tokens that should be used to refill the bucket given the specified refill duration.setRefillDuration
(String refillDuration) Duration to use to refill the bucket.Describes how the bucket should be refilled.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apereo.cas.configuration.features.CasFeatureModule
isDefined, isUndefined
-
Constructor Details
-
Bucket4jBandwidthLimitProperties
public Bucket4jBandwidthLimitProperties()
-
-
Method Details
-
getInitialTokens
public long getInitialTokens()By default initial size of bucket equals to capacity. But sometimes, you may want to have lesser initial size, for example for case of cold start in order to prevent denial of service. -
getCapacity
public long getCapacity()Number of tokens/requests that can be used within the time window. -
getRefillCount
public long getRefillCount()The number of tokens that should be used to refill the bucket given the specified refill duration. -
getDuration
Time window in which capacity can be allowed. -
getRefillDuration
Duration to use to refill the bucket. -
getRefillStrategy
Describes how the bucket should be refilled. Specifies the speed of tokens regeneration. -
setInitialTokens
By default initial size of bucket equals to capacity. But sometimes, you may want to have lesser initial size, for example for case of cold start in order to prevent denial of service.- Returns:
this
.
-
setCapacity
Number of tokens/requests that can be used within the time window.- Returns:
this
.
-
setRefillCount
The number of tokens that should be used to refill the bucket given the specified refill duration.- Returns:
this
.
-
setDuration
Time window in which capacity can be allowed.- Returns:
this
.
-
setRefillDuration
Duration to use to refill the bucket.- Returns:
this
.
-
setRefillStrategy
public Bucket4jBandwidthLimitProperties setRefillStrategy(Bucket4jBandwidthLimitProperties.BandwidthRefillStrategies refillStrategy) Describes how the bucket should be refilled. Specifies the speed of tokens regeneration.- Returns:
this
.
-