com.hazelcast.config

## Class DiscoveryConfig

- java.lang.Object
- - com.hazelcast.config.DiscoveryConfig

- All Implemented Interfaces:
    DataSerializable, IdentifiedDataSerializable
  Direct Known Subclasses:
    DiscoveryConfigReadOnly

      public class DiscoveryConfig
      extends Object
      implements IdentifiedDataSerializable

  This configuration class describes the top-level config of the discovery SPI and its discovery strategies.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `DiscoveryConfig()`
    `` | `DiscoveryConfig(DiscoveryConfig discoveryConfig)`
    `protected` | `DiscoveryConfig(DiscoveryServiceProvider discoveryServiceProvider, NodeFilter nodeFilter, String nodeFilterClass, Collection<DiscoveryStrategyConfig> discoveryStrategyConfigs)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDiscoveryStrategyConfig(DiscoveryStrategyConfig discoveryStrategyConfig)` Adds an enabled `DiscoveryStrategy` configuration.
    `boolean` | `equals(Object o)`
    `DiscoveryConfig` | `getAsReadOnly()` Deprecated. this method will be removed in 4.0; it is meant for internal usage only
    `DiscoveryServiceProvider` | `getDiscoveryServiceProvider()`
    `Collection<DiscoveryStrategyConfig>` | `getDiscoveryStrategyConfigs()` Returns the defined `DiscoveryStrategy` configurations.
    `int` | `getFactoryId()` Returns DataSerializableFactory factory ID for this class.
    `int` | `getId()` Returns type identifier for this class.
    `NodeFilter` | `getNodeFilter()`
    `String` | `getNodeFilterClass()`
    `int` | `hashCode()`
    `boolean` | `isEnabled()`
    `void` | `readData(ObjectDataInput in)` Reads fields from the input stream
    `void` | `setDiscoveryServiceProvider(DiscoveryServiceProvider discoveryServiceProvider)`
    `void` | `setDiscoveryStrategyConfigs(List<DiscoveryStrategyConfig> discoveryStrategyConfigs)` Sets the strategy configurations for this discovery config.
    `void` | `setNodeFilter(NodeFilter nodeFilter)`
    `void` | `setNodeFilterClass(String nodeFilterClass)`
    `String` | `toString()`
    `void` | `writeData(ObjectDataOutput out)` Writes object fields to output stream

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DiscoveryConfig

          public DiscoveryConfig()

    - #### DiscoveryConfig

          protected DiscoveryConfig(DiscoveryServiceProvider discoveryServiceProvider,
                                    NodeFilter nodeFilter,
                                    String nodeFilterClass,
                                    Collection<DiscoveryStrategyConfig> discoveryStrategyConfigs)

    - #### DiscoveryConfig

          public DiscoveryConfig(DiscoveryConfig discoveryConfig)

  - ### Method Detail

    - #### getAsReadOnly

          public DiscoveryConfig getAsReadOnly()

      Deprecated. this method will be removed in 4.0; it is meant for internal usage only
      Gets immutable version of this configuration.
      Returns:
        immutable version of this configuration

    - #### setDiscoveryServiceProvider

          public void setDiscoveryServiceProvider(DiscoveryServiceProvider discoveryServiceProvider)

    - #### getDiscoveryServiceProvider

          public DiscoveryServiceProvider getDiscoveryServiceProvider()

    - #### getNodeFilter

          public NodeFilter getNodeFilter()

    - #### setNodeFilter

          public void setNodeFilter(NodeFilter nodeFilter)

    - #### getNodeFilterClass

          public String getNodeFilterClass()

    - #### setNodeFilterClass

          public void setNodeFilterClass(String nodeFilterClass)

    - #### isEnabled

          public boolean isEnabled()

    - #### getDiscoveryStrategyConfigs

          public Collection<DiscoveryStrategyConfig> getDiscoveryStrategyConfigs()

      Returns the defined `DiscoveryStrategy` 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 void setDiscoveryStrategyConfigs(List<DiscoveryStrategyConfig> discoveryStrategyConfigs)

      Sets the strategy configurations for this discovery config.
      Parameters:
        `discoveryStrategyConfigs` - the strategy configurations

    - #### addDiscoveryStrategyConfig

          public void addDiscoveryStrategyConfig(DiscoveryStrategyConfig discoveryStrategyConfig)

      Adds an enabled `DiscoveryStrategy` configuration.

      All added configurations are strictly meant to be enabled, this is to remember when building custom `Config` instances.

      Parameters:
        `discoveryStrategyConfig` - the `DiscoveryStrategyConfig` to add

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getFactoryId

          public int getFactoryId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns DataSerializableFactory factory ID for this class.
      Specified by:
        `getFactoryId` in interface `IdentifiedDataSerializable`
      Returns:
        factory ID

    - #### getId

          public int getId()

      Description copied from interface: `IdentifiedDataSerializable`
      Returns type identifier for this class. It should be unique per DataSerializableFactory.
      Specified by:
        `getId` in interface `IdentifiedDataSerializable`
      Returns:
        type ID

    - #### writeData

          public void writeData(ObjectDataOutput out)
                         throws IOException

      Description copied from interface: `DataSerializable`
      Writes object fields to output stream
      Specified by:
        `writeData` in interface `DataSerializable`
      Parameters:
        `out` - output
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the output stream has been closed.

    - #### readData

          public void readData(ObjectDataInput in)
                        throws IOException

      Description copied from interface: `DataSerializable`
      Reads fields from the input stream
      Specified by:
        `readData` in interface `DataSerializable`
      Parameters:
        `in` - input
      Throws:
        `IOException` - if an I/O error occurs. In particular, an `IOException` may be thrown if the input stream has been closed.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2019. All rights reserved.