public static class RedisCacheManager.RedisCacheManagerBuilder extends Object
RedisCacheManager
.public static RedisCacheManager.RedisCacheManagerBuilder fromConnectionFactory(RedisConnectionFactory connectionFactory)
RedisCacheManager
configuration.connectionFactory
- must not be null.RedisCacheManager.RedisCacheManagerBuilder
.public static RedisCacheManager.RedisCacheManagerBuilder fromCacheWriter(RedisCacheWriter cacheWriter)
RedisCacheManager
configuration.cacheWriter
- must not be null.RedisCacheManager.RedisCacheManagerBuilder
.public RedisCacheManager.RedisCacheManagerBuilder cacheDefaults(RedisCacheConfiguration defaultCacheConfiguration)
RedisCacheConfiguration
applied to dynamically created RedisCache
s.defaultCacheConfiguration
- must not be null.RedisCacheManager.RedisCacheManagerBuilder
.public RedisCacheManager.RedisCacheManagerBuilder cacheWriter(RedisCacheWriter cacheWriter)
RedisCacheWriter
.cacheWriter
- must not be null.RedisCacheManager.RedisCacheManagerBuilder
.public RedisCacheManager.RedisCacheManagerBuilder transactionAware()
RedisCache
s to synchronize cache put/evict operations with ongoing Spring-managed transactions.RedisCacheManager.RedisCacheManagerBuilder
.public RedisCacheManager.RedisCacheManagerBuilder initialCacheNames(Set<String> cacheNames)
Set
of cache names to be pre initialized with current RedisCacheConfiguration
.
NOTE: This calls depends on cacheDefaults(RedisCacheConfiguration)
using whatever
default RedisCacheConfiguration
is present at the time of invoking this method.cacheNames
- must not be null.RedisCacheManager.RedisCacheManagerBuilder
.public RedisCacheManager.RedisCacheManagerBuilder withInitialCacheConfigurations(Map<String,RedisCacheConfiguration> cacheConfigurations)
Map
of cache name/RedisCacheConfiguration
pairs to be pre initialized.cacheConfigurations
- must not be null.RedisCacheManager.RedisCacheManagerBuilder
.public RedisCacheManager.RedisCacheManagerBuilder withCacheConfiguration(String cacheName, RedisCacheConfiguration cacheConfiguration)
cacheName
- cacheConfiguration
- RedisCacheManager.RedisCacheManagerBuilder
.public RedisCacheManager.RedisCacheManagerBuilder disableCreateOnMissingCache()
Cache
creation for unconfigured caches.
RedisCacheManager.getMissingCache(String)
returns null for any unconfigured
Cache
instead of a new RedisCache
instance. This allows eg.
CompositeCacheManager
to chime in.RedisCacheManager.RedisCacheManagerBuilder
.public Set<String> getConfiguredCaches()
Set
of cache names for which the builder holds configuration
.Set
holding the name of caches for which a configuration
has been set.public Optional<RedisCacheConfiguration> getCacheConfigurationFor(String cacheName)
RedisCacheConfiguration
for a given cache by its name.cacheName
- must not be null.Optional.empty()
if no RedisCacheConfiguration
set for the given cache name.public RedisCacheManager.RedisCacheManagerBuilder enableStatistics()
public RedisCacheManager build()
RedisCacheManager
with configuration options applied.RedisCacheManager
.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.