public class ClientConfig extends Object
Constructor and Description |
---|
ClientConfig() |
ClientConfig(ClientConfig config) |
public ClientConfig()
public ClientConfig(ClientConfig config)
public static ClientConfig load()
ClientConfig
object from an external configuration file.
It tries to load Hazelcast Client configuration from a list of well-known locations. When no location contains Hazelcast Client configuration then it returns default.
Note that the same mechanism is used when calling
HazelcastClient.newHazelcastClient()
.
public void setConfigPatternMatcher(ConfigPatternMatcher configPatternMatcher)
MatchingPointConfigPatternMatcher
is used.configPatternMatcher
- the pattern matcherIllegalArgumentException
- if the pattern matcher is null
public ConfigPatternMatcher getConfigPatternMatcher()
MatchingPointConfigPatternMatcher
is used.public String getProperty(String name)
name
- property namepublic ClientConfig setProperty(String name, String value)
name
- property namevalue
- value of the propertyClientConfig
for chainingpublic Properties getProperties()
Properties
objectProperties
objectpublic ClientConfig setProperties(Properties properties)
properties
- Properties
objectClientConfig
for chainingpublic ClientSecurityConfig getSecurityConfig()
ClientSecurityConfig
objectClientSecurityConfig
ClientSecurityConfig
public ClientConfig setSecurityConfig(ClientSecurityConfig securityConfig)
ClientSecurityConfig
objectsecurityConfig
- ClientSecurityConfig
to be setClientConfig
for chainingClientSecurityConfig
public ClientNetworkConfig getNetworkConfig()
ClientNetworkConfig
ClientNetworkConfig
ClientNetworkConfig
public ClientConfig setNetworkConfig(ClientNetworkConfig networkConfig)
ClientNetworkConfig
networkConfig
- ClientNetworkConfig
to be setClientConfig
for chainingClientNetworkConfig
public ClientConfig addReliableTopicConfig(ClientReliableTopicConfig reliableTopicConfig)
reliableTopicConfig
- the ClientReliableTopicConfig to addClientConfig
for chainingpublic ClientReliableTopicConfig getReliableTopicConfig(String name)
name
- the name of the reliable topic@Deprecated public ClientConfig addNearCacheConfig(String name, NearCacheConfig nearCacheConfig)
addNearCacheConfig(NearCacheConfig)
name
- name of the IMap / ICache that Near Cache config will be applied tonearCacheConfig
- nearCacheConfigClientConfig
for chainingpublic ClientConfig addNearCacheConfig(NearCacheConfig nearCacheConfig)
nearCacheConfig
- NearCacheConfig
ClientConfig
for chainingNearCacheConfig
public ClientConfig addListenerConfig(ListenerConfig listenerConfig)
listenerConfig
- ListenerConfigClientConfig
for chainingListenerConfig
public ClientConfig addProxyFactoryConfig(ProxyFactoryConfig proxyFactoryConfig)
ProxyFactoryConfig
proxyFactoryConfig
- ProxyFactoryConfig
ClientConfig
for chainingProxyFactoryConfig
public NearCacheConfig getNearCacheConfig(String name)
NearCacheConfig
configured for the map / cache with namename
- name of the map / cacheNearCacheConfig
NearCacheConfig
public Map<String,NearCacheConfig> getNearCacheConfigMap()
NearCacheConfig
public ClientConfig setNearCacheConfigMap(Map<String,NearCacheConfig> nearCacheConfigMap)
NearCacheConfig
's with the provided mapnearCacheConfigMap
- map of (name, NearCacheConfig
)ClientConfig
for chainingpublic Map<String,ClientFlakeIdGeneratorConfig> getFlakeIdGeneratorConfigMap()
FlakeIdGenerator
configurations,
mapped by config name. The config name may be a pattern with which the
configuration was initially obtained.public ClientFlakeIdGeneratorConfig findFlakeIdGeneratorConfig(String name)
ClientFlakeIdGeneratorConfig
configuration for the given flake ID generator name.
The name is matched by pattern to the configuration and by stripping the
partition ID qualifier from the given name
.
If there is no config found by the name, it will return the configuration
with the name "default"
.
name
- name of the flake ID generator configConfigurationException
- if ambiguous configurations are foundStringPartitioningStrategy.getBaseName(java.lang.String)
,
setConfigPatternMatcher(ConfigPatternMatcher)
,
getConfigPatternMatcher()
public ClientFlakeIdGeneratorConfig getFlakeIdGeneratorConfig(String name)
ClientFlakeIdGeneratorConfig
for the given name, creating
one if necessary and adding it to the collection of known configurations.
The configuration is found by matching the the configuration name
pattern to the provided name
without the partition qualifier
(the part of the name after '@'
).
If no configuration matches, it will create one by cloning the
"default"
configuration and add it to the configuration
collection.
This method is intended to easily and fluently create and add
configurations more specific than the default configuration without
explicitly adding it by invoking addFlakeIdGeneratorConfig(ClientFlakeIdGeneratorConfig)
.
Because it adds new configurations if they are not already present, this method is intended to be used before this config is used to create a hazelcast instance. Afterwards, newly added configurations may be ignored.
name
- name of the flake ID generator configConfigurationException
- if ambiguous configurations are foundStringPartitioningStrategy.getBaseName(java.lang.String)
,
setConfigPatternMatcher(ConfigPatternMatcher)
,
getConfigPatternMatcher()
public ClientConfig addFlakeIdGeneratorConfig(ClientFlakeIdGeneratorConfig config)
config
- the flake ID configurationpublic ClientConfig setFlakeIdGeneratorConfigMap(Map<String,ClientFlakeIdGeneratorConfig> map)
FlakeIdGenerator
configurations,
mapped by config name. The config name may be a pattern with which the
configuration will be obtained in the future.map
- the FlakeIdGenerator configuration map to setpublic ClientConfig setReliableTopicConfigMap(Map<String,ClientReliableTopicConfig> map)
ClientReliableTopicConfig
,
mapped by config name. The config name may be a pattern with which the
configuration will be obtained in the future.map
- the FlakeIdGenerator configuration map to setpublic Map<String,ClientReliableTopicConfig> getReliableTopicConfigMap()
@Deprecated public boolean isSmartRouting()
ClientNetworkConfig.isSmartRouting()
instead@Deprecated public ClientConfig setSmartRouting(boolean smartRouting)
ClientNetworkConfig.setSmartRouting(boolean)
instead@Deprecated public SocketInterceptorConfig getSocketInterceptorConfig()
ClientNetworkConfig.getSocketInterceptorConfig()
instead@Deprecated public ClientConfig setSocketInterceptorConfig(SocketInterceptorConfig socketInterceptorConfig)
@Deprecated public int getConnectionAttemptPeriod()
ClientNetworkConfig.getConnectionAttemptPeriod()
instead@Deprecated public ClientConfig setConnectionAttemptPeriod(int connectionAttemptPeriod)
@Deprecated public int getConnectionAttemptLimit()
ClientNetworkConfig.getConnectionAttemptLimit()
instead@Deprecated public ClientConfig setConnectionAttemptLimit(int connectionAttemptLimit)
@Deprecated public int getConnectionTimeout()
ClientNetworkConfig.getConnectionTimeout()
instead@Deprecated public ClientConfig setConnectionTimeout(int connectionTimeout)
ClientNetworkConfig.setConnectionTimeout(int)
insteadpublic Credentials getCredentials()
Credentials
Credentials
Credentials
public ClientConfig setCredentials(Credentials credentials)
Credentials
credentials
- Credentials
ClientConfig
for chaining@Deprecated public ClientConfig addAddress(String... addresses)
@Deprecated public ClientConfig setAddresses(List<String> addresses)
@Deprecated public List<String> getAddresses()
ClientNetworkConfig.getAddresses()
insteadpublic GroupConfig getGroupConfig()
GroupConfig
GroupConfig
GroupConfig
public ClientConfig setGroupConfig(GroupConfig groupConfig)
GroupConfig
groupConfig
- GroupConfig
ClientConfig
for chainingpublic List<ListenerConfig> getListenerConfigs()
ListenerConfig
'sListenerConfig
ListenerConfig
public ClientConfig setListenerConfigs(List<ListenerConfig> listenerConfigs)
ListenerConfig
'slistenerConfigs
- list of ListenerConfig
ClientConfig
for chainingListenerConfig
public LoadBalancer getLoadBalancer()
LoadBalancer
public ClientConfig setLoadBalancer(LoadBalancer loadBalancer)
LoadBalancer
loadBalancer
- LoadBalancer
ClientConfig
for chainingLoadBalancer
@Deprecated public boolean isRedoOperation()
ClientNetworkConfig.isRedoOperation()
instead@Deprecated public ClientConfig setRedoOperation(boolean redoOperation)
ClientNetworkConfig.setRedoOperation(boolean)
instead@Deprecated public SocketOptions getSocketOptions()
ClientNetworkConfig.getSocketOptions()
instead@Deprecated public ClientConfig setSocketOptions(SocketOptions socketOptions)
public ClassLoader getClassLoader()
public ClientConfig setClassLoader(ClassLoader classLoader)
classLoader
- ClientConfig
for chainingpublic ManagedContext getManagedContext()
ManagedContext
ManagedContext
ManagedContext
public ClientConfig setManagedContext(ManagedContext managedContext)
ManagedContext
managedContext
- ManagedContext
ClientConfig
for chainingManagedContext
public int getExecutorPoolSize()
public ClientConfig setExecutorPoolSize(int executorPoolSize)
executorPoolSize
- pool sizeClientConfig
for chainingpublic List<ProxyFactoryConfig> getProxyFactoryConfigs()
ProxyFactoryConfig
ProxyFactoryConfig
ProxyFactoryConfig
public ClientConfig setProxyFactoryConfigs(List<ProxyFactoryConfig> proxyFactoryConfigs)
ProxyFactoryConfig
proxyFactoryConfigs
- list to assignClientConfig
for chainingpublic SerializationConfig getSerializationConfig()
SerializationConfig
SerializationConfig
public ClientConfig setSerializationConfig(SerializationConfig serializationConfig)
SerializationConfig
serializationConfig
- SerializationConfigClientConfig
for chainingSerializationConfig
public NativeMemoryConfig getNativeMemoryConfig()
public ClientConfig setNativeMemoryConfig(NativeMemoryConfig nativeMemoryConfig)
public String getLicenseKey()
public ClientConfig setLicenseKey(String licenseKey)
public ClientConfig addQueryCacheConfig(String mapName, QueryCacheConfig queryCacheConfig)
public Map<String,Map<String,QueryCacheConfig>> getQueryCacheConfigs()
public void setQueryCacheConfigs(Map<String,Map<String,QueryCacheConfig>> queryCacheConfigs)
public String getInstanceName()
public void setInstanceName(String instanceName)
public ClientConnectionStrategyConfig getConnectionStrategyConfig()
public ClientConfig setConnectionStrategyConfig(ClientConnectionStrategyConfig connectionStrategyConfig)
public ClientUserCodeDeploymentConfig getUserCodeDeploymentConfig()
public ClientConfig setUserCodeDeploymentConfig(ClientUserCodeDeploymentConfig userCodeDeploymentConfig)
userCodeDeploymentConfig
- ClientConfig
for chainingpublic QueryCacheConfig getOrCreateQueryCacheConfig(String mapName, String cacheName)
mapName
- The name of the map for which the query cache config is to be returned.cacheName
- The name of the query cache.public QueryCacheConfig getOrNullQueryCacheConfig(String mapName, String cacheName)
mapName
- The name of the map for which the query cache config is to be returned.cacheName
- The name of the query cache.public ClientConfig addLabel(String label)
Client
availablelabel
- The label to be added.ClientConfig
for chainingpublic ClientConfig setLabels(Set<String> labels)
labels
- The labels to be setClientConfig
for chainingpublic ClientConfig setUserContext(ConcurrentMap<String,Object> userContext)
public ConcurrentMap<String,Object> getUserContext()
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.