Module io.github.bucket4j.core
Class RemoteBucketState
java.lang.Object
io.github.bucket4j.distributed.remote.RemoteBucketState
- All Implemented Interfaces:
ComparableByContent<RemoteBucketState>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRemoteBucketState(BucketState state, RemoteStat stat, Long configurationVersion) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTokens(long tokensToAdd) longcalculateDelayNanosAfterWillBePossibleToConsume(long tokensToConsume, long currentTimeNanos, boolean checkTokensToConsumeShouldBeLessThenCapacity) longcalculateFullRefillingTime(long currentTimeNanos) voidconsume(long tokensToConsume) copy()booleanequalsByContent(RemoteBucketState other) voidforceAddTokens(long tokensToAdd) longgetState()voidrefillAllBandwidth(long currentTimeNanos) voidreplaceConfiguration(BucketConfiguration newConfiguration, TokensInheritanceStrategy tokensInheritanceStrategy, long currentTimeNanos) voidreset()voidsetConfigurationVersion(Long configurationVersion) toString()
-
Field Details
-
SERIALIZATION_HANDLE
-
-
Constructor Details
-
RemoteBucketState
-
-
Method Details
-
refillAllBandwidth
public void refillAllBandwidth(long currentTimeNanos) -
getAvailableTokens
public long getAvailableTokens() -
consume
public void consume(long tokensToConsume) -
calculateFullRefillingTime
public long calculateFullRefillingTime(long currentTimeNanos) -
calculateDelayNanosAfterWillBePossibleToConsume
public long calculateDelayNanosAfterWillBePossibleToConsume(long tokensToConsume, long currentTimeNanos, boolean checkTokensToConsumeShouldBeLessThenCapacity) -
addTokens
public void addTokens(long tokensToAdd) -
forceAddTokens
public void forceAddTokens(long tokensToAdd) -
reset
public void reset() -
copyBucketState
-
replaceConfiguration
public void replaceConfiguration(BucketConfiguration newConfiguration, TokensInheritanceStrategy tokensInheritanceStrategy, long currentTimeNanos) -
getConfiguration
-
getRemoteStat
-
getState
-
getConfigurationVersion
-
setConfigurationVersion
-
equalsByContent
- Specified by:
equalsByContentin interfaceComparableByContent<RemoteBucketState>
-
copy
-
toString
-