Module io.github.bucket4j.core
Class CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand<T>
- java.lang.Object
-
- io.github.bucket4j.distributed.remote.commands.CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand<T>
-
- All Implemented Interfaces:
RemoteCommand<T>,ComparableByContent<CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand>
public class CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand<T> extends Object implements RemoteCommand<T>, ComparableByContent<CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand>
-
-
Field Summary
Fields Modifier and Type Field Description static SerializationHandle<CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand<?>>SERIALIZATION_HANDLE
-
Constructor Summary
Constructors Constructor Description CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand(BucketConfiguration configuration, RemoteCommand<T> targetCommand, long desiredConfigurationVersion, TokensInheritanceStrategy tokensInheritanceStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequalsByContent(CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand other)longestimateTokensToConsume()CommandResult<T>execute(MutableBucketEntry mutableEntry, long currentTimeNanos)BucketConfigurationgetConfiguration()longgetConsumedTokens(T result)longgetDesiredConfigurationVersion()VersiongetRequiredVersion()SerializationHandlegetSerializationHandle()RemoteCommand<T>getTargetCommand()TokensInheritanceStrategygetTokensInheritanceStrategy()booleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)booleanisInitializationCommand()-
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, canBeMerged, getMergedCommandsCount, isMerged, mergeInto, toMergedCommand, unwrapOneResult
-
-
-
-
Field Detail
-
SERIALIZATION_HANDLE
public static SerializationHandle<CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand<?>> SERIALIZATION_HANDLE
-
-
Constructor Detail
-
CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand
public CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand(BucketConfiguration configuration, RemoteCommand<T> targetCommand, long desiredConfigurationVersion, TokensInheritanceStrategy tokensInheritanceStrategy)
-
-
Method Detail
-
execute
public CommandResult<T> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
- Specified by:
executein interfaceRemoteCommand<T>
-
getConfiguration
public BucketConfiguration getConfiguration()
-
getTargetCommand
public RemoteCommand<T> getTargetCommand()
-
getDesiredConfigurationVersion
public long getDesiredConfigurationVersion()
-
getTokensInheritanceStrategy
public TokensInheritanceStrategy getTokensInheritanceStrategy()
-
isInitializationCommand
public boolean isInitializationCommand()
- Specified by:
isInitializationCommandin interfaceRemoteCommand<T>
-
getSerializationHandle
public SerializationHandle getSerializationHandle()
- Specified by:
getSerializationHandlein interfaceRemoteCommand<T>
-
equalsByContent
public boolean equalsByContent(CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand 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>
-
-