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 booleancanBeMerged(RemoteCommand<?> another)booleanequalsByContent(CheckConfigurationVersionAndExecuteCommand<?> other)longestimateTokensToConsume()CommandResult<T>execute(MutableBucketEntry mutableEntry, long currentTimeNanos)longgetConsumedTokens(T result)longgetDesiredConfigurationVersion()intgetMergedCommandsCount()VersiongetRequiredVersion()SerializationHandle<RemoteCommand<?>>getSerializationHandle()RemoteCommand<T>getTargetCommand()booleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)booleanisMerged()voidmergeInto(RemoteCommand<?> mergedCommand)RemoteCommand<?>toMergedCommand()CommandResult<?>unwrapOneResult(T result, int indice)-
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
-
canBeMerged
public boolean canBeMerged(RemoteCommand<?> another)
- Specified by:
canBeMergedin interfaceRemoteCommand<T>
-
toMergedCommand
public RemoteCommand<?> toMergedCommand()
- Specified by:
toMergedCommandin interfaceRemoteCommand<T>
-
mergeInto
public void mergeInto(RemoteCommand<?> mergedCommand)
- Specified by:
mergeIntoin interfaceRemoteCommand<T>
-
isMerged
public boolean isMerged()
- Specified by:
isMergedin interfaceRemoteCommand<T>
-
getMergedCommandsCount
public int getMergedCommandsCount()
- Specified by:
getMergedCommandsCountin interfaceRemoteCommand<T>
-
unwrapOneResult
public CommandResult<?> unwrapOneResult(T result, int indice)
- Specified by:
unwrapOneResultin interfaceRemoteCommand<T>
-
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>
-
-