org.infinispan.client.hotrod.configuration
Class ConfigurationBuilder

java.lang.Object
  extended by 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.RemoteCacheManager(Configuration) constructor.

Since:
5.3
Author:
Tristan Tarrant

Constructor Summary
ConfigurationBuilder()
           
 
Method Summary
 ServerConfigurationBuilder addServer()
          Adds a new remote server
 ConfigurationBuilder addServers(String servers)
          Adds a list of remote servers in the form: host1[:port][;host2[:port]]...
 ExecutorFactoryConfigurationBuilder asyncExecutorFactory()
          Configuration for the executor service used for asynchronous work on the Transport, including asynchronous marshalling and Cache 'async operations' such as Cache.putAsync().
 ConfigurationBuilder balancingStrategy(Class<? extends RequestBalancingStrategy> balancingStrategy)
          For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.
 ConfigurationBuilder balancingStrategy(String balancingStrategy)
          For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.
 Configuration build()
          Builds a configuration object
 Configuration build(boolean validate)
           
 ConfigurationBuilder classLoader(ClassLoader cl)
           
 ConnectionPoolConfigurationBuilder connectionPool()
          Configures the connection pool
 ConfigurationBuilder connectionTimeout(int connectionTimeout)
          This property defines the maximum socket connect timeout before giving up connecting to the server.
 ConfigurationBuilder consistentHashImpl(int version, Class<? extends ConsistentHash> consistentHashClass)
          Defines the ConsistentHash implementation to use for the specified version.
 ConfigurationBuilder consistentHashImpl(int version, String consistentHashClass)
          Defines the ConsistentHash implementation to use for the specified version.
 Configuration create()
          Create the configuration bean
 ConfigurationBuilder forceReturnValues(boolean forceReturnValues)
          Whether or not to implicitly FORCE_RETURN_VALUE for all calls.
 ConfigurationBuilder keySizeEstimate(int keySizeEstimate)
          This hint allows sizing of byte buffers when serializing and deserializing keys, to minimize array resizing.
 ConfigurationBuilder marshaller(Class<? extends Marshaller> marshaller)
          Allows you to specify a custom Marshaller implementation to serialize and deserialize user objects.
 ConfigurationBuilder marshaller(Marshaller marshaller)
          Allows you to specify an instance of Marshaller to serialize and deserialize user objects.
 ConfigurationBuilder marshaller(String marshaller)
          Allows you to specify a custom Marshaller implementation to serialize and deserialize user objects.
 ConfigurationBuilder pingOnStartup(boolean pingOnStartup)
          If true, a ping request is sent to a back end server in order to fetch cluster's topology.
 ConfigurationBuilder protocolVersion(String protocolVersion)
          This property defines the protocol version that this client should use.
 ConfigurationBuilder read(Configuration template)
          Reads the configuration from an already created configuration bean into this builder.
 ConfigurationBuilder socketTimeout(int socketTimeout)
          This property defines the maximum socket read timeout in milliseconds before giving up waiting for bytes from the server.
 SslConfigurationBuilder ssl()
          SSL Configuration
 ConfigurationBuilder tcpNoDelay(boolean tcpNoDelay)
          Affects TCP NODELAY on the TCP stack.
 ConfigurationBuilder transportFactory(Class<? extends TransportFactory> transportFactory)
          Controls which transport to use.
 ConfigurationBuilder transportFactory(String transportFactory)
          Controls which transport to use.
 void validate()
          Validate the data in this builder before building the configuration bean
 ConfigurationBuilder valueSizeEstimate(int valueSizeEstimate)
          This hint allows sizing of byte buffers when serializing and deserializing values, to minimize array resizing.
 ConfigurationBuilder withProperties(Properties properties)
          Configures this builder using the specified properties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationBuilder

public ConfigurationBuilder()
Method Detail

addServer

public ServerConfigurationBuilder addServer()
Description copied from interface: ConfigurationChildBuilder
Adds a new remote server

Specified by:
addServer in interface ConfigurationChildBuilder

addServers

public ConfigurationBuilder addServers(String servers)
Description copied from interface: ConfigurationChildBuilder
Adds a list of remote servers in the form: host1[:port][;host2[:port]]...

Specified by:
addServers in interface ConfigurationChildBuilder

asyncExecutorFactory

public ExecutorFactoryConfigurationBuilder asyncExecutorFactory()
Description copied from interface: ConfigurationChildBuilder
Configuration for the executor service used for asynchronous work on the Transport, including asynchronous marshalling and Cache 'async operations' such as Cache.putAsync().

Specified by:
asyncExecutorFactory in interface ConfigurationChildBuilder

balancingStrategy

public ConfigurationBuilder balancingStrategy(String balancingStrategy)
Description copied from interface: ConfigurationChildBuilder
For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.

Specified by:
balancingStrategy in interface ConfigurationChildBuilder

balancingStrategy

public ConfigurationBuilder balancingStrategy(Class<? extends RequestBalancingStrategy> balancingStrategy)
Description copied from interface: ConfigurationChildBuilder
For replicated (vs distributed) Hot Rod server clusters, the client balances requests to the servers according to this strategy.

Specified by:
balancingStrategy in interface ConfigurationChildBuilder

classLoader

public ConfigurationBuilder classLoader(ClassLoader cl)
Specified by:
classLoader in interface ConfigurationChildBuilder
Returns:

connectionPool

public ConnectionPoolConfigurationBuilder connectionPool()
Description copied from interface: ConfigurationChildBuilder
Configures the connection pool

Specified by:
connectionPool in interface ConfigurationChildBuilder

connectionTimeout

public ConfigurationBuilder connectionTimeout(int connectionTimeout)
Description copied from interface: ConfigurationChildBuilder
This property defines the maximum socket connect timeout before giving up connecting to the server.

