Package de.dytanic.cloudnet.cluster
Interface IClusterNodeServerProvider
-
- All Superinterfaces:
java.lang.AutoCloseable,de.dytanic.cloudnet.driver.network.protocol.IPacketSender,NodeServerProvider<IClusterNodeServer>
- All Known Implementing Classes:
DefaultClusterNodeServerProvider
public interface IClusterNodeServerProvider extends NodeServerProvider<IClusterNodeServer>, de.dytanic.cloudnet.driver.network.protocol.IPacketSender, java.lang.AutoCloseable
Represents the full management of all nodes of the cluster. It's manage all nodes that are configured on the platform
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidcheckForDeadNodes()Checks if all nodes had sent a node snapshot update recently or disconnects them.default voiddeployTemplateInCluster(@NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate serviceTemplate, byte[] zipResource)Deprecated.usedeployTemplateInCluster(ServiceTemplate, InputStream)instead, this method causes high heap usagevoiddeployTemplateInCluster(@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.@Nullable IClusterNodeServergetNodeServer(@NotNull de.dytanic.cloudnet.driver.network.INetworkChannel channel)Returns the node with the specific channel that is configuredbooleanhasAnyConnection()Get whether any other node is connected with this node.voidsetClusterServers(@NotNull de.dytanic.cloudnet.driver.network.cluster.NetworkCluster networkCluster)Set, replace or update all cluster nodes that are configured-
Methods inherited from interface de.dytanic.cloudnet.driver.network.protocol.IPacketSender
sendPacket, sendPacket, sendPacketSync, sendPacketSync
-
Methods inherited from interface de.dytanic.cloudnet.cluster.NodeServerProvider
getHeadNode, getNodeServer, getNodeServers, getSelfNode, refreshHeadNode
-
-
-
-
Method Detail
-
getNodeServer
@Nullable @Nullable IClusterNodeServer getNodeServer(@NotNull @NotNull de.dytanic.cloudnet.driver.network.INetworkChannel channel)
Returns the node with the specific channel that is configured- Parameters:
channel- the channel, that the node is connected with- Returns:
- the IClusterNodeServer instance or null if the node doesn't registered
-
setClusterServers
void setClusterServers(@NotNull @NotNull de.dytanic.cloudnet.driver.network.cluster.NetworkCluster networkCluster)Set, replace or update all cluster nodes that are configured- Parameters:
networkCluster- the specific cluster network node configuration, that can create new IClusterNodeServer instances
-
deployTemplateInCluster
@Deprecated default void deployTemplateInCluster(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate serviceTemplate, byte[] zipResource)Deprecated.usedeployTemplateInCluster(ServiceTemplate, InputStream)instead, this method causes high heap usageDeploys the given template to all connected nodes.- Parameters:
serviceTemplate- the specific template prefix and name configurationzipResource- the template data as a zip archive
-
deployTemplateInCluster
void deployTemplateInCluster(@NotNull @NotNull de.dytanic.cloudnet.driver.service.ServiceTemplate serviceTemplate, @NotNull @NotNull java.io.InputStream inputStream)Deploys the given template to all connected nodes.- Parameters:
serviceTemplate- the specific template prefix and name configurationinputStream- the template data as a zip archive
-
getConnectedChannels
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.- Returns:
- all node server network channels which are currently connected.
-
hasAnyConnection
boolean hasAnyConnection()
Get whether any other node is connected with this node.- Returns:
- whether any other node is connected with this node.
-
checkForDeadNodes
void checkForDeadNodes()
Checks if all nodes had sent a node snapshot update recently or disconnects them.
-
-