- Direct Known Subclasses:
public abstract class DiscoveryNode extends Object
DiscoveryNodedescribes a nodes addresses (private and if necessary a public one) as well as attributes assigned to this node. Private address defines the typical internal communication port, all cluster communication and also client communication inside the same network happens on this address. However in cloud environments clients might run in other sub-networks and therefore cannot access the private address. In those situations
DiscoveryStrategyvendors can retrieve and assign an additional external (or public) IP address of the node for clients to connect against.
Public addresses, if not necessary, can either be returned as null or may return the same address instance as the private one and will be handled internally the same way.
The properties will be used to store any kind of tags or other metadata
available for the node inside of the cloud environment. If a
NodeFilter is configured, these
properties might be used for further refinement of the discovered nodes
based on whatever the filter decides.
This class is implemented as an abstract class to offer easy extensibility in later versions of the SPI. Since Java only offers forward evolution of interfaces starting with Java 8, this is the best option.
Constructors Constructor Description
Modifier and Type Method Description
()Returns 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.
getPrivateAddresspublic abstract Address getPrivateAddress()Returns the private address of the discovered node. The private address must not be null.
- the private address of the discovered node
getPublicAddresspublic abstract Address getPublicAddress()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
- the public address of the discovered node if available otherwise null or
getPropertiesReturns a set of unmodifiable properties that are assigned to the discovered node. These properties can be used for additional filtering based on the
- assigned properties of that node