Specified by:
connectionTimeout in interface ConfigurationChildBuilder

consistentHashImpl

public ConfigurationBuilder consistentHashImpl(int version,
                                               Class<? extends ConsistentHash> consistentHashClass)
Description copied from interface: ConfigurationChildBuilder
Defines the ConsistentHash implementation to use for the specified version. By default, ConsistentHashV1 is used for version 1 and ConsistentHashV2 is used for version 2.

Specified by:
consistentHashImpl in interface ConfigurationChildBuilder

consistentHashImpl

public ConfigurationBuilder consistentHashImpl(int version,
                                               String consistentHashClass)
Description copied from interface: ConfigurationChildBuilder
Defines the ConsistentHash implementation to use for the specified version. By default, ConsistentHashV1 is used for version 1 and ConsistentHashV2 is used for version 2.

Specified by:
consistentHashImpl in interface ConfigurationChildBuilder

forceReturnValues

public ConfigurationBuilder forceReturnValues(boolean forceReturnValues)
Description copied from interface: ConfigurationChildBuilder
Whether or not to implicitly FORCE_RETURN_VALUE for all calls.

Specified by:
forceReturnValues in interface ConfigurationChildBuilder

keySizeEstimate

public ConfigurationBuilder keySizeEstimate(int keySizeEstimate)
Description copied from interface: ConfigurationChildBuilder
This hint allows sizing of byte buffers when serializing and deserializing keys, to minimize array resizing. It defaults to 64.

Specified by:
keySizeEstimate in interface ConfigurationChildBuilder

marshaller

public ConfigurationBuilder marshaller(String marshaller)
Description copied from interface: ConfigurationChildBuilder
Allows you to specify a custom Marshaller implementation to serialize and deserialize user objects. This method is mutually exclusive with ConfigurationChildBuilder.marshaller(Marshaller).

Specified by:
marshaller in interface ConfigurationChildBuilder

marshaller

public ConfigurationBuilder marshaller(Class<? extends Marshaller> marshaller)
Description copied from interface: ConfigurationChildBuilder
Allows you to specify a custom Marshaller implementation to serialize and deserialize user objects. This method is mutually exclusive with ConfigurationChildBuilder.marshaller(Marshaller).

Specified by:
marshaller in interface ConfigurationChildBuilder

marshaller

public ConfigurationBuilder marshaller(Marshaller marshaller)
Description copied from interface: ConfigurationChildBuilder
Allows you to specify an instance of Marshaller to serialize and deserialize user objects. This method is mutually exclusive with ConfigurationChildBuilder.marshaller(Class).

Specified by:
marshaller in interface ConfigurationChildBuilder

pingOnStartup

public ConfigurationBuilder pingOnStartup(boolean pingOnStartup)
Description copied from interface: ConfigurationChildBuilder
If true, a ping request is sent to a back end server in order to fetch cluster's topology.

Specified by:
pingOnStartup in interface ConfigurationChildBuilder

protocolVersion

public ConfigurationBuilder protocolVersion(String protocolVersion)
Description copied from interface: ConfigurationChildBuilder
This property defines the protocol version that this client should use. Defaults to 1.1. Other valid values include 1.0.

Specified by:
protocolVersion in interface ConfigurationChildBuilder

socketTimeout

public ConfigurationBuilder socketTimeout(int socketTimeout)
Description copied from interface: ConfigurationChildBuilder
This 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:
socketTimeout in interface ConfigurationChildBuilder

ssl

public SslConfigurationBuilder ssl()
Description copied from interface: ConfigurationChildBuilder
SSL Configuration

Specified by:
ssl in interface ConfigurationChildBuilder

tcpNoDelay

public ConfigurationBuilder tcpNoDelay(boolean tcpNoDelay)
Description copied from interface: ConfigurationChildBuilder
Affects TCP NODELAY on the TCP stack. Defaults to enabled

Specified by:
tcpNoDelay in interface ConfigurationChildBuilder

transportFactory

public ConfigurationBuilder transportFactory(String transportFactory)
Description copied from interface: ConfigurationChildBuilder
Controls which transport to use. Currently only the TcpTransport is supported.

Specified by:
transportFactory in interface ConfigurationChildBuilder

transportFactory

public ConfigurationBuilder transportFactory(Class<? extends TransportFactory> transportFactory)
Description copied from interface: ConfigurationChildBuilder
Controls which transport to use. Currently only the TcpTransport is supported.

Specified by:
transportFactory in interface ConfigurationChildBuilder

valueSizeEstimate

public ConfigurationBuilder valueSizeEstimate(int valueSizeEstimate)
Description copied from interface: ConfigurationChildBuilder
This hint allows sizing of byte buffers when serializing and deserializing values, to minimize array resizing. It defaults to 512

Specified by:
valueSizeEstimate in interface ConfigurationChildBuilder

withProperties

public ConfigurationBuilder withProperties(Properties properties)
Description copied from interface: ConfigurationChildBuilder
Configures this builder using the specified properties

Specified by:
withProperties in interface ConfigurationChildBuilder

validate

public void validate()
Description copied from interface: Builder
Validate the data in this builder before building the configuration bean

Specified by:
validate in interface Builder<Configuration>

create

public Configuration create()
Description copied from interface: Builder
Create the configuration bean

Specified by:
create in interface Builder<Configuration>
Returns:

build

public Configuration build()
Description copied from interface: ConfigurationChildBuilder
Builds a configuration object

Specified by:
build in interface ConfigurationChildBuilder

build

public Configuration build(boolean validate)

read

public ConfigurationBuilder read(Configuration 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 interface Builder<Configuration>
Parameters:
template - the configuration from which to "clone" this config if needed.

-->

Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.