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
Fields Modifier and Type Field Description static SerializationHandle<CheckConfigurationVersionAndExecuteCommand<?>>SERIALIZATION_HANDLE
-
Constructor Summary
Constructors Constructor Description CheckConfigurationVersionAndExecuteCommand(RemoteCommand<T> targetCommand, long desiredConfigurationVersion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequalsByContent(CheckConfigurationVersionAndExecuteCommand<?> other)longestimateTokensToConsume()CommandResult<T>execute(MutableBucketEntry mutableEntry, long currentTimeNanos)longgetConsumedTokens(T result)longgetDesiredConfigurationVersion()VersiongetRequiredVersion()SerializationHandle<RemoteCommand<?>>getSerializationHandle()RemoteCommand<T>getTargetCommand()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<CheckConfigurationVersionAndExecuteCommand<?>> SERIALIZATION_HANDLE
-
-
Constructor Detail
-
CheckConfigurationVersionAndExecuteCommand
public CheckConfigurationVersionAndExecuteCommand(RemoteCommand<T> targetCommand, long desiredConfigurationVersion)
-
-
Method Detail
-
getTargetCommand
public RemoteCommand<T> getTargetCommand()
-
getDesiredConfigurationVersion
public long getDesiredConfigurationVersion()
-
execute
public CommandResult<T> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
- Specified by:
executein interfaceRemoteCommand<T>
-
getSerializationHandle
public SerializationHandle<RemoteCommand<?>> getSerializationHandle()
- Specified by:
getSerializationHandlein interfaceRemoteCommand<T>
-
equalsByContent
public boolean equalsByContent(CheckConfigurationVersionAndExecuteCommand<?> other)
- 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
public long getConsumedTokens(T result)
- Specified by:
getConsumedTokensin interfaceRemoteCommand<T>
-
getRequiredVersion
public Version getRequiredVersion()
- Specified by:
getRequiredVersionin interfaceRemoteCommand<T>
-
-