Class RemoteCacheConfigurationBuilder
- java.lang.Object
-
- org.infinispan.client.hotrod.configuration.RemoteCacheConfigurationBuilder
-
- All Implemented Interfaces:
Builder<RemoteCacheConfiguration>
public class RemoteCacheConfigurationBuilder extends Object implements Builder<RemoteCacheConfiguration>
Per-cache configuration.- Since:
- 11.0
- Author:
- Tristan Tarrant <tristan@infinispan.org>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description RemoteCacheConfigurationBuilder
configuration(String configuration)
Specifies the declarative configuration to be used to create the cache if it doesn't already exist on the server.RemoteCacheConfigurationBuilder
configurationURI(URI uri)
Specifies a URI pointing to the declarative configuration to be used to create the cache if it doesn't already exist on the server.RemoteCacheConfiguration
create()
Create the configuration beanRemoteCacheConfigurationBuilder
forceReturnValues(boolean forceReturnValues)
Whether or not to implicitly FORCE_RETURN_VALUE for all calls to this cache.RemoteCacheConfigurationBuilder
marshaller(Class<? extends Marshaller> marshallerClass)
Specifies a customMarshaller
implementation.RemoteCacheConfigurationBuilder
marshaller(String className)
Specifies a customMarshaller
implementation.RemoteCacheConfigurationBuilder
marshaller(Marshaller marshaller)
Specifies a customMarshaller
implementation to serialize and deserialize user objects.RemoteCacheConfigurationBuilder
nearCacheMaxEntries(int maxEntries)
Specifies the maximum number of entries that will be held in the near cache.RemoteCacheConfigurationBuilder
nearCacheMode(NearCacheMode mode)
Specifies the near caching mode.RemoteCacheConfigurationBuilder
nearCacheUseBloomFilter(boolean enable)
Specifies whether bloom filter should be used for near cache to limit the number of write notifications for unrelated keys.Builder<?>
read(RemoteCacheConfiguration template)
Reads the configuration from an already created configuration bean into this builder.RemoteCacheConfigurationBuilder
templateName(String templateName)
Specifies the name of a template to be used to create the cache if it doesn't already exist on the server.RemoteCacheConfigurationBuilder
templateName(DefaultTemplate template)
Specifies one of the default templates to be used to create the cache if it doesn't already exist on the server.RemoteCacheConfigurationBuilder
transactionManager(TransactionManager manager)
Deprecated.since 12.0.RemoteCacheConfigurationBuilder
transactionManagerLookup(org.infinispan.commons.tx.lookup.TransactionManagerLookup lookup)
TheTransactionManagerLookup
to lookup for theTransactionManager
to interact with.RemoteCacheConfigurationBuilder
transactionMode(TransactionMode mode)
TheTransactionMode
in which aRemoteCache
will be enlisted.void
validate()
Validate the data in this builder before building the configuration beanConfigurationBuilder
withProperties(Properties properties)
-
-
-
Method Detail
-
forceReturnValues
public RemoteCacheConfigurationBuilder forceReturnValues(boolean forceReturnValues)
Whether or not to implicitly FORCE_RETURN_VALUE for all calls to this cache.
-
nearCacheMode
public RemoteCacheConfigurationBuilder nearCacheMode(NearCacheMode mode)
Specifies the near caching mode. SeeNearCacheMode
for details on the available modes.- Parameters:
mode
- one ofNearCacheMode
- Returns:
- an instance of the builder
-
nearCacheMaxEntries
public RemoteCacheConfigurationBuilder nearCacheMaxEntries(int maxEntries)
Specifies the maximum number of entries that will be held in the near cache. Only works whennearCacheMode(NearCacheMode)
is notNearCacheMode.DISABLED
.- Parameters:
maxEntries
- maximum entries in the near cache.- Returns:
- an instance of the builder
-
nearCacheUseBloomFilter
public RemoteCacheConfigurationBuilder nearCacheUseBloomFilter(boolean enable)
Specifies whether bloom filter should be used for near cache to limit the number of write notifications for unrelated keys.- Parameters:
enable
- whether to enable bloom filter- Returns:
- an instance of this builder
-
configuration
public RemoteCacheConfigurationBuilder configuration(String configuration)
Specifies the declarative configuration to be used to create the cache if it doesn't already exist on the server.- Parameters:
configuration
- the XML representation of a cache configuration.- Returns:
- an instance of the builder
-
configurationURI
public RemoteCacheConfigurationBuilder configurationURI(URI uri)
Specifies a URI pointing to the declarative configuration to be used to create the cache if it doesn't already exist on the server.- Parameters:
uri
- the URI of the configuration.- Returns:
- an instance of the builder
-
templateName
public RemoteCacheConfigurationBuilder templateName(String templateName)
Specifies the name of a template to be used to create the cache if it doesn't already exist on the server.- Parameters:
templateName
- the name of the template.- Returns:
- an instance of the builder
-
templateName
public RemoteCacheConfigurationBuilder templateName(DefaultTemplate template)
Specifies one of the default templates to be used to create the cache if it doesn't already exist on the server.- Parameters:
template
- the template to use- Returns:
- an instance of the builder
-
transactionMode
public RemoteCacheConfigurationBuilder transactionMode(TransactionMode mode)
TheTransactionMode
in which aRemoteCache
will be enlisted.- Parameters:
mode
- the transaction mode- Returns:
- an instance of the builder
-
marshaller
public RemoteCacheConfigurationBuilder marshaller(String className)
Specifies a customMarshaller
implementation. Seemarshaller(Marshaller)
.- Parameters:
className
- Fully qualifies class name of the marshaller implementation.
-
marshaller
public RemoteCacheConfigurationBuilder marshaller(Class<? extends Marshaller> marshallerClass)
Specifies a customMarshaller
implementation. Seemarshaller(Marshaller)
.- Parameters:
marshallerClass
- the marshaller class.
-
marshaller
public RemoteCacheConfigurationBuilder marshaller(Marshaller marshaller)
Specifies a customMarshaller
implementation to serialize and deserialize user objects. Has precedence overmarshaller(Class)
andmarshaller(String)
. If not configured, the marshaller from theRemoteCacheManager
will be used for the cache operations.- Parameters:
marshaller
- the marshaller instance
-
transactionManager
@Deprecated public RemoteCacheConfigurationBuilder transactionManager(TransactionManager manager)
Deprecated.since 12.0. To be removed in Infinispan 14. UsetransactionManagerLookup(TransactionManagerLookup)
instead.TheTransactionManager
to use for the cache- Parameters:
manager
- an instance of a TransactionManager- Returns:
- an instance of the builder
-
transactionManagerLookup
public RemoteCacheConfigurationBuilder transactionManagerLookup(org.infinispan.commons.tx.lookup.TransactionManagerLookup lookup)
TheTransactionManagerLookup
to lookup for theTransactionManager
to interact with.- Parameters:
lookup
- ATransactionManagerLookup
instance.- Returns:
- An instance of the builder.
-
validate
public void validate()
Description copied from interface:Builder
Validate the data in this builder before building the configuration bean- Specified by:
validate
in interfaceBuilder<RemoteCacheConfiguration>
-
create
public RemoteCacheConfiguration create()
Description copied from interface:Builder
Create the configuration bean- Specified by:
create
in interfaceBuilder<RemoteCacheConfiguration>
- Returns:
-
read
public Builder<?> read(RemoteCacheConfiguration template)
Description copied from interface:Builder
Reads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
read
in interfaceBuilder<RemoteCacheConfiguration>
- Parameters:
template
- the configuration from which to "clone" this config if needed.
-
withProperties
public ConfigurationBuilder withProperties(Properties properties)
-
-