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
-
-
-
Method Detail
-
execute
CommandResult<T> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
-
asVerbose
default VerboseCommand<T> asVerbose()
-
isInitializationCommand
default boolean isInitializationCommand()
-
canBeMerged
default boolean canBeMerged(RemoteCommand<?> another)
-
mergeInto
default void mergeInto(RemoteCommand<?> mergedCommand)
-
toMergedCommand
default RemoteCommand<?> toMergedCommand()
-
isMerged
default boolean isMerged()
-
unwrapOneResult
default CommandResult<?> unwrapOneResult(T result, int indice)
-
getMergedCommandsCount
default int getMergedCommandsCount()
-
getSerializationHandle
SerializationHandle<RemoteCommand<?>> getSerializationHandle()
-
isImmediateSyncRequired
boolean isImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)
-
estimateTokensToConsume
long estimateTokensToConsume()
-
getConsumedTokens
long getConsumedTokens(T result)
-
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
static RemoteCommand<?> fromJsonCompatibleSnapshot(Map<String,Object> snapshot) throws IOException
- Throws:
IOException
-
toJsonCompatibleSnapshot
static Map<String,Object> toJsonCompatibleSnapshot(RemoteCommand<?> command, Version backwardCompatibilityVersion, Scope scope) throws IOException
- Throws:
IOException
-
-