Class NetworkClusterNode
java.lang.Object
eu.cloudnetservice.driver.cluster.NetworkClusterNode
- All Implemented Interfaces:
DefaultedDocPropertyHolder,DocPropertyHolder
Represents a general information holder about a node running in a cluster. Every node knows this information about
each node which runs in the cluster, even if the node is not connected.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<HostAndPort> private final Documentprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionNetworkClusterNode(@NonNull String uniqueId, @NonNull List<HostAndPort> listeners) Creates a new instance of a network cluster node.NetworkClusterNode(@NonNull String uniqueId, @NonNull List<HostAndPort> listeners, @NonNull Document properties) Creates a new instance of a network cluster node. -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow
-
Field Details
-
uniqueId
-
listeners
-
properties
-
-
Constructor Details
-
NetworkClusterNode
public NetworkClusterNode(@NonNull @NonNull String uniqueId, @NonNull @NonNull List<HostAndPort> listeners) Creates a new instance of a network cluster node.- Parameters:
uniqueId- the unique id of the node.listeners- the listeners of the node which are always running.- Throws:
NullPointerException- if either the id or listener array is null.
-
NetworkClusterNode
public NetworkClusterNode(@NonNull @NonNull String uniqueId, @NonNull @NonNull List<HostAndPort> listeners, @NonNull @NonNull Document properties) Creates a new instance of a network cluster node.- Parameters:
uniqueId- the unique id of the node.listeners- the listeners of the node which are always running.properties- the properties which are set for this node, mainly for developers to store information.- Throws:
NullPointerException- if either the id or listener array is null.
-
-
Method Details
-
uniqueId
-
listeners
Get all listener of this node.- Returns:
- all listener of this node.
-
propertyHolder
Get the underlying document that all read and write operations are delegated to.- Specified by:
propertyHolderin interfaceDocPropertyHolder- Returns:
- the underlying document.
-
equals
-
hashCode
-