Module io.github.bucket4j.core
Interface ProxyManager<K>
-
- Type Parameters:
K- type of primary key
- All Known Implementing Classes:
AbstractCompareAndSwapBasedProxyManager,AbstractLockBasedProxyManager,AbstractProxyManager,AbstractSelectForUpdateBasedProxyManager
public interface ProxyManager<K>Represents an extension point of bucket4j library.ProxyManagerprovides API for building and managing the collection ofBucketProxyin backing storage. Typically an instance ofProxyManageris organized around RDBMS table, GRID cache, or some similarly isolated part of external storage. Primary keys are used to distinguish persisted state of different buckets.- See Also:
BucketProxy,AsyncProxyManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AsyncProxyManager<K>asAsync()Returns asynchronous API for this proxy manager.RemoteBucketBuilder<K>builder()Optional<BucketConfiguration>getProxyConfiguration(K key)Locates configuration of bucket which actually stored in the underlying storage.booleanisAsyncModeSupported()Describes whether or not this manager supports asynchronous API.voidremoveProxy(K key)Removes persisted state of bucket from underlying storage.
-
-
-
Method Detail
-
builder
RemoteBucketBuilder<K> builder()
-
getProxyConfiguration
Optional<BucketConfiguration> getProxyConfiguration(K key)
Locates configuration of bucket which actually stored in the underlying storage.- 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.
-
removeProxy
void removeProxy(K key)
Removes persisted state of bucket from underlying storage.- Parameters:
key- the primary key of bucket which state need to be removed from underlying storage.
-
isAsyncModeSupported
boolean isAsyncModeSupported()
Describes whether or not this manager supports asynchronous API. If this method returnsfalsethen any invocation ofasAsync()will throwUnsupportedOperationException.- Returns:
trueif this extension supports asynchronous API
-
asAsync
AsyncProxyManager<K> asAsync() throws UnsupportedOperationException
Returns asynchronous API for this proxy manager.- Returns:
- asynchronous API for this proxy manager.
- Throws:
UnsupportedOperationException- in case of this proxy manager does not support Async API.
-
-