Class CouchbaseCacheManager.CouchbaseCacheManagerBuilder
java.lang.Object
org.springframework.data.couchbase.cache.CouchbaseCacheManager.CouchbaseCacheManagerBuilder
- Enclosing class:
- CouchbaseCacheManager
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Create new instance ofCouchbaseCacheManagerwith configuration options applied.cacheDefaults(CouchbaseCacheConfiguration defaultCacheConfiguration) Define a defaultCouchbaseCacheConfigurationapplied to dynamically createdCouchbaseCaches.Disable in-flightCachecreation for unconfigured caches.fromCacheWriter(CouchbaseCacheWriter cacheWriter) Entry point for builder styleCouchbaseCacheManagerconfiguration.fromConnectionFactory(CouchbaseClientFactory clientFactory) Entry point for builder styleCouchbaseCacheManagerconfiguration.getCacheConfigurationFor(String cacheName) Get theCouchbaseCacheConfigurationfor a given cache by its name.Get theSetof cache names for which the builder holdsconfiguration.initialCacheNames(Set<String> cacheNames) Append aSetof cache names to be pre initialized with currentCouchbaseCacheConfiguration.EnableCouchbaseCaches to synchronize cache put/evict operations with ongoing Spring-managed transactions.withCacheConfiguration(String cacheName, CouchbaseCacheConfiguration cacheConfiguration) withInitialCacheConfigurations(Map<String, CouchbaseCacheConfiguration> cacheConfigurations) Append aMapof cache name/CouchbaseCacheConfigurationpairs to be pre initialized.
-
Method Details
-
fromConnectionFactory
public static CouchbaseCacheManager.CouchbaseCacheManagerBuilder fromConnectionFactory(CouchbaseClientFactory clientFactory) Entry point for builder styleCouchbaseCacheManagerconfiguration.- Parameters:
clientFactory- must not be null.- Returns:
- new
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
fromCacheWriter
public static CouchbaseCacheManager.CouchbaseCacheManagerBuilder fromCacheWriter(CouchbaseCacheWriter cacheWriter) Entry point for builder styleCouchbaseCacheManagerconfiguration.- Parameters:
cacheWriter- must not be null.- Returns:
- new
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
cacheDefaults
public CouchbaseCacheManager.CouchbaseCacheManagerBuilder cacheDefaults(CouchbaseCacheConfiguration defaultCacheConfiguration) Define a defaultCouchbaseCacheConfigurationapplied to dynamically createdCouchbaseCaches.- Parameters:
defaultCacheConfiguration- must not be null.- Returns:
- this
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
transactionAware
EnableCouchbaseCaches to synchronize cache put/evict operations with ongoing Spring-managed transactions.- Returns:
- this
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
initialCacheNames
Append aSetof cache names to be pre initialized with currentCouchbaseCacheConfiguration. NOTE: This calls depends oncacheDefaults(CouchbaseCacheConfiguration)using whatever defaultCouchbaseCacheConfigurationis present at the time of invoking this method.- Parameters:
cacheNames- must not be null.- Returns:
- this
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
withInitialCacheConfigurations
public CouchbaseCacheManager.CouchbaseCacheManagerBuilder withInitialCacheConfigurations(Map<String, CouchbaseCacheConfiguration> cacheConfigurations) Append aMapof cache name/CouchbaseCacheConfigurationpairs to be pre initialized.- Parameters:
cacheConfigurations- must not be null.- Returns:
- this
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
withCacheConfiguration
public CouchbaseCacheManager.CouchbaseCacheManagerBuilder withCacheConfiguration(String cacheName, CouchbaseCacheConfiguration cacheConfiguration) - Parameters:
cacheName-cacheConfiguration-- Returns:
- this
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
disableCreateOnMissingCache
Disable in-flightCachecreation for unconfigured caches.CouchbaseCacheManager.getMissingCache(String)returns null for any unconfiguredCacheinstead of a newCouchbaseCacheinstance. This allows eg.CompositeCacheManagerto chime in.- Returns:
- this
CouchbaseCacheManager.CouchbaseCacheManagerBuilder.
-
getConfiguredCaches
Get theSetof cache names for which the builder holdsconfiguration.- Returns:
- an unmodifiable
Setholding the name of caches for which aconfigurationhas been set.
-
getCacheConfigurationFor
Get theCouchbaseCacheConfigurationfor a given cache by its name.- Parameters:
cacheName- must not be null.- Returns:
Optional.empty()if noCouchbaseCacheConfigurationset for the given cache name.
-
build
Create new instance ofCouchbaseCacheManagerwith configuration options applied.- Returns:
- new instance of
CouchbaseCacheManager.
-