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
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default VerboseCommand<T>asVerbose()static <I> RemoteCommand<?>deserialize(DeserializationAdapter<I> adapter, I input)longestimateTokensToConsume()CommandResult<T>execute(MutableBucketEntry mutableEntry, long currentTimeNanos)static RemoteCommand<?>fromJsonCompatibleSnapshot(Map<String,Object> snapshot)longgetConsumedTokens(T result)VersiongetRequiredVersion()SerializationHandle<RemoteCommand<?>>getSerializationHandle()booleanisImmediateSyncRequired(long unsynchronizedTokens, long nanosSinceLastSync)default booleanisInitializationCommand()static <O> voidserialize(SerializationAdapter<O> adapter, O output, RemoteCommand<?> command, Version backwardCompatibilityVersion, Scope scope)static Map<String,Object>toJsonCompatibleSnapshot(RemoteCommand<?> command, Version backwardCompatibilityVersion, Scope scope)
-
-
-
Method Detail
-
execute
CommandResult<T> execute(MutableBucketEntry mutableEntry, long currentTimeNanos)
-
asVerbose
default VerboseCommand<T> asVerbose()
-
isInitializationCommand
default boolean isInitializationCommand()
-
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
-
-