Module io.github.bucket4j.core
Class CreateInitialStateAndExecuteCommand<T>
java.lang.Object
io.github.bucket4j.distributed.remote.commands.CreateInitialStateAndExecuteCommand<T>
- All Implemented Interfaces:
RemoteCommand<T>,ComparableByContent<CreateInitialStateAndExecuteCommand>
public class CreateInitialStateAndExecuteCommand<T>
extends Object
implements RemoteCommand<T>, ComparableByContent<CreateInitialStateAndExecuteCommand>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SerializationHandle<CreateInitialStateAndExecuteCommand> -
Constructor Summary
ConstructorsConstructorDescriptionCreateInitialStateAndExecuteCommand(BucketConfiguration configuration, RemoteCommand<T> targetCommand) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongexecute(MutableBucketEntry mutableEntry, long currentTimeNanos) longgetConsumedTokens(T result) booleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) booleanMethods 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, isMerged, mergeInto, toMergedCommand, unwrapOneResult
-
Field Details
-
SERIALIZATION_HANDLE
-
-
Constructor Details
-
CreateInitialStateAndExecuteCommand
public CreateInitialStateAndExecuteCommand(BucketConfiguration configuration, RemoteCommand<T> targetCommand)
-
-
Method Details
-
execute
- Specified by:
executein interfaceRemoteCommand<T>
-
getConfiguration
-
getTargetCommand
-
isInitializationCommand
public boolean isInitializationCommand()- Specified by:
isInitializationCommandin 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>
-