Class Config
- java.lang.Object
-
- com.hazelcast.config.Config
-
- Direct Known Subclasses:
ClasspathXmlConfig
,ClasspathYamlConfig
,FileSystemXmlConfig
,FileSystemYamlConfig
,InMemoryXmlConfig
,InMemoryYamlConfig
,UrlXmlConfig
,UrlYamlConfig
public class Config extends java.lang.Object
Contains all the configuration to start aHazelcastInstance
. A Config can be created programmatically, but can also be configured using XML, seeXmlConfigBuilder
.Config instances can be shared between threads, but should not be modified after they are used to create HazelcastInstances.
Unlike
Config
instances obtained viaload()
and its variants, aConfig
does not apply overrides found in environment variables/system properties.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_CLUSTER_NAME
Default cluster name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Config
addCacheConfig(CacheSimpleConfig cacheConfig)
Adds the cache configuration.Config
addCardinalityEstimatorConfig(CardinalityEstimatorConfig cardinalityEstimatorConfig)
Adds the cardinality estimator configuration.Config
addDataConnectionConfig(DataConnectionConfig dataConnectionConfig)
Adds a data connection configuration.Config
addDeviceConfig(DeviceConfig deviceConfig)
Adds the device configuration.Config
addDurableExecutorConfig(DurableExecutorConfig durableExecutorConfig)
Adds the durable executor configuration.Config
addExecutorConfig(ExecutorConfig executorConfig)
Adds the executor configuration.Config
addFlakeIdGeneratorConfig(FlakeIdGeneratorConfig config)
Adds a flake ID generator configuration.Config
addListConfig(ListConfig listConfig)
Adds the list configuration.Config
addListenerConfig(ListenerConfig listenerConfig)
Adds a configuration for anEventListener
.Config
addMapConfig(MapConfig mapConfig)
Adds the map configuration.Config
addMultiMapConfig(MultiMapConfig multiMapConfig)
Adds the multimap configuration.Config
addPNCounterConfig(PNCounterConfig pnCounterConfig)
Adds the PN counter configuration.Config
addQueueConfig(QueueConfig queueConfig)
Adds the queue configuration.Config
addReliableTopicConfig(ReliableTopicConfig topicConfig)
Adds the reliable topic configuration.Config
addReplicatedMapConfig(ReplicatedMapConfig replicatedMapConfig)
Adds the replicated map configuration.Config
addRingBufferConfig(RingbufferConfig ringbufferConfig)
Adds the ringbuffer configuration.Config
addScheduledExecutorConfig(ScheduledExecutorConfig scheduledExecutorConfig)
Adds the scheduled executor configuration.Config
addSetConfig(SetConfig setConfig)
Adds the set configuration.Config
addSplitBrainProtectionConfig(SplitBrainProtectionConfig splitBrainProtectionConfig)
Adds the split-brain protection configuration.Config
addTopicConfig(TopicConfig topicConfig)
Adds the topic configuration.Config
addWanReplicationConfig(WanReplicationConfig wanReplicationConfig)
Adds the WAN replication config under the name defined byWanReplicationConfig.getName()
.CacheSimpleConfig
findCacheConfig(java.lang.String name)
Returns a read-onlyCacheSimpleConfig
configuration for the given name.CacheSimpleConfig
findCacheConfigOrNull(java.lang.String name)
Returns the cache config with the given name ornull
if there is none.CardinalityEstimatorConfig
findCardinalityEstimatorConfig(java.lang.String name)
Returns a read-onlyCardinalityEstimator
configuration for the given name.DataConnectionConfig
findDataConnectionConfig(java.lang.String name)
Returns a read-onlyDataConnectionConfig
configuration for the given name.DurableExecutorConfig
findDurableExecutorConfig(java.lang.String name)
Returns a read-only durable executor configuration for the given name.ExecutorConfig
findExecutorConfig(java.lang.String name)
Returns a read-only executor configuration for the given name.FlakeIdGeneratorConfig
findFlakeIdGeneratorConfig(java.lang.String name)
Returns aFlakeIdGeneratorConfig
configuration for the given flake ID generator name.ListConfig
findListConfig(java.lang.String name)
Returns a read-onlyIList
configuration for the given name.MapConfig
findMapConfig(java.lang.String name)
Returns a read-onlyIMap
configuration for the given name.MultiMapConfig
findMultiMapConfig(java.lang.String name)
Returns a read-onlyMultiMap
configuration for the given name.PNCounterConfig
findPNCounterConfig(java.lang.String name)
Returns a read-onlyPNCounterConfig
configuration for the given name.QueueConfig
findQueueConfig(java.lang.String name)
Returns a read-onlyIQueue
configuration for the given name.ReliableTopicConfig
findReliableTopicConfig(java.lang.String name)
Returns a read-only reliable topic configuration for the given name.ReplicatedMapConfig
findReplicatedMapConfig(java.lang.String name)
Returns a read-onlyReplicatedMap
configuration for the given name.RingbufferConfig
findRingbufferConfig(java.lang.String name)
Returns a read-onlyRingbuffer
configuration for the given name.ScheduledExecutorConfig
findScheduledExecutorConfig(java.lang.String name)
Returns a read-only scheduled executor configuration for the given name.SetConfig
findSetConfig(java.lang.String name)
Returns a read-onlyISet
configuration for the given name.SplitBrainProtectionConfig
findSplitBrainProtectionConfig(java.lang.String name)
Returns a read-only split-brain protection configuration for the given name.TopicConfig
findTopicConfig(java.lang.String name)
Returns a read-onlyITopic
configuration for the given name.AdvancedNetworkConfig
getAdvancedNetworkConfig()
AuditlogConfig
getAuditlogConfig()
CacheSimpleConfig
getCacheConfig(java.lang.String name)
Returns the CacheSimpleConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,CacheSimpleConfig>
getCacheConfigs()
Returns the map of cache configurations, mapped by config name.CardinalityEstimatorConfig
getCardinalityEstimatorConfig(java.lang.String name)
Returns the CardinalityEstimatorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,CardinalityEstimatorConfig>
getCardinalityEstimatorConfigs()
Returns the map of cardinality estimator configurations, mapped by config name.java.lang.ClassLoader
getClassLoader()
Returns the class-loader that will be used in serialization.java.lang.String
getClusterName()
Returns the cluster name uniquely identifying the hazelcast cluster.ConfigPatternMatcher
getConfigPatternMatcher()
Returns the pattern matcher which is used to match item names to configuration objects.java.io.File
getConfigurationFile()
Returns theFile
to the declarative configuration, which has been parsed to create thisConfig
instance.java.net.URL
getConfigurationUrl()
Returns theURL
to the declarative configuration, which has been parsed to create thisConfig
instance.CPSubsystemConfig
getCPSubsystemConfig()
Get current configuration for the CP subsystemCRDTReplicationConfig
getCRDTReplicationConfig()
DataConnectionConfig
getDataConnectionConfig(java.lang.String name)
Returns the data connection configuration for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,DataConnectionConfig>
getDataConnectionConfigs()
Returns the map of data connection configurations, mapped by config name.<T extends DeviceConfig>
TgetDeviceConfig(java.lang.Class<T> clazz, java.lang.String name)
Returns the device config mapped by the provided device name.<T extends DeviceConfig>
TgetDeviceConfig(java.lang.String name)
Returns the device config mapped by the provided device name.java.util.Map<java.lang.String,DeviceConfig>
getDeviceConfigs()
Returns the map ofLocalDeviceConfig
s mapped by device name.DurableExecutorConfig
getDurableExecutorConfig(java.lang.String name)
Returns the DurableExecutorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,DurableExecutorConfig>
getDurableExecutorConfigs()
Returns the map of durable executor configurations, mapped by config name.DynamicConfigurationConfig
getDynamicConfigurationConfig()
Returns the dynamic configuration config.ExecutorConfig
getExecutorConfig(java.lang.String name)
Returns the ExecutorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,ExecutorConfig>
getExecutorConfigs()
Returns the map of executor configurations, mapped by config name.FlakeIdGeneratorConfig
getFlakeIdGeneratorConfig(java.lang.String name)
Returns theFlakeIdGeneratorConfig
for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,FlakeIdGeneratorConfig>
getFlakeIdGeneratorConfigs()
Returns the map ofFlakeIdGenerator
configurations, mapped by config name.HotRestartPersistenceConfig
getHotRestartPersistenceConfig()
Returns the Hot Restart configuration for this hazelcast instancejava.lang.String
getInstanceName()
Returns the instance name uniquely identifying the hazelcast instance created by this configuration.InstanceTrackingConfig
getInstanceTrackingConfig()
Returns the configuration for tracking use of this Hazelcast instance.IntegrityCheckerConfig
getIntegrityCheckerConfig()
Returns the IntegrityChecker configJetConfig
getJetConfig()
Returns the Jet configjava.lang.String
getLicenseKey()
Returns the license key for this hazelcast instance.ListConfig
getListConfig(java.lang.String name)
Returns the ListConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,ListConfig>
getListConfigs()
Returns the map ofIList
configurations, mapped by config name.java.util.List<ListenerConfig>
getListenerConfigs()
Returns the list ofEventListener
configurations.ManagedContext
getManagedContext()
Returns the external managed context.ManagementCenterConfig
getManagementCenterConfig()
Returns the management center configuration for this hazelcast instance.MapConfig
getMapConfig(java.lang.String name)
Returns the MapConfig for the given name, creating one if necessary and adding it to the collection of known configurations.MapConfig
getMapConfigOrNull(java.lang.String name)
Returns the map config with the given name ornull
if there is none.java.util.Map<java.lang.String,MapConfig>
getMapConfigs()
Returns the map ofIMap
configurations, mapped by config name.MemberAttributeConfig
getMemberAttributeConfig()
Returns the member attribute configuration.MetricsConfig
getMetricsConfig()
Returns the metrics collection config.MultiMapConfig
getMultiMapConfig(java.lang.String name)
Returns the MultiMapConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,MultiMapConfig>
getMultiMapConfigs()
Returns the map ofMultiMap
configurations, mapped by config name.NativeMemoryConfig
getNativeMemoryConfig()
Returns the native memory configuration for this hazelcast instance.NetworkConfig
getNetworkConfig()
Returns the network configuration for this hazelcast instance.PartitionGroupConfig
getPartitionGroupConfig()
Returns the partition group configuration for this hazelcast instance.PersistenceConfig
getPersistenceConfig()
Returns the Persistence configuration for this hazelcast instancePNCounterConfig
getPNCounterConfig(java.lang.String name)
Returns thePNCounterConfig
for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,PNCounterConfig>
getPNCounterConfigs()
Returns the map of PN counter configurations, mapped by config name.java.util.Properties
getProperties()
Returns the properties set on this config instance.java.lang.String
getProperty(java.lang.String name)
Returns the value for a named property.QueueConfig
getQueueConfig(java.lang.String name)
Returns the QueueConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,QueueConfig>
getQueueConfigs()
Returns the map ofIQueue
configurations, mapped by config name.ReliableTopicConfig
getReliableTopicConfig(java.lang.String name)
Returns the ReliableTopicConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,ReliableTopicConfig>
getReliableTopicConfigs()
Returns the map of reliable topic configurations, mapped by config name.ReplicatedMapConfig
getReplicatedMapConfig(java.lang.String name)
Returns the ReplicatedMapConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,ReplicatedMapConfig>
getReplicatedMapConfigs()
Returns the map ofReplicatedMap
configurations, mapped by config name.RingbufferConfig
getRingbufferConfig(java.lang.String name)
Returns the RingbufferConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,RingbufferConfig>
getRingbufferConfigs()
Returns the map ofRingbuffer
configurations, mapped by config name.ScheduledExecutorConfig
getScheduledExecutorConfig(java.lang.String name)
Returns the ScheduledExecutorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,ScheduledExecutorConfig>
getScheduledExecutorConfigs()
Returns the map of scheduled executor configurations, mapped by config name.SecurityConfig
getSecurityConfig()
Returns the security configuration for this hazelcast instance.SerializationConfig
getSerializationConfig()
Returns the serialization configuration for this hazelcast instance.protected com.hazelcast.internal.config.ServicesConfig
getServicesConfig()
Returns the configuration for the user services managed by this hazelcast instance.SetConfig
getSetConfig(java.lang.String name)
Returns the SetConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,SetConfig>
getSetConfigs()
Returns the map ofISet
configurations, mapped by config name.SplitBrainProtectionConfig
getSplitBrainProtectionConfig(java.lang.String name)
Returns theSplitBrainProtectionConfig
for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,SplitBrainProtectionConfig>
getSplitBrainProtectionConfigs()
Returns the map of split brain protection configurations, mapped by config name.SqlConfig
getSqlConfig()
TopicConfig
getTopicConfig(java.lang.String name)
Returns the TopicConfig for the given name, creating one if necessary and adding it to the collection of known configurations.java.util.Map<java.lang.String,TopicConfig>
getTopicConfigs()
Returns the map of reliable topic configurations, mapped by config name.TpcConfig
getTpcConfig()
Gets the TpcConfig.UserCodeDeploymentConfig
getUserCodeDeploymentConfig()
Get current configuration of User Code Deployment.java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object>
getUserContext()
Returns the user supplied context.WanReplicationConfig
getWanReplicationConfig(java.lang.String name)
Returns the WAN replication configuration with the givenname
.java.util.Map<java.lang.String,WanReplicationConfig>
getWanReplicationConfigs()
Returns the map of WAN replication configurations, mapped by config name.boolean
isLiteMember()
Returnstrue
if this member is a lite member.static Config
load()
Populates HazelcastConfig
object from an external configuration file.static Config
loadDefault()
Same asload()
, i.e., loads Config using the default lookup mechanismstatic Config
loadDefault(java.util.Properties properties)
Loads Config using the defaultlookup mechanism
to locate the configuration file and applies variable resolution from the provided properties.static Config
loadFromClasspath(java.lang.ClassLoader classLoader, java.lang.String resource)
Creates a Config which is loaded from a classpath resource.static Config
loadFromClasspath(java.lang.ClassLoader classLoader, java.lang.String resource, java.util.Properties properties)
Creates a Config which is loaded from a classpath resource.static Config
loadFromFile(java.io.File configFile)
Creates a Config based on a the provided configuration file (XML or YAML) and uses the System.properties to resolve variables in the file.static Config
loadFromFile(java.io.File configFile, java.util.Properties properties)
Creates a Config based on a the provided configuration file (XML or YAML) and uses the System.properties to resolve variables in the file.static Config
loadFromStream(java.io.InputStream source)
Creates a Config from the provided stream (XML or YAML content) and uses the System.properties for variable resolution.static Config
loadFromStream(java.io.InputStream source, java.util.Properties properties)
Creates a Config from the provided stream (XML or YAML content).static Config
loadFromString(java.lang.String source)
Creates a Config from the provided string (XML or YAML content) and uses the System.properties for variable resolution.static Config
loadFromString(java.lang.String source, java.util.Properties properties)
Creates a Config from the provided string (XML or YAML content).Config
setAdvancedNetworkConfig(AdvancedNetworkConfig advancedNetworkConfig)
Config
setAuditlogConfig(AuditlogConfig auditlogConfig)
Config
setCacheConfigs(java.util.Map<java.lang.String,CacheSimpleConfig> cacheConfigs)
Sets the map of cache configurations, mapped by config name.Config
setCardinalityEstimatorConfigs(java.util.Map<java.lang.String,CardinalityEstimatorConfig> cardinalityEstimatorConfigs)
Sets the map of cardinality estimator configurations, mapped by config name.Config
setClassLoader(java.lang.ClassLoader classLoader)
Sets the class-loader to be used during de-serialization and as context class-loader of Hazelcast internal threads.Config
setClusterName(java.lang.String clusterName)
Sets the cluster name uniquely identifying the hazelcast cluster.Config
setConfigPatternMatcher(ConfigPatternMatcher configPatternMatcher)
Sets the pattern matcher which is used to match item names to configuration objects.Config
setConfigurationFile(java.io.File configurationFile)
Sets theFile
from which this configuration has been retrieved and created.Config
setConfigurationUrl(java.net.URL configurationUrl)
Sets theURL
from which this configuration has been retrieved and created.Config
setCPSubsystemConfig(CPSubsystemConfig cpSubsystemConfig)
Set CP subsystem configurationConfig
setCRDTReplicationConfig(CRDTReplicationConfig crdtReplicationConfig)
Sets the replication configuration forCRDT
implementations.Config
setDataConnectionConfigs(java.util.Map<java.lang.String,DataConnectionConfig> dataConnectionConfigs)
Sets the map of data connection configurations, mapped by config name.Config
setDeviceConfigs(java.util.Map<java.lang.String,DeviceConfig> deviceConfigs)
Sets the map ofDeviceConfig
s mapped by device name.Config
setDurableExecutorConfigs(java.util.Map<java.lang.String,DurableExecutorConfig> durableExecutorConfigs)
Sets the map of durable executor configurations, mapped by config name.Config
setDynamicConfigurationConfig(DynamicConfigurationConfig dynamicConfigurationConfig)
Sets the dynamic configuration config.Config
setExecutorConfigs(java.util.Map<java.lang.String,ExecutorConfig> executorConfigs)
Sets the map of executor configurations, mapped by config name.Config
setFlakeIdGeneratorConfigs(java.util.Map<java.lang.String,FlakeIdGeneratorConfig> map)
Sets the map ofFlakeIdGenerator
configurations, mapped by config name.Config
setHotRestartPersistenceConfig(HotRestartPersistenceConfig hrConfig)
Deprecated.since 5.0 usesetPersistenceConfig(PersistenceConfig)
Config
setInstanceName(java.lang.String instanceName)
Sets the instance name uniquely identifying the hazelcast instance created by this configuration.Config
setInstanceTrackingConfig(InstanceTrackingConfig instanceTrackingConfig)
Sets the configuration for tracking use of this Hazelcast instance.Config
setIntegrityCheckerConfig(IntegrityCheckerConfig integrityCheckerConfig)
Sets the Integrity Checker configConfig
setJetConfig(JetConfig jetConfig)
Sets the Jet configConfig
setLicenseKey(java.lang.String licenseKey)
Sets the license key for this hazelcast instance.Config
setListConfigs(java.util.Map<java.lang.String,ListConfig> listConfigs)
Sets the map ofIList
configurations, mapped by config name.Config
setListenerConfigs(java.util.List<ListenerConfig> listenerConfigs)
Sets the list ofEventListener
configurations.Config
setLiteMember(boolean liteMember)
Sets the flag to indicate if this member is a lite member.Config
setManagedContext(ManagedContext managedContext)
Sets the external managed context.Config
setManagementCenterConfig(ManagementCenterConfig managementCenterConfig)
Sets the management center configuration for this hazelcast instance.Config
setMapConfigs(java.util.Map<java.lang.String,MapConfig> mapConfigs)
Sets the map ofIMap
configurations, mapped by config name.Config
setMemberAttributeConfig(MemberAttributeConfig memberAttributeConfig)
Sets the member attribute configuration.Config
setMetricsConfig(MetricsConfig metricsConfig)
Sets the metrics collection config.Config
setMultiMapConfigs(java.util.Map<java.lang.String,MultiMapConfig> multiMapConfigs)
Sets the map ofMultiMap
configurations, mapped by config name.Config
setNativeMemoryConfig(NativeMemoryConfig nativeMemoryConfig)
Sets the native memory configuration for this hazelcast instance.Config
setNetworkConfig(NetworkConfig networkConfig)
Sets the network configuration for this hazelcast instance.Config
setPartitionGroupConfig(PartitionGroupConfig partitionGroupConfig)
Sets the partition group configuration for this hazelcast instance.Config
setPersistenceConfig(PersistenceConfig persistenceConfig)
Sets the Persistence configuration.Config
setPNCounterConfigs(java.util.Map<java.lang.String,PNCounterConfig> pnCounterConfigs)
Sets the map of PN counter configurations, mapped by config name.Config
setProperties(java.util.Properties properties)
Sets the properties for this config instance.Config
setProperty(java.lang.String name, java.lang.String value)
Sets the value of a named property.Config
setQueueConfigs(java.util.Map<java.lang.String,QueueConfig> queueConfigs)
Sets the map ofIQueue
configurations, mapped by config name.Config
setReliableTopicConfigs(java.util.Map<java.lang.String,ReliableTopicConfig> reliableTopicConfigs)
Sets the map of reliable topic configurations, mapped by config name.Config
setReplicatedMapConfigs(java.util.Map<java.lang.String,ReplicatedMapConfig> replicatedMapConfigs)
Sets the map ofReplicatedMap
configurations, mapped by config name.Config
setRingbufferConfigs(java.util.Map<java.lang.String,RingbufferConfig> ringbufferConfigs)
Sets the map ofRingbuffer
configurations, mapped by config name.Config
setScheduledExecutorConfigs(java.util.Map<java.lang.String,ScheduledExecutorConfig> scheduledExecutorConfigs)
Sets the map of scheduled executor configurations, mapped by config name.Config
setSecurityConfig(SecurityConfig securityConfig)
Sets the security configuration for this hazelcast instance.Config
setSerializationConfig(SerializationConfig serializationConfig)
Sets the serialization configuration for this hazelcast instance.Config
setSetConfigs(java.util.Map<java.lang.String,SetConfig> setConfigs)
Sets the map ofISet
configurations, mapped by config name.Config
setSplitBrainProtectionConfigs(java.util.Map<java.lang.String,SplitBrainProtectionConfig> splitBrainProtectionConfigs)
Sets the map of split-brain protection configurations, mapped by config name.Config
setSqlConfig(SqlConfig sqlConfig)
Sets SQL config.Config
setTopicConfigs(java.util.Map<java.lang.String,TopicConfig> topicConfigs)
Sets the map ofITopic
configurations, mapped by config name.Config
setTpcConfig(TpcConfig tpcConfig)
Sets the TpcConfig.Config
setUserCodeDeploymentConfig(UserCodeDeploymentConfig userCodeDeploymentConfig)
Set User Code Deployment configurationConfig
setUserContext(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> userContext)
Sets the user supplied context.Config
setWanReplicationConfigs(java.util.Map<java.lang.String,WanReplicationConfig> wanReplicationConfigs)
Sets the map of WAN replication configurations, mapped by config name.java.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT_CLUSTER_NAME
public static final java.lang.String DEFAULT_CLUSTER_NAME
Default cluster name.- See Also:
- Constant Field Values
-
-
Method Detail
-
load
public static Config load()
Populates HazelcastConfig
object from an external configuration file.It tries to load Hazelcast configuration from a list of well-known locations, and then applies overrides found in environment variables/system properties When no location contains Hazelcast configuration then it returns default.
Note that the same mechanism is used when calling
Hazelcast.newHazelcastInstance()
.- Returns:
- Config created from a file when exists, otherwise default.
-
loadDefault
public static Config loadDefault()
Same asload()
, i.e., loads Config using the default lookup mechanism- Returns:
- Config created from a file when exists, otherwise default.
-
loadDefault
public static Config loadDefault(java.util.Properties properties)
Loads Config using the defaultlookup mechanism
to locate the configuration file and applies variable resolution from the provided properties.- Parameters:
properties
- properties to resolve variables in the XML or YAML- Returns:
- Config created from a file when exists, otherwise default.
-
loadFromClasspath
public static Config loadFromClasspath(java.lang.ClassLoader classLoader, java.lang.String resource)
Creates a Config which is loaded from a classpath resource. The System.properties are used for variable resolution in the configuration file- Parameters:
classLoader
- the ClassLoader used to load the resourceresource
- the resource, an XML or YAML configuration file from the classpath, without the "classpath:" prefix- Returns:
- Config created from the resource
- Throws:
java.lang.IllegalArgumentException
- if classLoader or resource isnull
, or if the resource is not foundInvalidConfigurationException
- if the resource content is invalid
-
loadFromClasspath
public static Config loadFromClasspath(java.lang.ClassLoader classLoader, java.lang.String resource, java.util.Properties properties)
Creates a Config which is loaded from a classpath resource. Uses the givenproperties
to resolve the variables in the resource.- Parameters:
classLoader
- the ClassLoader used to load the resourceresource
- the resource, an XML or YAML configuration file from the classpath, without the "classpath:" prefixproperties
- the properties used to resolve variables in the resource- Returns:
- Config created from the resource
- Throws:
java.lang.IllegalArgumentException
- if classLoader or resource isnull
, or if the resource is not foundInvalidConfigurationException
- if the resource content is invalid
-
loadFromFile
public static Config loadFromFile(java.io.File configFile) throws java.io.FileNotFoundException
Creates a Config based on a the provided configuration file (XML or YAML) and uses the System.properties to resolve variables in the file.- Parameters:
configFile
- the path of the configuration file- Returns:
- Config created from the configFile
- Throws:
java.io.FileNotFoundException
- if the file doesn't existInvalidConfigurationException
- if the file content is invalid
-
loadFromFile
public static Config loadFromFile(java.io.File configFile, java.util.Properties properties) throws java.io.FileNotFoundException
Creates a Config based on a the provided configuration file (XML or YAML) and uses the System.properties to resolve variables in the file.- Parameters:
configFile
- the path of the configuration fileproperties
- properties to use for variable resolution in the file- Returns:
- Config created from the configFile
- Throws:
java.io.FileNotFoundException
- if the file doesn't existInvalidConfigurationException
- if the file content is invalid
-
loadFromString
public static Config loadFromString(java.lang.String source)
Creates a Config from the provided string (XML or YAML content) and uses the System.properties for variable resolution.- Parameters:
source
- the XML or YAML content- Returns:
- Config created from the string
- Throws:
java.lang.IllegalArgumentException
- if the source is null or emptyHazelcastException
- if the source content is invalid
-
loadFromString
public static Config loadFromString(java.lang.String source, java.util.Properties properties)
Creates a Config from the provided string (XML or YAML content).- Parameters:
source
- the XML or YAML contentproperties
- properties to use for variable resolution- Returns:
- Config created from the string
- Throws:
java.lang.IllegalArgumentException
- if the source is null or emptyHazelcastException
- if the source content is invalid
-
loadFromStream
public static Config loadFromStream(java.io.InputStream source)
Creates a Config from the provided stream (XML or YAML content) and uses the System.properties for variable resolution.- Parameters:
source
- the XML or YAML stream- Returns:
- Config created from the stream
- Throws:
HazelcastException
- if the source content is invalid
-
loadFromStream
public static Config loadFromStream(java.io.InputStream source, java.util.Properties properties)
Creates a Config from the provided stream (XML or YAML content).- Parameters:
source
- the XML or YAML streamproperties
- properties to use for variable resolution- Returns:
- Config created from the stream
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
Returns the class-loader that will be used in serialization.If
null
, then thread context class-loader will be used instead.- Returns:
- the class-loader
-
setClassLoader
public Config setClassLoader(java.lang.ClassLoader classLoader)
Sets the class-loader to be used during de-serialization and as context class-loader of Hazelcast internal threads.If not set (or set to
null
); thread context class-loader will be used in required places.Default value is
null
.- Parameters:
classLoader
- class-loader to be used during de-serialization- Returns:
- Config instance
-
getConfigPatternMatcher
public ConfigPatternMatcher getConfigPatternMatcher()
Returns the pattern matcher which is used to match item names to configuration objects. By default theMatchingPointConfigPatternMatcher
is used.- Returns:
- the pattern matcher
-
setConfigPatternMatcher
public Config setConfigPatternMatcher(ConfigPatternMatcher configPatternMatcher)
Sets the pattern matcher which is used to match item names to configuration objects. By default theMatchingPointConfigPatternMatcher
is used.- Parameters:
configPatternMatcher
- the pattern matcher- Returns:
- this configuration
- Throws:
java.lang.IllegalArgumentException
- if the pattern matcher isnull
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Returns the value for a named property. If it has not been previously set, it will try to get the value from the system properties.- Parameters:
name
- property name- Returns:
- property value
- See Also:
setProperty(String, String)
, Hazelcast System Properties
-
setProperty
public Config setProperty(@Nonnull java.lang.String name, @Nonnull java.lang.String value)
Sets the value of a named property.- Parameters:
name
- property namevalue
- value of the property- Returns:
- this config instance
- Throws:
java.lang.IllegalArgumentException
- if eithervalue
isnull
or ifname
is empty ornull
- See Also:
- Hazelcast System Properties
-
getMemberAttributeConfig
public MemberAttributeConfig getMemberAttributeConfig()
Returns the member attribute configuration. Unlike the config properties (seesetProperties(Properties)
), member attributes are exchanged with other members, e.g. on membership events.- Returns:
- the member attribute configuration
-
setMemberAttributeConfig
public Config setMemberAttributeConfig(MemberAttributeConfig memberAttributeConfig)
Sets the member attribute configuration. Unlike the config properties (seesetProperties(Properties)
), member attributes are exchanged with other members, e.g. on membership events.- Parameters:
memberAttributeConfig
- the member attribute configuration- Returns:
- this configuration
-
getProperties
public java.util.Properties getProperties()
Returns the properties set on this config instance. These properties are specific to this config and this hazelcast instance.- Returns:
- the config properties
-
setProperties
public Config setProperties(java.util.Properties properties)
Sets the properties for this config instance. These properties are specific to this config and this hazelcast instance.- Parameters:
properties
- the config properties- Returns:
- this config instance
-
getInstanceName
public java.lang.String getInstanceName()
Returns the instance name uniquely identifying the hazelcast instance created by this configuration. This name is used in different scenarios, such as identifying the hazelcast instance when running multiple instances in the same JVM.- Returns:
- the hazelcast instance name
-
setInstanceName
public Config setInstanceName(java.lang.String instanceName)
Sets the instance name uniquely identifying the hazelcast instance created by this configuration. This name is used in different scenarios, such as identifying the hazelcast instance when running multiple instances in the same JVM.- Parameters:
instanceName
- the hazelcast instance name- Returns:
- this config instance
-
getClusterName
public java.lang.String getClusterName()
Returns the cluster name uniquely identifying the hazelcast cluster. This name is used in different scenarios, such as identifying cluster for WAN publisher.- Returns:
- the cluster name.
-
setClusterName
public Config setClusterName(java.lang.String clusterName)
Sets the cluster name uniquely identifying the hazelcast cluster. This name is used in different scenarios, such as identifying cluster for WAN publisher.- Parameters:
clusterName
- the new cluster name- Returns:
- this config instance
- Throws:
java.lang.IllegalArgumentException
- if name isnull
-
getNetworkConfig
public NetworkConfig getNetworkConfig()
Returns the network configuration for this hazelcast instance. The network configuration defines how a member will interact with other members or clients.- Returns:
- the network configuration
-
setNetworkConfig
public Config setNetworkConfig(NetworkConfig networkConfig)
Sets the network configuration for this hazelcast instance. The network configuration defines how a member will interact with other members or clients.- Parameters:
networkConfig
- the network configuration- Returns:
- this config instance
-
findMapConfig
public MapConfig findMapConfig(java.lang.String name)
Returns a read-onlyIMap
configuration for the given 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 namedefault
. For non-default configurations and on-heap maps, it will also initialise the Near Cache eviction if not previously set.- Parameters:
name
- name of the map config- Returns:
- the map configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getMapConfigOrNull
public MapConfig getMapConfigOrNull(java.lang.String name)
Returns the map config with the given name ornull
if there is none. The name is matched by pattern to the configuration and by stripping the partition ID qualifier from the givenname
.- Parameters:
name
- name of the map config- Returns:
- the map configuration or
null
if none was found - Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getMapConfig
public MapConfig getMapConfig(java.lang.String name)
Returns the MapConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addMapConfig(MapConfig)
.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.
- Parameters:
name
- name of the map config- Returns:
- the map configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addMapConfig
public Config addMapConfig(MapConfig mapConfig)
Adds the map configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
mapConfig
- the map configuration- Returns:
- this config instance
-
getMapConfigs
public java.util.Map<java.lang.String,MapConfig> getMapConfigs()
Returns the map ofIMap
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the map configurations mapped by config name
-
setMapConfigs
public Config setMapConfigs(java.util.Map<java.lang.String,MapConfig> mapConfigs)
Sets the map ofIMap
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
mapConfigs
- the IMap configuration map to set- Returns:
- this config instance
-
findCacheConfig
public CacheSimpleConfig findCacheConfig(java.lang.String name)
Returns a read-onlyCacheSimpleConfig
configuration for the given 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 namedefault
.- Parameters:
name
- name of the cardinality estimator config- Returns:
- the cache configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
findCacheConfigOrNull
public CacheSimpleConfig findCacheConfigOrNull(java.lang.String name)
Returns the cache config with the given name ornull
if there is none. The name is matched by pattern to the configuration and by stripping the partition ID qualifier from the givenname
.- Parameters:
name
- name of the cache config- Returns:
- the cache configuration or
null
if none was found - Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getCacheConfig
public CacheSimpleConfig getCacheConfig(java.lang.String name)
Returns the CacheSimpleConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addCacheConfig(CacheSimpleConfig)
.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.
- Parameters:
name
- name of the cache config- Returns:
- the cache configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addCacheConfig
public Config addCacheConfig(CacheSimpleConfig cacheConfig)
Adds the cache configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
cacheConfig
- the cache configuration- Returns:
- this config instance
-
getCacheConfigs
public java.util.Map<java.lang.String,CacheSimpleConfig> getCacheConfigs()
Returns the map of cache configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the cache configurations mapped by config name
-
setCacheConfigs
public Config setCacheConfigs(java.util.Map<java.lang.String,CacheSimpleConfig> cacheConfigs)
Sets the map of cache configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Parameters:
cacheConfigs
- the cacheConfigs to set- Returns:
- this config instance
-
findQueueConfig
public QueueConfig findQueueConfig(java.lang.String name)
Returns a read-onlyIQueue
configuration for the given 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 namedefault
.- Parameters:
name
- name of the queue config- Returns:
- the queue configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getQueueConfig
public QueueConfig getQueueConfig(java.lang.String name)
Returns the QueueConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addQueueConfig(QueueConfig)
.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.
- Parameters:
name
- name of the queue config- Returns:
- the queue configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addQueueConfig
public Config addQueueConfig(QueueConfig queueConfig)
Adds the queue configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
queueConfig
- the queue configuration- Returns:
- this config instance
-
getQueueConfigs
public java.util.Map<java.lang.String,QueueConfig> getQueueConfigs()
Returns the map ofIQueue
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the queue configurations mapped by config name
-
setQueueConfigs
public Config setQueueConfigs(java.util.Map<java.lang.String,QueueConfig> queueConfigs)
Sets the map ofIQueue
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
queueConfigs
- the queue configuration map to set- Returns:
- this config instance
-
findListConfig
public ListConfig findListConfig(java.lang.String name)
Returns a read-onlyIList
configuration for the given 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 namedefault
.- Parameters:
name
- name of the list config- Returns:
- the list configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getListConfig
public ListConfig getListConfig(java.lang.String name)
Returns the ListConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addListConfig(ListConfig)
.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.
- Parameters:
name
- name of the list config- Returns:
- the list configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addListConfig
public Config addListConfig(ListConfig listConfig)
Adds the list configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
listConfig
- the list configuration- Returns:
- this config instance
-
getListConfigs
public java.util.Map<java.lang.String,ListConfig> getListConfigs()
Returns the map ofIList
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the list configurations mapped by config name
-
setListConfigs
public Config setListConfigs(java.util.Map<java.lang.String,ListConfig> listConfigs)
Sets the map ofIList
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
listConfigs
- the list configuration map to set- Returns:
- this config instance
-
findSetConfig
public SetConfig findSetConfig(java.lang.String name)
Returns a read-onlyISet
configuration for the given 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 namedefault
.- Parameters:
name
- name of the set config- Returns:
- the set configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getSetConfig
public SetConfig getSetConfig(java.lang.String name)
Returns the SetConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addSetConfig(SetConfig)
.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.
- Parameters:
name
- name of the set config- Returns:
- the set configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addSetConfig
public Config addSetConfig(SetConfig setConfig)
Adds the set configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
setConfig
- the set configuration- Returns:
- this config instance
-
getSetConfigs
public java.util.Map<java.lang.String,SetConfig> getSetConfigs()
Returns the map ofISet
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the set configurations mapped by config name
-
setSetConfigs
public Config setSetConfigs(java.util.Map<java.lang.String,SetConfig> setConfigs)
Sets the map ofISet
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
setConfigs
- the set configuration map to set- Returns:
- this config instance
-
findMultiMapConfig
public MultiMapConfig findMultiMapConfig(java.lang.String name)
Returns a read-onlyMultiMap
configuration for the given 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 namedefault
.- Parameters:
name
- name of the multimap config- Returns:
- the multimap configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getMultiMapConfig
public MultiMapConfig getMultiMapConfig(java.lang.String name)
Returns the MultiMapConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addMultiMapConfig(MultiMapConfig)
.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.
- Parameters:
name
- name of the multimap config- Returns:
- the multimap configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addMultiMapConfig
public Config addMultiMapConfig(MultiMapConfig multiMapConfig)
Adds the multimap configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
multiMapConfig
- the multimap configuration- Returns:
- this config instance
-
getMultiMapConfigs
public java.util.Map<java.lang.String,MultiMapConfig> getMultiMapConfigs()
Returns the map ofMultiMap
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the multimap configurations mapped by config name
-
setMultiMapConfigs
public Config setMultiMapConfigs(java.util.Map<java.lang.String,MultiMapConfig> multiMapConfigs)
Sets the map ofMultiMap
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
multiMapConfigs
- the multimap configuration map to set- Returns:
- this config instance
-
findReplicatedMapConfig
public ReplicatedMapConfig findReplicatedMapConfig(java.lang.String name)
Returns a read-onlyReplicatedMap
configuration for the given 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 namedefault
.- Parameters:
name
- name of the replicated map config- Returns:
- the replicated map configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getReplicatedMapConfig
public ReplicatedMapConfig getReplicatedMapConfig(java.lang.String name)
Returns the ReplicatedMapConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addReplicatedMapConfig(ReplicatedMapConfig)
.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.
- Parameters:
name
- name of the replicated map config- Returns:
- the replicated map configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addReplicatedMapConfig
public Config addReplicatedMapConfig(ReplicatedMapConfig replicatedMapConfig)
Adds the replicated map configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
replicatedMapConfig
- the replicated map configuration- Returns:
- this config instance
-
getReplicatedMapConfigs
public java.util.Map<java.lang.String,ReplicatedMapConfig> getReplicatedMapConfigs()
Returns the map ofReplicatedMap
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the replicate map configurations mapped by config name
-
setReplicatedMapConfigs
public Config setReplicatedMapConfigs(java.util.Map<java.lang.String,ReplicatedMapConfig> replicatedMapConfigs)
Sets the map ofReplicatedMap
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
replicatedMapConfigs
- the replicated map configuration map to set- Returns:
- this config instance
-
findRingbufferConfig
public RingbufferConfig findRingbufferConfig(java.lang.String name)
Returns a read-onlyRingbuffer
configuration for the given 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 namedefault
.- Parameters:
name
- name of the ringbuffer config- Returns:
- the ringbuffer configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getRingbufferConfig
public RingbufferConfig getRingbufferConfig(java.lang.String name)
Returns the RingbufferConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addRingBufferConfig(RingbufferConfig)
.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.
- Parameters:
name
- name of the ringbuffer config- Returns:
- the ringbuffer configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addRingBufferConfig
public Config addRingBufferConfig(RingbufferConfig ringbufferConfig)
Adds the ringbuffer configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
ringbufferConfig
- the ringbuffer configuration- Returns:
- this config instance
-
getRingbufferConfigs
public java.util.Map<java.lang.String,RingbufferConfig> getRingbufferConfigs()
Returns the map ofRingbuffer
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the ringbuffer configurations mapped by config name
-
setRingbufferConfigs
public Config setRingbufferConfigs(java.util.Map<java.lang.String,RingbufferConfig> ringbufferConfigs)
Sets the map ofRingbuffer
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
ringbufferConfigs
- the ringbuffer configuration map to set- Returns:
- this config instance
-
findTopicConfig
public TopicConfig findTopicConfig(java.lang.String name)
Returns a read-onlyITopic
configuration for the given 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 namedefault
.- Parameters:
name
- name of the topic config- Returns:
- the topic configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getTopicConfig
public TopicConfig getTopicConfig(java.lang.String name)
Returns the TopicConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addTopicConfig(TopicConfig)
.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.
- Parameters:
name
- name of the topic config- Returns:
- the topic configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addTopicConfig
public Config addTopicConfig(TopicConfig topicConfig)
Adds the topic configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
topicConfig
- the topic configuration- Returns:
- this config instance
-
findReliableTopicConfig
public ReliableTopicConfig findReliableTopicConfig(java.lang.String name)
Returns a read-only reliable topic configuration for the given 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 namedefault
.- Parameters:
name
- name of the reliable topic config- Returns:
- the reliable topic configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getReliableTopicConfig
public ReliableTopicConfig getReliableTopicConfig(java.lang.String name)
Returns the ReliableTopicConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addReliableTopicConfig(ReliableTopicConfig)
.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.
- Parameters:
name
- name of the reliable topic config- Returns:
- the reliable topic configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getReliableTopicConfigs
public java.util.Map<java.lang.String,ReliableTopicConfig> getReliableTopicConfigs()
Returns the map of reliable topic configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the reliable topic configurations mapped by config name
-
addReliableTopicConfig
public Config addReliableTopicConfig(ReliableTopicConfig topicConfig)
Adds the reliable topic configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
topicConfig
- the reliable topic configuration- Returns:
- this config instance
-
setReliableTopicConfigs
public Config setReliableTopicConfigs(java.util.Map<java.lang.String,ReliableTopicConfig> reliableTopicConfigs)
Sets the map of reliable topic configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
reliableTopicConfigs
- the reliable topic configuration map to set- Returns:
- this config instance
-
getTopicConfigs
public java.util.Map<java.lang.String,TopicConfig> getTopicConfigs()
Returns the map of reliable topic configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the reliable topic configurations mapped by config name
-
setTopicConfigs
public Config setTopicConfigs(java.util.Map<java.lang.String,TopicConfig> topicConfigs)
Sets the map ofITopic
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
topicConfigs
- the topic configuration map to set- Returns:
- this config instance
-
findExecutorConfig
public ExecutorConfig findExecutorConfig(java.lang.String name)
Returns a read-only executor configuration for the given 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 namedefault
.- Parameters:
name
- name of the executor config- Returns:
- the executor configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
findDurableExecutorConfig
public DurableExecutorConfig findDurableExecutorConfig(java.lang.String name)
Returns a read-only durable executor configuration for the given 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 namedefault
.- Parameters:
name
- name of the durable executor config- Returns:
- the durable executor configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
findScheduledExecutorConfig
public ScheduledExecutorConfig findScheduledExecutorConfig(java.lang.String name)
Returns a read-only scheduled executor configuration for the given 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 namedefault
.- Parameters:
name
- name of the scheduled executor config- Returns:
- the scheduled executor configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
findCardinalityEstimatorConfig
public CardinalityEstimatorConfig findCardinalityEstimatorConfig(java.lang.String name)
Returns a read-onlyCardinalityEstimator
configuration for the given 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 namedefault
.- Parameters:
name
- name of the cardinality estimator config- Returns:
- the cardinality estimator configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
findPNCounterConfig
public PNCounterConfig findPNCounterConfig(java.lang.String name)
Returns a read-onlyPNCounterConfig
configuration for the given 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 namedefault
.- Parameters:
name
- name of the PN counter config- Returns:
- the PN counter configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getExecutorConfig
public ExecutorConfig getExecutorConfig(java.lang.String name)
Returns the ExecutorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addExecutorConfig(ExecutorConfig)
.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.
- Parameters:
name
- name of the executor config- Returns:
- the executor configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getDurableExecutorConfig
public DurableExecutorConfig getDurableExecutorConfig(java.lang.String name)
Returns the DurableExecutorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addDurableExecutorConfig(DurableExecutorConfig)
.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.
- Parameters:
name
- name of the durable executor config- Returns:
- the durable executor configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getScheduledExecutorConfig
public ScheduledExecutorConfig getScheduledExecutorConfig(java.lang.String name)
Returns the ScheduledExecutorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addScheduledExecutorConfig(ScheduledExecutorConfig)
.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.
- Parameters:
name
- name of the scheduled executor config- Returns:
- the scheduled executor configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getCardinalityEstimatorConfig
public CardinalityEstimatorConfig getCardinalityEstimatorConfig(java.lang.String name)
Returns the CardinalityEstimatorConfig for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addCardinalityEstimatorConfig(CardinalityEstimatorConfig)
.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.
- Parameters:
name
- name of the cardinality estimator config- Returns:
- the cardinality estimator configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getPNCounterConfig
public PNCounterConfig getPNCounterConfig(java.lang.String name)
Returns thePNCounterConfig
for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addPNCounterConfig(PNCounterConfig)
.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.
- Parameters:
name
- name of the PN counter config- Returns:
- the PN counter configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addExecutorConfig
public Config addExecutorConfig(ExecutorConfig executorConfig)
Adds the executor configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
executorConfig
- executor config to add- Returns:
- this config instance
-
addDurableExecutorConfig
public Config addDurableExecutorConfig(DurableExecutorConfig durableExecutorConfig)
Adds the durable executor configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
durableExecutorConfig
- durable executor config to add- Returns:
- this config instance
-
addScheduledExecutorConfig
public Config addScheduledExecutorConfig(ScheduledExecutorConfig scheduledExecutorConfig)
Adds the scheduled executor configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
scheduledExecutorConfig
- scheduled executor config to add- Returns:
- this config instance
-
addCardinalityEstimatorConfig
public Config addCardinalityEstimatorConfig(CardinalityEstimatorConfig cardinalityEstimatorConfig)
Adds the cardinality estimator configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
cardinalityEstimatorConfig
- cardinality estimator config to add- Returns:
- this config instance
-
addPNCounterConfig
public Config addPNCounterConfig(PNCounterConfig pnCounterConfig)
Adds the PN counter configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
pnCounterConfig
- PN counter config to add- Returns:
- this config instance
-
getExecutorConfigs
public java.util.Map<java.lang.String,ExecutorConfig> getExecutorConfigs()
Returns the map of executor configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the executor configurations mapped by config name
-
setExecutorConfigs
public Config setExecutorConfigs(java.util.Map<java.lang.String,ExecutorConfig> executorConfigs)
Sets the map of executor configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
executorConfigs
- the executor configuration map to set- Returns:
- this config instance
-
getDurableExecutorConfigs
public java.util.Map<java.lang.String,DurableExecutorConfig> getDurableExecutorConfigs()
Returns the map of durable executor configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the durable executor configurations mapped by config name
-
setDurableExecutorConfigs
public Config setDurableExecutorConfigs(java.util.Map<java.lang.String,DurableExecutorConfig> durableExecutorConfigs)
Sets the map of durable executor configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
durableExecutorConfigs
- the durable executor configuration map to set- Returns:
- this config instance
-
getScheduledExecutorConfigs
public java.util.Map<java.lang.String,ScheduledExecutorConfig> getScheduledExecutorConfigs()
Returns the map of scheduled executor configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the scheduled executor configurations mapped by config name
-
setScheduledExecutorConfigs
public Config setScheduledExecutorConfigs(java.util.Map<java.lang.String,ScheduledExecutorConfig> scheduledExecutorConfigs)
Sets the map of scheduled executor configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
scheduledExecutorConfigs
- the scheduled executor configuration map to set- Returns:
- this config instance
-
getCardinalityEstimatorConfigs
public java.util.Map<java.lang.String,CardinalityEstimatorConfig> getCardinalityEstimatorConfigs()
Returns the map of cardinality estimator configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the cardinality estimator configurations mapped by config name
-
setCardinalityEstimatorConfigs
public Config setCardinalityEstimatorConfigs(java.util.Map<java.lang.String,CardinalityEstimatorConfig> cardinalityEstimatorConfigs)
Sets the map of cardinality estimator configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
cardinalityEstimatorConfigs
- the cardinality estimator configuration map to set- Returns:
- this config instance
-
getPNCounterConfigs
public java.util.Map<java.lang.String,PNCounterConfig> getPNCounterConfigs()
Returns the map of PN counter configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the PN counter configurations mapped by config name
-
setPNCounterConfigs
public Config setPNCounterConfigs(java.util.Map<java.lang.String,PNCounterConfig> pnCounterConfigs)
Sets the map of PN counter configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
pnCounterConfigs
- the PN counter configuration map to set- Returns:
- this config instance
-
getWanReplicationConfig
public WanReplicationConfig getWanReplicationConfig(java.lang.String name)
Returns the WAN replication configuration with the givenname
.- Parameters:
name
- the WAN replication config name- Returns:
- the WAN replication config
-
addWanReplicationConfig
public Config addWanReplicationConfig(WanReplicationConfig wanReplicationConfig)
Adds the WAN replication config under the name defined byWanReplicationConfig.getName()
.- Parameters:
wanReplicationConfig
- the WAN replication config- Returns:
- this config instance
-
getWanReplicationConfigs
public java.util.Map<java.lang.String,WanReplicationConfig> getWanReplicationConfigs()
Returns the map of WAN replication configurations, mapped by config name.- Returns:
- the WAN replication configurations mapped by config name
-
setWanReplicationConfigs
public Config setWanReplicationConfigs(java.util.Map<java.lang.String,WanReplicationConfig> wanReplicationConfigs)
Sets the map of WAN replication configurations, mapped by config name.- Parameters:
wanReplicationConfigs
- the WAN replication configuration map to set- Returns:
- this config instance
-
getSplitBrainProtectionConfigs
public java.util.Map<java.lang.String,SplitBrainProtectionConfig> getSplitBrainProtectionConfigs()
Returns the map of split brain protection configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the split-brain protection configurations mapped by config name
-
getSplitBrainProtectionConfig
public SplitBrainProtectionConfig getSplitBrainProtectionConfig(java.lang.String name)
Returns theSplitBrainProtectionConfig
for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addSplitBrainProtectionConfig(SplitBrainProtectionConfig)
.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.
- Parameters:
name
- name of the split-brain protection config- Returns:
- the split-brain protection configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
findSplitBrainProtectionConfig
public SplitBrainProtectionConfig findSplitBrainProtectionConfig(java.lang.String name)
Returns a read-only split-brain protection configuration for the given 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 namedefault
.- Parameters:
name
- name of the split-brain protection config- Returns:
- the split-brain protection configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
setSplitBrainProtectionConfigs
public Config setSplitBrainProtectionConfigs(java.util.Map<java.lang.String,SplitBrainProtectionConfig> splitBrainProtectionConfigs)
Sets the map of split-brain protection configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
splitBrainProtectionConfigs
- the split-brain protection configuration map to set- Returns:
- this config instance
-
addSplitBrainProtectionConfig
public Config addSplitBrainProtectionConfig(SplitBrainProtectionConfig splitBrainProtectionConfig)
Adds the split-brain protection configuration. The configuration is saved under the config name defined bySplitBrainProtectionConfig.getName()
.- Parameters:
splitBrainProtectionConfig
- split-brain protection config to add- Returns:
- this config instance
-
getManagementCenterConfig
public ManagementCenterConfig getManagementCenterConfig()
Returns the management center configuration for this hazelcast instance.- Returns:
- the management center configuration
-
setManagementCenterConfig
public Config setManagementCenterConfig(ManagementCenterConfig managementCenterConfig)
Sets the management center configuration for this hazelcast instance.- Parameters:
managementCenterConfig
- the management center configuration- Returns:
- this config instance
-
getSecurityConfig
public SecurityConfig getSecurityConfig()
Returns the security configuration for this hazelcast instance. This includes configuration for security interceptors, permissions, etc.- Returns:
- the security configuration
-
setSecurityConfig
public Config setSecurityConfig(SecurityConfig securityConfig)
Sets the security configuration for this hazelcast instance. This includes configuration for security interceptors, permissions, etc.- Parameters:
securityConfig
- the security configuration- Returns:
- this config instance
-
addListenerConfig
public Config addListenerConfig(ListenerConfig listenerConfig)
Adds a configuration for anEventListener
. This includes listeners for events related to this instance/member or the cluster, such as partition, migration, cluster version listeners, etc. but not listeners on specific distributed data structures.- Parameters:
listenerConfig
- the listener configuration- Returns:
- this config instance
-
getListenerConfigs
public java.util.List<ListenerConfig> getListenerConfigs()
Returns the list ofEventListener
configurations. This includes listeners for events related to this instance/member or the cluster, such as partition, migration, cluster version listeners, etc. but not listeners on specific distributed data structures.- Returns:
- the listener configurations
-
setListenerConfigs
public Config setListenerConfigs(java.util.List<ListenerConfig> listenerConfigs)
Sets the list ofEventListener
configurations. This includes listeners for events related to this instance/member or the cluster, such as partition, migration, cluster version listeners, etc. but not listeners on specific distributed data structures.- Parameters:
listenerConfigs
- the listener configurations- Returns:
- this config instance
-
getFlakeIdGeneratorConfigs
public java.util.Map<java.lang.String,FlakeIdGeneratorConfig> getFlakeIdGeneratorConfigs()
Returns the map ofFlakeIdGenerator
configurations, mapped by config name. The config name may be a pattern with which the configuration was initially obtained.- Returns:
- the map configurations mapped by config name
-
findFlakeIdGeneratorConfig
public FlakeIdGeneratorConfig findFlakeIdGeneratorConfig(java.lang.String name)
Returns aFlakeIdGeneratorConfig
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"
.- Parameters:
name
- name of the flake ID generator config- Returns:
- the flake ID generator configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
getFlakeIdGeneratorConfig
public FlakeIdGeneratorConfig getFlakeIdGeneratorConfig(java.lang.String name)
Returns theFlakeIdGeneratorConfig
for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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(FlakeIdGeneratorConfig)
.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.
- Parameters:
name
- name of the flake ID generator config- Returns:
- the cache configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
addFlakeIdGeneratorConfig
public Config addFlakeIdGeneratorConfig(FlakeIdGeneratorConfig config)
Adds a flake ID generator configuration. The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.- Parameters:
config
- the flake ID generator configuration- Returns:
- this config instance
-
setFlakeIdGeneratorConfigs
public Config setFlakeIdGeneratorConfigs(java.util.Map<java.lang.String,FlakeIdGeneratorConfig> map)
Sets the map ofFlakeIdGenerator
configurations, mapped by config name. The config name may be a pattern with which the configuration will be obtained in the future.- Parameters:
map
- the FlakeIdGenerator configuration map to set- Returns:
- this config instance
-
getSerializationConfig
public SerializationConfig getSerializationConfig()
Returns the serialization configuration for this hazelcast instance. The serialization configuration defines how objects are serialized and deserialized on this instance.- Returns:
- the serialization configuration
-
setSerializationConfig
public Config setSerializationConfig(SerializationConfig serializationConfig)
Sets the serialization configuration for this hazelcast instance. The serialization configuration defines how objects are serialized and deserialized on this instance.- Parameters:
serializationConfig
- the serialization configuration- Returns:
- this config instance
-
getPartitionGroupConfig
public PartitionGroupConfig getPartitionGroupConfig()
Returns the partition group configuration for this hazelcast instance. The partition group configuration defines how partitions are mapped to members.- Returns:
- the partition group configuration
-
setPartitionGroupConfig
public Config setPartitionGroupConfig(PartitionGroupConfig partitionGroupConfig)
Sets the partition group configuration for this hazelcast instance. The partition group configuration defines how partitions are mapped to members.- Parameters:
partitionGroupConfig
- the partition group configuration- Returns:
- this config instance
-
getHotRestartPersistenceConfig
public HotRestartPersistenceConfig getHotRestartPersistenceConfig()
Returns the Hot Restart configuration for this hazelcast instance- Returns:
- hot restart configuration
-
getPersistenceConfig
public PersistenceConfig getPersistenceConfig()
Returns the Persistence configuration for this hazelcast instance- Returns:
- persistence configuration
-
setHotRestartPersistenceConfig
@Deprecated public Config setHotRestartPersistenceConfig(HotRestartPersistenceConfig hrConfig)
Deprecated.since 5.0 usesetPersistenceConfig(PersistenceConfig)
Sets the Hot Restart configuration.- Parameters:
hrConfig
- Hot Restart configuration- Returns:
- this config instance
- Throws:
java.lang.NullPointerException
- if thehrConfig
parameter isnull
-
setPersistenceConfig
public Config setPersistenceConfig(PersistenceConfig persistenceConfig)
Sets the Persistence configuration.- Parameters:
persistenceConfig
- Persistence configuration- Returns:
- this config instance
- Throws:
java.lang.NullPointerException
- if thepersistenceConfig
parameter isnull
-
getDeviceConfigs
public java.util.Map<java.lang.String,DeviceConfig> getDeviceConfigs()
Returns the map ofLocalDeviceConfig
s mapped by device name.- Returns:
- the device configurations mapped by device name
-
setDeviceConfigs
public Config setDeviceConfigs(java.util.Map<java.lang.String,DeviceConfig> deviceConfigs)
Sets the map ofDeviceConfig
s mapped by device name.- Parameters:
deviceConfigs
- device configuration map- Returns:
- this config instance
-
getDeviceConfig
@Nullable public <T extends DeviceConfig> T getDeviceConfig(java.lang.String name)
Returns the device config mapped by the provided device name.- Parameters:
name
- the device name- Returns:
- device config or
null
if absent
-
getDeviceConfig
@Nullable public <T extends DeviceConfig> T getDeviceConfig(java.lang.Class<T> clazz, java.lang.String name)
Returns the device config mapped by the provided device name.- Parameters:
name
- the device nameclazz
- desired device implementation class- Returns:
- device config or
null
if absent
-
addDeviceConfig
public Config addDeviceConfig(DeviceConfig deviceConfig)
Adds the device configuration.- Parameters:
deviceConfig
- device config- Returns:
- this config instance
-
getCRDTReplicationConfig
public CRDTReplicationConfig getCRDTReplicationConfig()
-
setCRDTReplicationConfig
public Config setCRDTReplicationConfig(CRDTReplicationConfig crdtReplicationConfig)
Sets the replication configuration forCRDT
implementations.- Parameters:
crdtReplicationConfig
- the replication configuration- Returns:
- this config instance
- Throws:
java.lang.NullPointerException
- if thecrdtReplicationConfig
parameter isnull
-
getManagedContext
public ManagedContext getManagedContext()
Returns the external managed context. This context is used to initialize user supplied objects.- Returns:
- the managed context
-
setManagedContext
public Config setManagedContext(ManagedContext managedContext)
Sets the external managed context. This context is used to initialize user supplied objects.- Parameters:
managedContext
- the managed context- Returns:
- this config instance
-
getUserContext
public java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> getUserContext()
Returns the user supplied context. This context can then be obtained from an instance ofHazelcastInstance
.- Returns:
- the user supplied context
- See Also:
HazelcastInstance.getUserContext()
-
setUserContext
public Config setUserContext(java.util.concurrent.ConcurrentMap<java.lang.String,java.lang.Object> userContext)
Sets the user supplied context. This context can then be obtained from an instance ofHazelcastInstance
.- Parameters:
userContext
- the user supplied context- Returns:
- this config instance
- See Also:
HazelcastInstance.getUserContext()
-
getNativeMemoryConfig
public NativeMemoryConfig getNativeMemoryConfig()
Returns the native memory configuration for this hazelcast instance. The native memory configuration defines the how native memory is used and the limits on its usage.- Returns:
- the native memory configuration
-
setNativeMemoryConfig
public Config setNativeMemoryConfig(NativeMemoryConfig nativeMemoryConfig)
Sets the native memory configuration for this hazelcast instance. The native memory configuration defines the how native memory is used and the limits on its usage.- Parameters:
nativeMemoryConfig
- the native memory configuration- Returns:
- this config instance
-
getConfigurationUrl
public java.net.URL getConfigurationUrl()
Returns theURL
to the declarative configuration, which has been parsed to create thisConfig
instance.- Returns:
- the configuration URL if the configuration loaded from a URL
or
null
otherwise
-
setConfigurationUrl
public Config setConfigurationUrl(java.net.URL configurationUrl)
Sets theURL
from which this configuration has been retrieved and created.Is set by the
XmlConfigBuilder
, when the XML configuration was retrieved from a URL.- Parameters:
configurationUrl
- the configuration URL to set- Returns:
- this config instance
-
getConfigurationFile
public java.io.File getConfigurationFile()
Returns theFile
to the declarative configuration, which has been parsed to create thisConfig
instance.- Returns:
- the configuration file if the configuration loaded from a file
or
null
otherwise
-
setConfigurationFile
public Config setConfigurationFile(java.io.File configurationFile)
Sets theFile
from which this configuration has been retrieved and created.Is set by the
XmlConfigBuilder
, when the XML configuration was retrieved from a file.- Parameters:
configurationFile
- the configuration file to set
-
getLicenseKey
public java.lang.String getLicenseKey()
Returns the license key for this hazelcast instance. The license key is used to enable enterprise features.- Returns:
- the license key
- Throws:
java.lang.SecurityException
- If a security manager exists and the calling method doesn't have correspondingHazelcastRuntimePermission
-
setLicenseKey
public Config setLicenseKey(java.lang.String licenseKey)
Sets the license key for this hazelcast instance. The license key is used to enable enterprise features.- Parameters:
licenseKey
- the license key- Returns:
- this config instance
-
isLiteMember
public boolean isLiteMember()
Returnstrue
if this member is a lite member. A lite member does not own any partitions.- Returns:
true
if this member is a lite member
-
setLiteMember
public Config setLiteMember(boolean liteMember)
Sets the flag to indicate if this member is a lite member. A lite member does not own any partitions.- Parameters:
liteMember
- if this member is a lite member- Returns:
- this config instance
-
getUserCodeDeploymentConfig
public UserCodeDeploymentConfig getUserCodeDeploymentConfig()
Get current configuration of User Code Deployment.- Returns:
- User Code Deployment configuration
- Since:
- 3.8
-
setUserCodeDeploymentConfig
public Config setUserCodeDeploymentConfig(UserCodeDeploymentConfig userCodeDeploymentConfig)
Set User Code Deployment configuration- Parameters:
userCodeDeploymentConfig
- the user code deployment configuration- Returns:
- this config instance
- Since:
- 3.8
-
getAdvancedNetworkConfig
public AdvancedNetworkConfig getAdvancedNetworkConfig()
-
setAdvancedNetworkConfig
public Config setAdvancedNetworkConfig(AdvancedNetworkConfig advancedNetworkConfig)
-
getCPSubsystemConfig
public CPSubsystemConfig getCPSubsystemConfig()
Get current configuration for the CP subsystem- Returns:
- CP subsystem configuration
- Since:
- 3.12
-
setCPSubsystemConfig
public Config setCPSubsystemConfig(CPSubsystemConfig cpSubsystemConfig)
Set CP subsystem configuration- Parameters:
cpSubsystemConfig
- the CP subsystem configuration- Returns:
- this config instance
- Since:
- 3.12
-
getMetricsConfig
@Nonnull public MetricsConfig getMetricsConfig()
Returns the metrics collection config.
-
setMetricsConfig
@Nonnull public Config setMetricsConfig(@Nonnull MetricsConfig metricsConfig)
Sets the metrics collection config.
-
getAuditlogConfig
@Nonnull public AuditlogConfig getAuditlogConfig()
-
setAuditlogConfig
@Nonnull public Config setAuditlogConfig(@Nonnull AuditlogConfig auditlogConfig)
-
getSqlConfig
@Nonnull public SqlConfig getSqlConfig()
- Returns:
- Return SQL config.
-
getInstanceTrackingConfig
@Nonnull public InstanceTrackingConfig getInstanceTrackingConfig()
Returns the configuration for tracking use of this Hazelcast instance.
-
setInstanceTrackingConfig
@Nonnull public Config setInstanceTrackingConfig(@Nonnull InstanceTrackingConfig instanceTrackingConfig)
Sets the configuration for tracking use of this Hazelcast instance.
-
getJetConfig
@Nonnull public JetConfig getJetConfig()
Returns the Jet config
-
getDynamicConfigurationConfig
public DynamicConfigurationConfig getDynamicConfigurationConfig()
Returns the dynamic configuration config.
-
setDynamicConfigurationConfig
public Config setDynamicConfigurationConfig(DynamicConfigurationConfig dynamicConfigurationConfig)
Sets the dynamic configuration config.
-
getIntegrityCheckerConfig
@Nonnull public IntegrityCheckerConfig getIntegrityCheckerConfig()
Returns the IntegrityChecker config- Since:
- 5.1
-
setIntegrityCheckerConfig
@Nonnull public Config setIntegrityCheckerConfig(IntegrityCheckerConfig integrityCheckerConfig)
Sets the Integrity Checker config- Since:
- 5.1
-
getDataConnectionConfigs
@Beta public java.util.Map<java.lang.String,DataConnectionConfig> getDataConnectionConfigs()
Returns the map of data connection configurations, mapped by config name.- Since:
- 5.3
-
setDataConnectionConfigs
@Beta public Config setDataConnectionConfigs(java.util.Map<java.lang.String,DataConnectionConfig> dataConnectionConfigs)
Sets the map of data connection configurations, mapped by config name.Example configuration: see
addDataConnectionConfig(DataConnectionConfig)
- Since:
- 5.3
-
addDataConnectionConfig
@Beta public Config addDataConnectionConfig(DataConnectionConfig dataConnectionConfig)
Adds a data connection configuration.Example:
Config config = new Config(); Properties properties = new Properties(); properties.put("jdbcUrl", jdbcUrl); properties.put("username", username); properties.put("password", password); DataConnectionConfig dataConnectionConfig = new DataConnectionConfig() .setName("my-jdbc-data-connection") .setType("Jdbc") .setProperties(properties); config.addDataConnectionConfig(dataConnectionConfig);
- Since:
- 5.3
-
getDataConnectionConfig
@Beta public DataConnectionConfig getDataConnectionConfig(java.lang.String name)
Returns the data connection configuration for the given name, creating one if necessary and adding it to the collection of known configurations.The configuration is found by matching 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
addDataConnectionConfig(DataConnectionConfig)
.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.
- Parameters:
name
- data connection name- Returns:
- data connection configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- Since:
- 5.3
- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
-
findDataConnectionConfig
@Beta public DataConnectionConfig findDataConnectionConfig(java.lang.String name)
Returns a read-onlyDataConnectionConfig
configuration for the given 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 namedefault
.- Parameters:
name
- name of the data connection- Returns:
- the data connection configuration
- Throws:
InvalidConfigurationException
- if ambiguous configurations are found- Since:
- 5.3
- See Also:
StringPartitioningStrategy.getBaseName(java.lang.String)
,setConfigPatternMatcher(ConfigPatternMatcher)
,getConfigPatternMatcher()
,EvictionConfig.setSize(int)
-
getTpcConfig
@Beta @Nonnull public TpcConfig getTpcConfig()
Gets the TpcConfig. Can't return null.- Returns:
- the TpcConfig.
- Since:
- 5.3
-
setTpcConfig
@Beta @Nonnull public Config setTpcConfig(@Nonnull TpcConfig tpcConfig)
Sets the TpcConfig.- Parameters:
tpcConfig
- the TpcConfig.- Returns:
- this config
- Throws:
java.lang.NullPointerException
- if tpcConfig is null- Since:
- 5.3
-
getServicesConfig
@PrivateApi protected com.hazelcast.internal.config.ServicesConfig getServicesConfig()
Returns the configuration for the user services managed by this hazelcast instance.- Returns:
- the user services configuration
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-