Package com.hazelcast.config
Class DiscoveryConfig
java.lang.Object
com.hazelcast.config.DiscoveryConfig
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
This configuration class describes the top-level config of the discovery
SPI and its discovery strategies.
-
Constructor Summary
ModifierConstructorDescriptionDiscoveryConfig
(DiscoveryConfig discoveryConfig) protected
DiscoveryConfig
(DiscoveryServiceProvider discoveryServiceProvider, NodeFilter nodeFilter, String nodeFilterClass, Collection<DiscoveryStrategyConfig> discoveryStrategyConfigs) -
Method Summary
Modifier and TypeMethodDescriptionaddDiscoveryStrategyConfig
(DiscoveryStrategyConfig discoveryStrategyConfig) Adds an enabledDiscoveryStrategy
configuration.boolean
int
Returns type identifier for this class.Returns the definedDiscoveryStrategy
configurations.int
Returns DataSerializableFactory factory ID for this class.int
hashCode()
boolean
void
Reads fields from the input streamsetDiscoveryServiceProvider
(DiscoveryServiceProvider discoveryServiceProvider) setDiscoveryStrategyConfigs
(List<DiscoveryStrategyConfig> discoveryStrategyConfigs) Sets the strategy configurations for this discovery config.setNodeFilter
(NodeFilter nodeFilter) setNodeFilterClass
(String nodeFilterClass) toString()
void
Writes object fields to output stream
-
Constructor Details
-
DiscoveryConfig
public DiscoveryConfig() -
DiscoveryConfig
protected DiscoveryConfig(DiscoveryServiceProvider discoveryServiceProvider, NodeFilter nodeFilter, String nodeFilterClass, Collection<DiscoveryStrategyConfig> discoveryStrategyConfigs) -
DiscoveryConfig
-
-
Method Details
-
setDiscoveryServiceProvider
public DiscoveryConfig setDiscoveryServiceProvider(DiscoveryServiceProvider discoveryServiceProvider) -
getDiscoveryServiceProvider
-
getNodeFilter
-
setNodeFilter
-
getNodeFilterClass
-
setNodeFilterClass
-
isEnabled
public boolean isEnabled() -
getDiscoveryStrategyConfigs
Returns the definedDiscoveryStrategy
configurations. This collection does not include deactivated configurations since those are automatically skipped while reading the configuration file.All returned configurations are expected to be active, this is to remember when building custom
Config
instances.- Returns:
- all enabled
DiscoveryStrategy
configurations
-
setDiscoveryStrategyConfigs
public DiscoveryConfig setDiscoveryStrategyConfigs(List<DiscoveryStrategyConfig> discoveryStrategyConfigs) Sets the strategy configurations for this discovery config.- Parameters:
discoveryStrategyConfigs
- the strategy configurations- Returns:
- this configuration
-
addDiscoveryStrategyConfig
Adds an enabledDiscoveryStrategy
configuration.All added configurations are strictly meant to be enabled, this is to remember when building custom
Config
instances.- Parameters:
discoveryStrategyConfig
- theDiscoveryStrategyConfig
to add- Returns:
- this configuration
-
toString
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
equals
-
hashCode
public int hashCode()
-