Module io.github.bucket4j.core
Class GetAvailableTokensCommand
- java.lang.Object
-
- io.github.bucket4j.distributed.remote.commands.GetAvailableTokensCommand
-
- All Implemented Interfaces:
RemoteCommand<Long>,ComparableByContent<GetAvailableTokensCommand>
public class GetAvailableTokensCommand extends Object implements RemoteCommand<Long>, ComparableByContent<GetAvailableTokensCommand>
-
-
Field Summary
Fields Modifier and Type Field Description static SerializationHandle<GetAvailableTokensCommand>SERIALIZATION_HANDLE
-
Constructor Summary
Constructors Constructor Description GetAvailableTokensCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequalsByContent(GetAvailableTokensCommand other)longestimateTokensToConsume()CommandResult<Long>execute(MutableBucketEntry mutableEntry, long currentTimeNanos)longgetConsumedTokens(Long result)VersiongetRequiredVersion()SerializationHandlegetSerializationHandle()booleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.github.bucket4j.distributed.remote.RemoteCommand
asVerbose, isInitializationCommand
-
-
-
-
Field Detail
-
SERIALIZATION_HANDLE
public static final SerializationHandle<GetAvailableTokensCommand> SERIALIZATION_HANDLE
-
-
Method Detail
-
execute
public CommandResult<Long> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
- Specified by:
executein interfaceRemoteCommand<Long>
-
getSerializationHandle
public SerializationHandle getSerializationHandle()
- Specified by:
getSerializationHandlein interfaceRemoteCommand<Long>
-
equalsByContent
public boolean equalsByContent(GetAvailableTokensCommand other)
- Specified by:
equalsByContentin interfaceComparableByContent<GetAvailableTokensCommand>
-
isImmediateSyncRequired
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)- Specified by:
isImmediateSyncRequiredin interfaceRemoteCommand<Long>
-
estimateTokensToConsume
public long estimateTokensToConsume()
- Specified by:
estimateTokensToConsumein interfaceRemoteCommand<Long>
-
getConsumedTokens
public long getConsumedTokens(Long result)
- Specified by:
getConsumedTokensin interfaceRemoteCommand<Long>
-
getRequiredVersion
public Version getRequiredVersion()
- Specified by:
getRequiredVersionin interfaceRemoteCommand<Long>
-
-