Package de.dytanic.cloudnet.cluster
Class DefaultClusterNodeServerProvider
- java.lang.Object
-
- de.dytanic.cloudnet.cluster.DefaultNodeServerProvider<IClusterNodeServer>
-
- de.dytanic.cloudnet.cluster.DefaultClusterNodeServerProvider
-
- All Implemented Interfaces:
IClusterNodeServerProvider,NodeServerProvider<IClusterNodeServer>,de.dytanic.cloudnet.driver.network.protocol.IPacketSender,java.lang.AutoCloseable
public final class DefaultClusterNodeServerProvider extends DefaultNodeServerProvider<IClusterNodeServer> implements IClusterNodeServerProvider
-
-
Field Summary
-
Fields inherited from class de.dytanic.cloudnet.cluster.DefaultNodeServerProvider
headNode, localNode, nodeServers
-
-
Constructor Summary
Constructors Constructor Description DefaultClusterNodeServerProvider(CloudNet cloudNet)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidcheckForDeadNodes()Checks if all nodes had sent a node snapshot update recently or disconnects them.voidclose()voiddeployTemplateInCluster(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate serviceTemplate, @NotNull java.io.InputStream inputStream)Deploys the given template to all connected nodes.java.util.Collection<de.dytanic.cloudnet.driver.network.INetworkChannel>getConnectedChannels()Get all node server network channels which are currently connected and recognized by this provider.IClusterNodeServergetNodeServer(@NotNull de.dytanic.cloudnet.driver.network.INetworkChannel channel)Returns the node with the specific channel that is configuredjava.util.Map<java.lang.String,IClusterNodeServer>getServers()Deprecated.currently mapped, useDefaultNodeServerProvider.getNodeServers()instead.booleanhasAnyConnection()Get whether any other node is connected with this node.voidsendPacket(@NotNull de.dytanic.cloudnet.driver.network.protocol.IPacket packet)voidsendPacketSync(@NotNull de.dytanic.cloudnet.driver.network.protocol.IPacket packet)voidsetClusterServers(@NotNull de.dytanic.cloudnet.driver.network.cluster.NetworkCluster networkCluster)Set, replace or update all cluster nodes that are configured-
Methods inherited from class de.dytanic.cloudnet.cluster.DefaultNodeServerProvider
getHeadNode, getNodeServer, getNodeServers, getSelfNode, refreshHeadNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.dytanic.cloudnet.cluster.IClusterNodeServerProvider
deployTemplateInCluster
-
Methods inherited from interface de.dytanic.cloudnet.driver.network.protocol.IPacketSender
sendPacket, sendPacketSync
-
Methods inherited from interface de.dytanic.cloudnet.cluster.NodeServerProvider
getHeadNode, getNodeServer, getNodeServers, getSelfNode, refreshHeadNode
-
-
-
-
Constructor Detail
-
DefaultClusterNodeServerProvider
public DefaultClusterNodeServerProvider(CloudNet cloudNet)
-
-
Method Detail
-
getNodeServer
public IClusterNodeServer getNodeServer(@NotNull @NotNull de.dytanic.cloudnet.driver.network.INetworkChannel channel)
Description copied from interface:IClusterNodeServerProviderReturns the node with the specific channel that is configured- Specified by:
getNodeServerin interfaceIClusterNodeServerProvider- Parameters:
channel- the channel, that the node is connected with- Returns:
- the IClusterNodeServer instance or null if the node doesn't registered
-
setClusterServers
public void setClusterServers(@NotNull @NotNull de.dytanic.cloudnet.driver.network.cluster.NetworkCluster networkCluster)Description copied from interface:IClusterNodeServerProviderSet, replace or update all cluster nodes that are configured- Specified by:
setClusterServersin interfaceIClusterNodeServerProvider- Parameters:
networkCluster- the specific cluster network node configuration, that can create new IClusterNodeServer instances
-
sendPacket
public void sendPacket(@NotNull @NotNull de.dytanic.cloudnet.driver.network.protocol.IPacket packet)- Specified by:
sendPacketin interfacede.dytanic.cloudnet.driver.network.protocol.IPacketSender
-
sendPacketSync
public void sendPacketSync(@NotNull @NotNull de.dytanic.cloudnet.driver.network.protocol.IPacket packet)- Specified by:
sendPacketSyncin interfacede.dytanic.cloudnet.driver.network.protocol.IPacketSender
-
deployTemplateInCluster
public void deployTemplateInCluster(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate serviceTemplate, @NotNull @NotNull java.io.InputStream inputStream)Description copied from interface:IClusterNodeServerProviderDeploys the given template to all connected nodes.- Specified by:
deployTemplateInClusterin interfaceIClusterNodeServerProvider- Parameters:
serviceTemplate- the specific template prefix and name configurationinputStream- the template data as a zip archive
-
getConnectedChannels
public java.util.Collection<de.dytanic.cloudnet.driver.network.INetworkChannel> getConnectedChannels()
Description copied from interface:IClusterNodeServerProviderGet all node server network channels which are currently connected and recognized by this provider.- Specified by:
getConnectedChannelsin interfaceIClusterNodeServerProvider- Returns:
- all node server network channels which are currently connected.
-
hasAnyConnection
public boolean hasAnyConnection()
Description copied from interface:IClusterNodeServerProviderGet whether any other node is connected with this node.- Specified by:
hasAnyConnectionin interfaceIClusterNodeServerProvider- Returns:
- whether any other node is connected with this node.
-
checkForDeadNodes
public void checkForDeadNodes()
Description copied from interface:IClusterNodeServerProviderChecks if all nodes had sent a node snapshot update recently or disconnects them.- Specified by:
checkForDeadNodesin interfaceIClusterNodeServerProvider
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
getServers
@Deprecated @ScheduledForRemoval public java.util.Map<java.lang.String,IClusterNodeServer> getServers()
Deprecated.currently mapped, useDefaultNodeServerProvider.getNodeServers()instead.Gets all nodes servers as unique-id - server map.- Returns:
- all nodes servers as unique-id - server map.
-
-