Class RemoteBucketState

java.lang.Object
io.github.bucket4j.distributed.remote.RemoteBucketState
All Implemented Interfaces:
ComparableByContent<RemoteBucketState>

public class RemoteBucketState extends Object implements ComparableByContent<RemoteBucketState>
  • Field Details

  • Constructor Details

  • 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

      public BucketState copyBucketState()
    • replaceConfiguration

      public void replaceConfiguration(BucketConfiguration newConfiguration, TokensInheritanceStrategy tokensInheritanceStrategy, long currentTimeNanos)
    • getConfiguration

      public BucketConfiguration getConfiguration()
    • getRemoteStat

      public RemoteStat getRemoteStat()
    • getState

      public BucketState getState()
    • getConfigurationVersion

      public Long getConfigurationVersion()
    • setConfigurationVersion

      public void setConfigurationVersion(Long configurationVersion)
    • equalsByContent

      public boolean equalsByContent(RemoteBucketState other)
      Specified by:
      equalsByContent in interface ComparableByContent<RemoteBucketState>
    • copy

      public RemoteBucketState copy()
    • toString

      public String toString()
      Overrides:
      toString in class Object