Class NetworkClusterNode
java.lang.Object
eu.cloudnetservice.driver.network.cluster.NetworkClusterNode
- All Implemented Interfaces:
eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,,NetworkClusterNode> eu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,NetworkClusterNode>
public final class NetworkClusterNode
extends Object
implements eu.cloudnetservice.common.document.property.DefaultedDocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,NetworkClusterNode>
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<HostAndPort>private final eu.cloudnetservice.common.document.gson.JsonDocumentprivate 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 eu.cloudnetservice.common.document.gson.JsonDocument 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.common.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow, removeProperty, writeProperty, writePropertyIfAbsent, writePropertyIfAbsent, writePropertyIfPresent, writePropertyIfPresent
-
Field Details
-
uniqueId
-
listeners
-
properties
private final eu.cloudnetservice.common.document.gson.JsonDocument 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 eu.cloudnetservice.common.document.gson.JsonDocument 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
Get the unique id of this node.- Returns:
- the unique id of this node.
-
listeners
Get all listener of this node.- Returns:
- all listener of this node.
-
propertyHolder
- Specified by:
propertyHolderin interfaceeu.cloudnetservice.common.document.property.DocPropertyHolder<eu.cloudnetservice.common.document.gson.JsonDocument,NetworkClusterNode>
-
equals
-
hashCode
public int hashCode()
-