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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongexecute(MutableBucketEntry mutableEntry, long currentTimeNanos) longgetConsumedTokens(Long result) booleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.github.bucket4j.distributed.remote.RemoteCommand
asVerbose, canBeMerged, getMergedCommandsCount, isInitializationCommand, isMerged, mergeInto, toMergedCommand, unwrapOneResult
-
Field Details
-
SERIALIZATION_HANDLE
-
-
Constructor Details
-
GetAvailableTokensCommand
public GetAvailableTokensCommand()
-
-
Method Details
-
execute
- Specified by:
executein interfaceRemoteCommand<Long>
-
getSerializationHandle
- Specified by:
getSerializationHandlein interfaceRemoteCommand<Long>
-
equalsByContent
- 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
- Specified by:
getConsumedTokensin interfaceRemoteCommand<Long>
-
getRequiredVersion
- Specified by:
getRequiredVersionin interfaceRemoteCommand<Long>
-