Module io.github.bucket4j.core
Class AbstractProxyManager<K>
- java.lang.Object
-
- io.github.bucket4j.distributed.proxy.AbstractProxyManager<K>
-
- All Implemented Interfaces:
ProxyManager<K>
- Direct Known Subclasses:
AbstractCompareAndSwapBasedProxyManager,AbstractLockBasedProxyManager,AbstractSelectForUpdateBasedProxyManager
public abstract class AbstractProxyManager<K> extends Object implements ProxyManager<K>
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractProxyManager(ClientSideConfig clientSideConfig)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AsyncProxyManager<K>asAsync()Returns asynchronous API for this proxy manager.RemoteBucketBuilder<K>builder()protected abstract <T> CommandResult<T>execute(K key, Request<T> request)protected abstract <T> CompletableFuture<CommandResult<T>>executeAsync(K key, Request<T> request)protected VersiongetBackwardCompatibilityVersion()protected ClientSideConfiggetClientSideConfig()protected LonggetClientSideTime()Optional<BucketConfiguration>getProxyConfiguration(K key)Locates configuration of bucket which actually stored in the underlying storage.protected abstract CompletableFuture<Void>removeAsync(K key)-
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.proxy.ProxyManager
isAsyncModeSupported, removeProxy
-
-
-
-
Constructor Detail
-
AbstractProxyManager
protected AbstractProxyManager(ClientSideConfig clientSideConfig)
-
-
Method Detail
-
asAsync
public AsyncProxyManager<K> asAsync()
Description copied from interface:ProxyManagerReturns asynchronous API for this proxy manager.- Specified by:
asAsyncin interfaceProxyManager<K>- Returns:
- asynchronous API for this proxy manager.
-
builder
public RemoteBucketBuilder<K> builder()
- Specified by:
builderin interfaceProxyManager<K>
-
getProxyConfiguration
public Optional<BucketConfiguration> getProxyConfiguration(K key)
Description copied from interface:ProxyManagerLocates configuration of bucket which actually stored in the underlying storage.- Specified by:
getProxyConfigurationin interfaceProxyManager<K>- Parameters:
key- the unique identifier used to point to the bucket in external storage.- Returns:
- Optional surround the configuration or empty optional if bucket with specified key is not stored.
-
execute
protected abstract <T> CommandResult<T> execute(K key, Request<T> request)
-
executeAsync
protected abstract <T> CompletableFuture<CommandResult<T>> executeAsync(K key, Request<T> request)
-
removeAsync
protected abstract CompletableFuture<Void> removeAsync(K key)
-
getClientSideConfig
protected ClientSideConfig getClientSideConfig()
-
getBackwardCompatibilityVersion
protected Version getBackwardCompatibilityVersion()
-
getClientSideTime
protected Long getClientSideTime()
-
-