Class ConfigurationBuilder
java.lang.Object
org.infinispan.client.hotrod.configuration.ConfigurationBuilder
- All Implemented Interfaces:
ConfigurationChildBuilder,Builder<Configuration>
public class ConfigurationBuilder
extends Object
implements ConfigurationChildBuilder, Builder<Configuration>
ConfigurationBuilder used to generate immutable Configuration objects to pass to the
RemoteCacheManager(Configuration) constructor.
If you prefer to configure the client declaratively, see org.infinispan.client.hotrod.configuration
- Since:
- 5.3
- Author:
- Tristan Tarrant
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCluster(String clusterName) Adds a new remote server clusteraddContextInitializer(String contextInitializer) Supply aSerializationContextInitializerimplementation to register classes with theProtoStreamMarshaller'sSerializationContext.addContextInitializer(org.infinispan.protostream.SerializationContextInitializer contextInitializer) Supply aSerializationContextInitializerimplementation to register classes with theProtoStreamMarshaller'sSerializationContext.addContextInitializers(org.infinispan.protostream.SerializationContextInitializer... contextInitializers) Convenience method to supply multipleSerializationContextInitializerimplementations.addJavaSerialAllowList(String... regEx) List of regular expressions for classes that can be deserialized using standard Java deserialization when reading data that might have been stored with a different endpoint, e.g.addJavaSerialWhiteList(String... regEx) Deprecated, for removal: This API element is subject to removal in a future version.Adds a new remote serveraddServers(String servers) Adds a list of remote servers in the form: host1[:port][;host2[:port]]...Configuration for the executor service used for asynchronous work on the Transport, including asynchronous marshalling and Cache 'async operations' such as Cache.putAsync().balancingStrategy(Class<? extends FailoverRequestBalancingStrategy> balancingStrategy) For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.balancingStrategy(String balancingStrategy) For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.balancingStrategy(Supplier<FailoverRequestBalancingStrategy> balancingStrategyFactory) For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.batchSize(int batchSize) Sets the batch size of internal iterators (ie.build()Builds a configuration objectbuild(boolean validate) Specifies theClassLoaderused to find certain resources used by configuration when specified by name (e.g.clientIntelligence(ClientIntelligence clientIntelligence) Specifies the level of "intelligence" the client should haveConfigures the connection poolconnectionTimeout(int connectionTimeout) This property defines the maximum socket connect timeout in milliseconds before giving up connecting to the server.consistentHashImpl(int version, Class<? extends org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash> consistentHashClass) Defines theConsistentHashimplementation to use for the specified version.consistentHashImpl(int version, String consistentHashClass) Defines theConsistentHashimplementation to use for the specified version.create()Create the configuration beandnsResolverMaxTTL(int maxTTL) dnsResolverMinTTL(int minTTL) dnsResolverNegativeTTL(int negativeTTL) forceReturnValues(boolean forceReturnValues) Whether or not to implicitly FORCE_RETURN_VALUE for all calls.keySizeEstimate(int keySizeEstimate) Deprecated, for removal: This API element is subject to removal in a future version.Since 12.0, does nothing and will be removed in 15.0marshaller(Class<? extends Marshaller> marshallerClass) Allows you to specify a customMarshallerimplementation to serialize and deserialize user objects.marshaller(String marshallerClassName) Allows you to specify a customMarshallerimplementation to serialize and deserialize user objects.marshaller(Marshaller marshaller) Allows you to specify an instance ofMarshallerto serialize and deserialize user objects.maxRetries(int maxRetries) It sets the maximum number of retries for each request.Deprecated, for removal: This API element is subject to removal in a future version.since 11.0.static voidparseServers(String servers, BiConsumer<String, Integer> c) protocolVersion(String protocolVersion) Deprecated, for removal: This API element is subject to removal in a future version.Useversion(ProtocolVersion)instead.read(Configuration template) read(Configuration template, Combine combine) Reads the configuration from an already created configuration bean into this builder.remoteCache(String name) Per-cache configurationsecurity()Security Configurationservers()socketTimeout(int socketTimeout) This property defines the maximum socket read timeout in milliseconds before giving up waiting for bytes from the server.Configures client-side statistics.tcpKeepAlive(boolean keepAlive) Affects TCP KEEPALIVE on the TCP stack.tcpNoDelay(boolean tcpNoDelay) Affects TCP NODELAY on the TCP stack.Transaction configurationtransactionTimeout(long timeout, TimeUnit timeUnit) Sets the transaction's timeout.transportFactory(TransportFactory transportFactory) Set the TransportFactory.Configures this builder using the specified URI.Configures this builder using the specified URI.voidvalidate()Validate the data in this builder before building the configuration beanvalueSizeEstimate(int valueSizeEstimate) Deprecated, for removal: This API element is subject to removal in a future version.Since 12.0, does nothing and will be removed in 15.0version(ProtocolVersion protocolVersion) This property defines the protocol version that this client should use.withProperties(Properties properties) Configures this builder using the specified properties.
-
Constructor Details
-
ConfigurationBuilder
public ConfigurationBuilder()
-
-
Method Details
-
attributes
- Specified by:
attributesin interfaceBuilder<Configuration>
-
addServer
Description copied from interface:ConfigurationChildBuilderAdds a new remote server- Specified by:
addServerin interfaceConfigurationChildBuilder
-
addCluster
Description copied from interface:ConfigurationChildBuilderAdds a new remote server cluster- Specified by:
addClusterin interfaceConfigurationChildBuilder
-
addServers
Description copied from interface:ConfigurationChildBuilderAdds a list of remote servers in the form: host1[:port][;host2[:port]]...- Specified by:
addServersin interfaceConfigurationChildBuilder
-
servers
-
parseServers
-
asyncExecutorFactory
Description copied from interface:ConfigurationChildBuilderConfiguration for the executor service used for asynchronous work on the Transport, including asynchronous marshalling and Cache 'async operations' such as Cache.putAsync().- Specified by:
asyncExecutorFactoryin interfaceConfigurationChildBuilder
-
balancingStrategy
Description copied from interface:ConfigurationChildBuilderFor replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.- Specified by:
balancingStrategyin interfaceConfigurationChildBuilder
-
balancingStrategy
public ConfigurationBuilder balancingStrategy(Supplier<FailoverRequestBalancingStrategy> balancingStrategyFactory) Description copied from interface:ConfigurationChildBuilderFor replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.- Specified by:
balancingStrategyin interfaceConfigurationChildBuilder
-
balancingStrategy
public ConfigurationBuilder balancingStrategy(Class<? extends FailoverRequestBalancingStrategy> balancingStrategy) Description copied from interface:ConfigurationChildBuilderFor replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.- Specified by:
balancingStrategyin interfaceConfigurationChildBuilder
-
classLoader
Description copied from interface:ConfigurationChildBuilderSpecifies theClassLoaderused to find certain resources used by configuration when specified by name (e.g. certificate stores). Infinispan will search through the classloader which loaded this class, the system classloader and the TCCL classloader.- Specified by:
classLoaderin interfaceConfigurationChildBuilder
-
clientIntelligence
Description copied from interface:ConfigurationChildBuilderSpecifies the level of "intelligence" the client should have- Specified by:
clientIntelligencein interfaceConfigurationChildBuilder
-
connectionPool
Description copied from interface:ConfigurationChildBuilderConfigures the connection pool- Specified by:
connectionPoolin interfaceConfigurationChildBuilder
-
connectionTimeout
Description copied from interface:ConfigurationChildBuilderThis property defines the maximum socket connect timeout in milliseconds before giving up connecting to the server.- Specified by:
connectionTimeoutin interfaceConfigurationChildBuilder
-
consistentHashImpl
public ConfigurationBuilder consistentHashImpl(int version, Class<? extends org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash> consistentHashClass) Description copied from interface:ConfigurationChildBuilderDefines theConsistentHashimplementation to use for the specified version. By default,ConsistentHashV2is used for version 1 andConsistentHashV2is used for version 2.- Specified by:
consistentHashImplin interfaceConfigurationChildBuilder
-
consistentHashImpl
Description copied from interface:ConfigurationChildBuilderDefines theConsistentHashimplementation to use for the specified version. By default,ConsistentHashV2is used for version 1 andConsistentHashV2is used for version 2.- Specified by:
consistentHashImplin interfaceConfigurationChildBuilder
-
dnsResolverMinTTL
- Specified by:
dnsResolverMinTTLin interfaceConfigurationChildBuilder
-
dnsResolverMaxTTL
- Specified by:
dnsResolverMaxTTLin interfaceConfigurationChildBuilder
-
dnsResolverNegativeTTL
- Specified by:
dnsResolverNegativeTTLin interfaceConfigurationChildBuilder
-
forceReturnValues
Description copied from interface:ConfigurationChildBuilderWhether or not to implicitly FORCE_RETURN_VALUE for all calls.- Specified by:
forceReturnValuesin interfaceConfigurationChildBuilder
-
keySizeEstimate
Deprecated, for removal: This API element is subject to removal in a future version.Since 12.0, does nothing and will be removed in 15.0- Specified by:
keySizeEstimatein interfaceConfigurationChildBuilder
-
marshaller
Description copied from interface:ConfigurationChildBuilderAllows you to specify a customMarshallerimplementation to serialize and deserialize user objects. This method is mutually exclusive withConfigurationChildBuilder.marshaller(Marshaller).- Specified by:
marshallerin interfaceConfigurationChildBuilder
-
marshaller
Description copied from interface:ConfigurationChildBuilderAllows you to specify a customMarshallerimplementation to serialize and deserialize user objects. This method is mutually exclusive withConfigurationChildBuilder.marshaller(Marshaller).- Specified by:
marshallerin interfaceConfigurationChildBuilder
-
marshaller
Description copied from interface:ConfigurationChildBuilderAllows you to specify an instance ofMarshallerto serialize and deserialize user objects. This method is mutually exclusive withConfigurationChildBuilder.marshaller(Class).- Specified by:
marshallerin interfaceConfigurationChildBuilder
-
addContextInitializer
Description copied from interface:ConfigurationChildBuilderSupply aSerializationContextInitializerimplementation to register classes with theProtoStreamMarshaller'sSerializationContext.- Specified by:
addContextInitializerin interfaceConfigurationChildBuilder
-
addContextInitializer
public ConfigurationBuilder addContextInitializer(org.infinispan.protostream.SerializationContextInitializer contextInitializer) Description copied from interface:ConfigurationChildBuilderSupply aSerializationContextInitializerimplementation to register classes with theProtoStreamMarshaller'sSerializationContext.- Specified by:
addContextInitializerin interfaceConfigurationChildBuilder
-
addContextInitializers
public ConfigurationBuilder addContextInitializers(org.infinispan.protostream.SerializationContextInitializer... contextInitializers) Description copied from interface:ConfigurationChildBuilderConvenience method to supply multipleSerializationContextInitializerimplementations.- Specified by:
addContextInitializersin interfaceConfigurationChildBuilder
-
nearCache
Deprecated, for removal: This API element is subject to removal in a future version.since 11.0. To be removed in 14.0. UseRemoteCacheConfigurationBuilder.nearCacheMode(NearCacheMode)andRemoteCacheConfigurationBuilder.nearCacheMaxEntries(int)instead. -
protocolVersion
Deprecated, for removal: This API element is subject to removal in a future version.Useversion(ProtocolVersion)instead.Description copied from interface:ConfigurationChildBuilderThis property defines the protocol version that this client should use. Defaults to the latest protocol version supported by this client.- Specified by:
protocolVersionin interfaceConfigurationChildBuilder
-
version
Description copied from interface:ConfigurationChildBuilderThis property defines the protocol version that this client should use. Defaults to the latest protocol version supported by this client.- Specified by:
versionin interfaceConfigurationChildBuilder
-
security
Description copied from interface:ConfigurationChildBuilderSecurity Configuration- Specified by:
securityin interfaceConfigurationChildBuilder
-
socketTimeout
Description copied from interface:ConfigurationChildBuilderThis property defines the maximum socket read timeout in milliseconds before giving up waiting for bytes from the server. Defaults to 60000 (1 minute)- Specified by:
socketTimeoutin interfaceConfigurationChildBuilder
-
tcpNoDelay
Description copied from interface:ConfigurationChildBuilderAffects TCP NODELAY on the TCP stack. Defaults to enabled- Specified by:
tcpNoDelayin interfaceConfigurationChildBuilder
-
tcpKeepAlive
Description copied from interface:ConfigurationChildBuilderAffects TCP KEEPALIVE on the TCP stack. Defaults to disable- Specified by:
tcpKeepAlivein interfaceConfigurationChildBuilder
-
uri
Description copied from interface:ConfigurationChildBuilderConfigures this builder using the specified URI.- Specified by:
uriin interfaceConfigurationChildBuilder
-
uri
Description copied from interface:ConfigurationChildBuilderConfigures this builder using the specified URI.- Specified by:
uriin interfaceConfigurationChildBuilder
-
valueSizeEstimate
Deprecated, for removal: This API element is subject to removal in a future version.Since 12.0, does nothing and will be removed in 15.0- Specified by:
valueSizeEstimatein interfaceConfigurationChildBuilder
-
maxRetries
Description copied from interface:ConfigurationChildBuilderIt sets the maximum number of retries for each request. A valid value should be greater or equals than 0 (zero). Zero means no retry will made in case of a network failure. It defaults to 10.- Specified by:
maxRetriesin interfaceConfigurationChildBuilder
-
addJavaSerialAllowList
Description copied from interface:ConfigurationChildBuilderList of regular expressions for classes that can be deserialized using standard Java deserialization when reading data that might have been stored with a different endpoint, e.g. REST.- Specified by:
addJavaSerialAllowListin interfaceConfigurationChildBuilder
-
addJavaSerialWhiteList
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
addJavaSerialWhiteListin interfaceConfigurationChildBuilder
-
batchSize
Description copied from interface:ConfigurationChildBuilderSets the batch size of internal iterators (ie.keySet().iterator(). Defaults to 10_000- Specified by:
batchSizein interfaceConfigurationChildBuilder- Parameters:
batchSize- the batch size to set- Returns:
- this configuration builder with the batch size set
-
statistics
Description copied from interface:ConfigurationChildBuilderConfigures client-side statistics.- Specified by:
statisticsin interfaceConfigurationChildBuilder
-
transaction
Description copied from interface:ConfigurationChildBuilderTransaction configuration- Specified by:
transactionin interfaceConfigurationChildBuilder
-
remoteCache
Description copied from interface:ConfigurationChildBuilderPer-cache configuration- Specified by:
remoteCachein interfaceConfigurationChildBuilder- Parameters:
name- the name of the cache to which specific configuration should be applied. You may use wildcard globbing (e.g.cache-*) which will apply to any cache that matches.- Returns:
- the
RemoteCacheConfigurationBuilderfor the cache
-
transactionTimeout
Description copied from interface:ConfigurationChildBuilderSets the transaction's timeout.This timeout is used by the server to rollback unrecoverable transaction when they are idle for this amount of time.
An unrecoverable transaction are transaction enlisted as
Synchronization(TransactionMode.NON_XA) orXAResourcewithout recovery enabled (TransactionMode.NON_DURABLE_XA).For
XAResource, this value is overwritten byXAResource.setTransactionTimeout(int).It defaults to 1 minute.
- Specified by:
transactionTimeoutin interfaceConfigurationChildBuilder
-
transportFactory
Description copied from interface:ConfigurationChildBuilderSet the TransportFactory. It defaults toDefaultTransportFactory- Specified by:
transportFactoryin interfaceConfigurationChildBuilder- Parameters:
transportFactory- an instance ofTransportFactory
-
disableTracingPropagation
-
withProperties
Description copied from interface:ConfigurationChildBuilderConfigures this builder using the specified properties. SeeConfigurationBuilderfor a list.- Specified by:
withPropertiesin interfaceConfigurationChildBuilder
-
validate
public void validate()Description copied from interface:BuilderValidate the data in this builder before building the configuration bean- Specified by:
validatein interfaceBuilder<Configuration>
-
create
Description copied from interface:BuilderCreate the configuration bean- Specified by:
createin interfaceBuilder<Configuration>- Returns:
-
build
Description copied from interface:ConfigurationChildBuilderBuilds a configuration object- Specified by:
buildin interfaceConfigurationChildBuilder
-
build
-
read
Description copied from interface:BuilderReads the configuration from an already created configuration bean into this builder. Returns an appropriate builder to allow fluent configuration- Specified by:
readin interfaceBuilder<Configuration>- Parameters:
template- the configuration from which to "clone" this config if needed.combine- the way attributes and children of this instance and the template should be combined.
-
read
- Specified by:
readin interfaceBuilder<Configuration>
-