Module io.github.bucket4j.core
Interface RemoteCommand<T>
- All Known Implementing Classes:
AddTokensCommand,CheckConfigurationVersionAndExecuteCommand,ConsumeAsMuchAsPossibleCommand,ConsumeIgnoringRateLimitsCommand,CreateInitialStateAndExecuteCommand,CreateInitialStateWithVersionOrReplaceConfigurationAndExecuteCommand,CreateSnapshotCommand,EstimateAbilityToConsumeCommand,ForceAddTokensCommand,GetAvailableTokensCommand,GetConfigurationCommand,MultiCommand,ReplaceConfigurationCommand,ReserveAndCalculateTimeToSleepCommand,ResetCommand,SyncCommand,TryConsumeAndReturnRemainingTokensCommand,TryConsumeCommand,VerboseCommand
public interface RemoteCommand<T>
-
Method Summary
Modifier and TypeMethodDescriptiondefault VerboseCommand<T>default booleancanBeMerged(RemoteCommand<?> another) static <I> RemoteCommand<?>deserialize(DeserializationAdapter<I> adapter, I input) longexecute(MutableBucketEntry mutableEntry, long currentTimeNanos) static RemoteCommand<?>fromJsonCompatibleSnapshot(Map<String, Object> snapshot) longgetConsumedTokens(T result) default intbooleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) default booleandefault booleanisMerged()default voidmergeInto(RemoteCommand<?> mergedCommand) static <O> voidserialize(SerializationAdapter<O> adapter, O output, RemoteCommand<?> command, Version backwardCompatibilityVersion, Scope scope) toJsonCompatibleSnapshot(RemoteCommand<?> command, Version backwardCompatibilityVersion, Scope scope) default RemoteCommand<?>default CommandResult<?>unwrapOneResult(T result, int indice)
-
Method Details
-
execute
-
asVerbose
-
isInitializationCommand
default boolean isInitializationCommand() -
canBeMerged
-
mergeInto
-
toMergedCommand
-
isMerged
default boolean isMerged() -
unwrapOneResult
-
getMergedCommandsCount
default int getMergedCommandsCount() -
getSerializationHandle
SerializationHandle<RemoteCommand<?>> getSerializationHandle() -
isImmediateSyncRequired
boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync) -
estimateTokensToConsume
long estimateTokensToConsume() -
getConsumedTokens
-
getRequiredVersion
Version getRequiredVersion() -
serialize
static <O> void serialize(SerializationAdapter<O> adapter, O output, RemoteCommand<?> command, Version backwardCompatibilityVersion, Scope scope) throws IOException - Throws:
IOException
-
deserialize
static <I> RemoteCommand<?> deserialize(DeserializationAdapter<I> adapter, I input) throws IOException - Throws:
IOException
-
fromJsonCompatibleSnapshot
- Throws:
IOException
-
toJsonCompatibleSnapshot
static Map<String,Object> toJsonCompatibleSnapshot(RemoteCommand<?> command, Version backwardCompatibilityVersion, Scope scope) throws IOException - Throws:
IOException
-