K
- type of keypublic interface ProxyManager<K extends Serializable>
getProxy
method,
so it is not necessary to cache results of its invocation.Modifier and Type | Method and Description |
---|---|
Optional<Bucket> |
getProxy(K key)
Locates proxy to bucket which actually stored outside current JVM.
|
default Bucket |
getProxy(K key,
BucketConfiguration configuration)
Provides light-weight proxy to bucket which actually stored outside current JVM.
|
Bucket |
getProxy(K key,
Supplier<BucketConfiguration> configurationLazySupplier)
Provides light-weight proxy to bucket which actually stored outside current JVM.
|
Optional<BucketConfiguration> |
getProxyConfiguration(K key)
Locates configuration of bucket which actually stored outside current JVM.
|
default Bucket getProxy(K key, BucketConfiguration configuration)
Use this method if you use same configuration for all buckets(it can be easy stored as constant), or configuration is very cheap to create.
key
- the unique identifier used to point to the bucket in external storage.configuration
- this configuration will be used to initialize bucket if it is not initialized beforeBucket getProxy(K key, Supplier<BucketConfiguration> configurationLazySupplier)
Use this method in case of different configurations for each bucket and configuration is very expensive to create.
key
- the unique identifier used to point to the bucket in external storage.configurationLazySupplier
- supplier for configuration which can be called to build bucket configuration,
if and only if first invocation of any method on proxy detects that bucket absents in remote storage,
in this case provide configuration will be used to instantiate and persist the missed bucket.Optional<Bucket> getProxy(K key)
key
- the unique identifier used to point to the bucket in external storage.Optional<BucketConfiguration> getProxyConfiguration(K key)
key
- the unique identifier used to point to the bucket in external storage.Copyright © 2020. All rights reserved.