com.hazelcast.spi.discovery

## Class SimpleDiscoveryNode

- java.lang.Object
- - com.hazelcast.spi.discovery.DiscoveryNode
  - - com.hazelcast.spi.discovery.SimpleDiscoveryNode

-     public final class SimpleDiscoveryNode
      extends DiscoveryNode

  Simple immutable implementation of the `DiscoveryNode` interface for convenience when implementing a `DiscoveryStrategy`.
  Since:
    3.6

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleDiscoveryNode(Address privateAddress)` This constructor will set private and public addresses to the same value and no properties are available.
    `SimpleDiscoveryNode(Address privateAddress, Address publicAddress)` This constructor will set private and public addresses separately and no properties are available.
    `SimpleDiscoveryNode(Address privateAddress, Address publicAddress, Map<String,Object> properties)` This constructor will set private and public addresses separately.
    `SimpleDiscoveryNode(Address privateAddress, Map<String,Object> properties)` This constructor will set private and public addresses to the same value.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Address` | `getPrivateAddress()` Returns the private address of the discovered node.
    `Map<String,Object>` | `getProperties()` Returns a set of unmodifiable properties that are assigned to the discovered node.
    `Address` | `getPublicAddress()` Returns the public address of the discovered node if available.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SimpleDiscoveryNode

          public SimpleDiscoveryNode(Address privateAddress)

      This constructor will set private and public addresses to the same value and no properties are available.
      Parameters:
        `privateAddress` - the discovered node's private address

    - #### SimpleDiscoveryNode

          public SimpleDiscoveryNode(Address privateAddress,
                                     Map<String,Object> properties)

      This constructor will set private and public addresses to the same value.
      Parameters:
        `privateAddress` - the discovered node's private address
        `properties` - the discovered node's additional properties

    - #### SimpleDiscoveryNode

          public SimpleDiscoveryNode(Address privateAddress,
                                     Address publicAddress)

      This constructor will set private and public addresses separately and no properties are available. Based on the internal implementation Hazelcast will either choose private or public address to connect to the cluster.

      On members private addresses are preferred.

      Parameters:
        `privateAddress` - the discovered node's private address
        `publicAddress` - the discovered node's public address

    - #### SimpleDiscoveryNode

          public SimpleDiscoveryNode(Address privateAddress,
                                     Address publicAddress,
                                     Map<String,Object> properties)

      This constructor will set private and public addresses separately. Based on the internal implementation Hazelcast will either choose private or public address to connect to the cluster.

      On members private addresses are preferred.

      Parameters:
        `privateAddress` - the discovered node's private address
        `publicAddress` - the discovered node's public address
        `properties` - the discovered node's additional properties

  - ### Method Detail

    - #### getPrivateAddress

          public Address getPrivateAddress()

      Description copied from class: `DiscoveryNode`
      Returns the private address of the discovered node. The private address must not be null.
      Specified by:
        `getPrivateAddress` in class `DiscoveryNode`
      Returns:
        the private address of the discovered node

    - #### getPublicAddress

          public Address getPublicAddress()

      Description copied from class: `DiscoveryNode`
      Returns the public address of the discovered node if available. Public addresses are optional and this method may return null or the same address as `DiscoveryNode.getPrivateAddress()`.
      Specified by:
        `getPublicAddress` in class `DiscoveryNode`
      Returns:
        the public address of the discovered node if available otherwise null or `DiscoveryNode.getPrivateAddress()`

    - #### getProperties

          public Map<String,Object> getProperties()

      Description copied from class: `DiscoveryNode`
      Returns a set of unmodifiable properties that are assigned to the discovered node. These properties can be used for additional filtering based on the `NodeFilter` API.
      Specified by:
        `getProperties` in class `DiscoveryNode`
      Returns:
        assigned properties of that node

Copyright © 2019. All rights reserved.