Module io.github.bucket4j.core
Class CheckConfigurationVersionAndExecuteCommand<T>
java.lang.Object
io.github.bucket4j.distributed.remote.commands.CheckConfigurationVersionAndExecuteCommand<T>
- All Implemented Interfaces:
RemoteCommand<T>,ComparableByContent<CheckConfigurationVersionAndExecuteCommand<?>>
public class CheckConfigurationVersionAndExecuteCommand<T>
extends Object
implements RemoteCommand<T>, ComparableByContent<CheckConfigurationVersionAndExecuteCommand<?>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SerializationHandle<CheckConfigurationVersionAndExecuteCommand<?>> -
Constructor Summary
ConstructorsConstructorDescriptionCheckConfigurationVersionAndExecuteCommand(RemoteCommand<T> targetCommand, long desiredConfigurationVersion) -
Method Summary
Modifier and TypeMethodDescriptionbooleancanBeMerged(RemoteCommand<?> another) booleanlongexecute(MutableBucketEntry mutableEntry, long currentTimeNanos) longgetConsumedTokens(T result) longintbooleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) booleanisMerged()voidmergeInto(RemoteCommand<?> mergedCommand) unwrapOneResult(T result, int indice) 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, isInitializationCommand
-
Field Details
-
SERIALIZATION_HANDLE
public static final SerializationHandle<CheckConfigurationVersionAndExecuteCommand<?>> SERIALIZATION_HANDLE
-
-
Constructor Details
-
CheckConfigurationVersionAndExecuteCommand
public CheckConfigurationVersionAndExecuteCommand(RemoteCommand<T> targetCommand, long desiredConfigurationVersion)
-
-
Method Details
-
canBeMerged
- Specified by:
canBeMergedin interfaceRemoteCommand<T>
-
toMergedCommand
- Specified by:
toMergedCommandin interfaceRemoteCommand<T>
-
mergeInto
- Specified by:
mergeIntoin interfaceRemoteCommand<T>
-
isMerged
public boolean isMerged()- Specified by:
isMergedin interfaceRemoteCommand<T>
-
getMergedCommandsCount
public int getMergedCommandsCount()- Specified by:
getMergedCommandsCountin interfaceRemoteCommand<T>
-
unwrapOneResult
- Specified by:
unwrapOneResultin interfaceRemoteCommand<T>
-
getTargetCommand
-
getDesiredConfigurationVersion
public long getDesiredConfigurationVersion() -
execute
- Specified by:
executein interfaceRemoteCommand<T>
-
getSerializationHandle
- Specified by:
getSerializationHandlein interfaceRemoteCommand<T>
-
equalsByContent
- Specified by:
equalsByContentin interfaceComparableByContent<T>
-
isImmediateSyncRequired
public boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) - Specified by:
isImmediateSyncRequiredin interfaceRemoteCommand<T>
-
estimateTokensToConsume
public long estimateTokensToConsume()- Specified by:
estimateTokensToConsumein interfaceRemoteCommand<T>
-
getConsumedTokens
- Specified by:
getConsumedTokensin interfaceRemoteCommand<T>
-
getRequiredVersion
- Specified by:
getRequiredVersionin interfaceRemoteCommand<T>
-