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, and then applies overrides found in environment variables/system properties When no location contains Hazelcast Client configuration then it returns default.
Note that the same mechanism is used when calling
HazelcastClient.newHazelcastClient().
public ClientConfig setConfigPatternMatcher(ConfigPatternMatcher configPatternMatcher)
MatchingPointConfigPatternMatcher is used.configPatternMatcher - the pattern matcherIllegalArgumentException - if the pattern matcher is nullpublic 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 object which allows client credentials configuration.ClientSecurityConfig instancepublic ClientConfig setSecurityConfig(ClientSecurityConfig securityConfig)
ClientSecurityConfig objectsecurityConfig - ClientSecurityConfig to be setClientConfig for chainingClientSecurityConfigpublic ClientConfig setCredentials(Credentials credentials)
getSecurityConfig().setCredentials()credentials - Credentials instance to be setClientConfig for chainingpublic ClientNetworkConfig getNetworkConfig()
ClientNetworkConfigClientNetworkConfigClientNetworkConfigpublic ClientConfig setNetworkConfig(ClientNetworkConfig networkConfig)
ClientNetworkConfignetworkConfig - ClientNetworkConfig to be setClientConfig for chainingClientNetworkConfigpublic ClientConfig addReliableTopicConfig(ClientReliableTopicConfig reliableTopicConfig)
reliableTopicConfig - the ClientReliableTopicConfig to addClientConfig for chainingpublic ClientReliableTopicConfig getReliableTopicConfig(String name)
name - the name of the reliable topicpublic ClientConfig addNearCacheConfig(NearCacheConfig nearCacheConfig)
nearCacheConfig - NearCacheConfigClientConfig for chainingNearCacheConfigpublic ClientConfig addListenerConfig(ListenerConfig listenerConfig)
listenerConfig - ListenerConfigClientConfig for chainingListenerConfigpublic ClientConfig addProxyFactoryConfig(ProxyFactoryConfig proxyFactoryConfig)
ProxyFactoryConfigproxyFactoryConfig - ProxyFactoryConfigClientConfig for chainingProxyFactoryConfigpublic NearCacheConfig getNearCacheConfig(String name)
NearCacheConfig configured for the map / cache with namename - name of the map / cacheNearCacheConfigNearCacheConfigpublic Map<String,NearCacheConfig> getNearCacheConfigMap()
NearCacheConfigpublic 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 configInvalidConfigurationException - 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 configInvalidConfigurationException - 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()
public List<ListenerConfig> getListenerConfigs()
ListenerConfig'sListenerConfigListenerConfigpublic ClientConfig setListenerConfigs(List<ListenerConfig> listenerConfigs)
ListenerConfig'slistenerConfigs - list of ListenerConfigClientConfig for chainingListenerConfigpublic LoadBalancer getLoadBalancer()
LoadBalancerpublic ClientConfig setLoadBalancer(LoadBalancer loadBalancer)
LoadBalancer.
If a load balancer class name was set, it will be removed.
loadBalancer - LoadBalancerClientConfig for chainingLoadBalancerpublic String getLoadBalancerClassName()
LoadBalancerpublic ClientConfig setLoadBalancerClassName(@Nonnull String loadBalancerClassName)
If a load balancer implementation was set, it will be removed.
loadBalancerClassName - LoadBalancerClientConfig for chainingLoadBalancerpublic ClassLoader getClassLoader()
public ClientConfig setClassLoader(ClassLoader classLoader)
classLoader - the classLoaderClientConfig for chainingpublic ManagedContext getManagedContext()
ManagedContextManagedContextManagedContextpublic ClientConfig setManagedContext(ManagedContext managedContext)
ManagedContextmanagedContext - ManagedContextClientConfig for chainingManagedContextpublic List<ProxyFactoryConfig> getProxyFactoryConfigs()
ProxyFactoryConfigProxyFactoryConfigProxyFactoryConfigpublic ClientConfig setProxyFactoryConfigs(List<ProxyFactoryConfig> proxyFactoryConfigs)
ProxyFactoryConfigproxyFactoryConfigs - list to assignClientConfig for chainingpublic SerializationConfig getSerializationConfig()
SerializationConfigSerializationConfigpublic ClientConfig setSerializationConfig(SerializationConfig serializationConfig)
SerializationConfigserializationConfig - SerializationConfigClientConfig for chainingSerializationConfigpublic NativeMemoryConfig getNativeMemoryConfig()
public ClientConfig setNativeMemoryConfig(NativeMemoryConfig nativeMemoryConfig)
public ClientConfig addQueryCacheConfig(String mapName, QueryCacheConfig queryCacheConfig)
public Map<String,Map<String,QueryCacheConfig>> getQueryCacheConfigs()
public ClientConfig setQueryCacheConfigs(Map<String,Map<String,QueryCacheConfig>> queryCacheConfigs)
public String getInstanceName()
public ClientConfig setInstanceName(String instanceName)
public String getClusterName()
public ClientConfig setClusterName(String clusterName)
public ClientConnectionStrategyConfig getConnectionStrategyConfig()
public ClientConfig setConnectionStrategyConfig(ClientConnectionStrategyConfig connectionStrategyConfig)
public ClientUserCodeDeploymentConfig getUserCodeDeploymentConfig()
public ClientConfig setUserCodeDeploymentConfig(ClientUserCodeDeploymentConfig userCodeDeploymentConfig)
userCodeDeploymentConfig - the configuration of User Code DeploymentClientConfig 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()
public ClientConfig setBackupAckToClientEnabled(boolean backupAckToClientEnabled)
backupAckToClientEnabled - enables client to get backup acknowledgements directly from the member
that backups are appliedClientConfig for chainingpublic boolean isBackupAckToClientEnabled()
@Nonnull public ClientMetricsConfig getMetricsConfig()
@Nonnull public ClientConfig setMetricsConfig(@Nonnull ClientMetricsConfig metricsConfig)
@Nonnull public InstanceTrackingConfig getInstanceTrackingConfig()
@Nonnull public ClientConfig setInstanceTrackingConfig(@Nonnull InstanceTrackingConfig instanceTrackingConfig)
Copyright © 2021 Hazelcast, Inc.. All rights reserved.