Package com.hazelcast.spi.discovery
Class SimpleDiscoveryNode
java.lang.Object
com.hazelcast.spi.discovery.DiscoveryNode
com.hazelcast.spi.discovery.SimpleDiscoveryNode
Simple immutable implementation of the
DiscoveryNode
interface for convenience
when implementing a DiscoveryStrategy
.- Since:
- 3.6
-
Constructor Summary
ConstructorDescriptionSimpleDiscoveryNode
(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.This constructor will set private and public addresses separately.SimpleDiscoveryNode
(Address privateAddress, Map<String, String> properties) This constructor will set private and public addresses to the same value. -
Method Summary
Modifier and TypeMethodDescriptionReturns the private address of the discovered node.Returns a set of unmodifiable properties that are assigned to the discovered node.Returns the public address of the discovered node if available.
-
Constructor Details
-
SimpleDiscoveryNode
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
This constructor will set private and public addresses to the same value.- Parameters:
privateAddress
- the discovered node's private addressproperties
- the discovered node's additional properties
-
SimpleDiscoveryNode
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 addresspublicAddress
- the discovered node's public address
-
SimpleDiscoveryNode
public SimpleDiscoveryNode(Address privateAddress, Address publicAddress, Map<String, String> 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 addresspublicAddress
- the discovered node's public addressproperties
- the discovered node's additional properties
-
-
Method Details
-
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 classDiscoveryNode
- Returns:
- the private address of the discovered node
-
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 asDiscoveryNode.getPrivateAddress()
.- Specified by:
getPublicAddress
in classDiscoveryNode
- Returns:
- the public address of the discovered node if available otherwise null or
DiscoveryNode.getPrivateAddress()
-
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 theNodeFilter
API.- Specified by:
getProperties
in classDiscoveryNode
- Returns:
- assigned properties of that node
-