Package de.dytanic.cloudnet.cluster
Class DefaultNodeServerProvider<T extends NodeServer>
- java.lang.Object
-
- de.dytanic.cloudnet.cluster.DefaultNodeServerProvider<T>
-
- All Implemented Interfaces:
NodeServerProvider<T>
- Direct Known Subclasses:
DefaultClusterNodeServerProvider
public abstract class DefaultNodeServerProvider<T extends NodeServer> extends java.lang.Object implements NodeServerProvider<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected NodeServerheadNodeprotected NodeServerlocalNodeprotected java.util.Set<T>nodeServers
-
Constructor Summary
Constructors Constructor Description DefaultNodeServerProvider(CloudNet cloudNet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NodeServergetHeadNode()Gets the current head node of the cluster, may be the local node.TgetNodeServer(@NotNull java.lang.String uniqueId)Returns the node with the specific uniqueId that is configuredjava.util.Collection<T>getNodeServers()Returns the represent nodes that are configured on the application.NodeServergetSelfNode()Get the jvm static local node server implementation.voidrefreshHeadNode()Re-calculates the head node of the current cluster.
-
-
-
Field Detail
-
localNode
protected final NodeServer localNode
-
nodeServers
protected final java.util.Set<T extends NodeServer> nodeServers
-
headNode
protected volatile NodeServer headNode
-
-
Constructor Detail
-
DefaultNodeServerProvider
public DefaultNodeServerProvider(CloudNet cloudNet)
-
-
Method Detail
-
getNodeServers
public java.util.Collection<T> getNodeServers()
Description copied from interface:NodeServerProviderReturns the represent nodes that are configured on the application. The nodes shouldn't be online- Specified by:
getNodeServersin interfaceNodeServerProvider<T extends NodeServer>
-
getNodeServer
@Nullable public T getNodeServer(@NotNull @NotNull java.lang.String uniqueId)
Description copied from interface:NodeServerProviderReturns the node with the specific uniqueId that is configured- Specified by:
getNodeServerin interfaceNodeServerProvider<T extends NodeServer>- Parameters:
uniqueId- the uniqueId from the node, that should retrieve- Returns:
- the IClusterNodeServer instance or null if the node doesn't registered
-
getHeadNode
public NodeServer getHeadNode()
Description copied from interface:NodeServerProviderGets the current head node of the cluster, may be the local node.- Specified by:
getHeadNodein interfaceNodeServerProvider<T extends NodeServer>- Returns:
- the current head node of the cluster.
-
getSelfNode
public NodeServer getSelfNode()
Description copied from interface:NodeServerProviderGet the jvm static local node server implementation.- Specified by:
getSelfNodein interfaceNodeServerProvider<T extends NodeServer>- Returns:
- the jvm static local node server implementation.
-
refreshHeadNode
public void refreshHeadNode()
Description copied from interface:NodeServerProviderRe-calculates the head node of the current cluster.- Specified by:
refreshHeadNodein interfaceNodeServerProvider<T extends NodeServer>
-
-