Class ServerGroup

java.lang.Object
de.rexlcloud.core.server.ServerGroup
All Implemented Interfaces:
Serializable

public class ServerGroup extends Object implements Serializable
A group of servers or proxies started from the same template with the same settings, e.g. Lobby. Changing a group is done by the master (module API or panel); the setters only change this copy.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    ServerGroup(@NonNull String name, @NonNull ServerType type, int memory, boolean staticServer, @Nullable String wrapper, int minServers, boolean fallback, boolean removeOldLogs, @NonNull String javaArguments, int maxPlayers, String javaCommand)
    Internal: groups are created by the master.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Template every server of the group starts from.
    @NonNull String
    Extra JVM arguments of the servers, e.g.
    The Java the servers run with: java from the wrapper's PATH or the path of an installed runtime.
    int
    Player slots shown in the server list.
    int
    Memory of each server in MB.
    int
    How many servers the cloud keeps running.
    @NonNull String
    Name of the group; its servers are called <name>-1, <name>-2, ...
     
    @NonNull ServerType
    Servers or proxies.
    @Nullable String
    The wrapper of a static group, null otherwise.
    int
     
    boolean
    The group's servers run the server.jar the user put into the template (e.g.
    boolean
    Whether players are sent to this group's servers when they join or are kicked from another server.
    boolean
    Whether the logs of a static server are deleted when it starts.
    boolean
    Whether the group has one server that keeps its files on a fixed wrapper instead of starting fresh from the template.
    void
    setCustomJar(boolean customJar)
    The group's servers run the server.jar the user put into the template (e.g.
    void
    setFallback(boolean fallback)
    Whether players are sent to this group's servers when they join or are kicked from another server.
    void
    setJavaArguments(@NonNull String javaArguments)
    Extra JVM arguments of the servers, e.g.
    void
    setJavaCommand(String javaCommand)
    The Java the servers run with: java from the wrapper's PATH or the path of an installed runtime.
    void
    setMaxPlayers(int maxPlayers)
    Player slots shown in the server list.
    void
    setMemory(int memory)
    Memory of each server in MB.
    void
    setMinServers(int minServers)
    How many servers the cloud keeps running.
    void
    setRemoveOldLogs(boolean removeOldLogs)
    Whether the logs of a static server are deleted when it starts.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServerGroup

      public ServerGroup(@NonNull @NonNull String name, @NonNull @NonNull ServerType type, int memory, boolean staticServer, @Nullable @Nullable String wrapper, int minServers, boolean fallback, boolean removeOldLogs, @NonNull @NonNull String javaArguments, int maxPlayers, String javaCommand)
      Internal: groups are created by the master.
  • Method Details

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getTemplateFolder

      public File getTemplateFolder()
    • getDefaultTemplateFolder

      public File getDefaultTemplateFolder()
      Template every server of the group starts from. It lives inside getTemplateFolder(), because only that folder is sent to the wrappers, which expect it as servers/templates/<group>/default.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getName

      @NonNull public @NonNull String getName()
      Name of the group; its servers are called <name>-1, <name>-2, ...
    • getType

      @NonNull public @NonNull ServerType getType()
      Servers or proxies.
    • getMemory

      public int getMemory()
      Memory of each server in MB.
    • isStaticServer

      public boolean isStaticServer()
      Whether the group has one server that keeps its files on a fixed wrapper instead of starting fresh from the template.
    • getWrapper

      @Nullable public @Nullable String getWrapper()
      The wrapper of a static group, null otherwise.
    • getMinServers

      public int getMinServers()
      How many servers the cloud keeps running.
    • isFallback

      public boolean isFallback()
      Whether players are sent to this group's servers when they join or are kicked from another server.
    • isRemoveOldLogs

      public boolean isRemoveOldLogs()
      Whether the logs of a static server are deleted when it starts.
    • getJavaArguments

      @NonNull public @NonNull String getJavaArguments()
      Extra JVM arguments of the servers, e.g. -XX:+UseG1GC.
    • getMaxPlayers

      public int getMaxPlayers()
      Player slots shown in the server list.
    • getJavaCommand

      public String getJavaCommand()
      The Java the servers run with: java from the wrapper's PATH or the path of an installed runtime.
    • isCustomJar

      public boolean isCustomJar()
      The group's servers run the server.jar the user put into the template (e.g. a Minestom server with the MinestomBridge) instead of a downloaded Paper/Spigot jar. Such servers get no cloud plugin, no Paper/Spigot configuration and no start arguments; they read everything from their cloud.json.
    • setMemory

      public void setMemory(int memory)
      Memory of each server in MB.
    • setMinServers

      public void setMinServers(int minServers)
      How many servers the cloud keeps running.
    • setFallback

      public void setFallback(boolean fallback)
      Whether players are sent to this group's servers when they join or are kicked from another server.
    • setRemoveOldLogs

      public void setRemoveOldLogs(boolean removeOldLogs)
      Whether the logs of a static server are deleted when it starts.
    • setJavaArguments

      public void setJavaArguments(@NonNull @NonNull String javaArguments)
      Extra JVM arguments of the servers, e.g. -XX:+UseG1GC.
    • setMaxPlayers

      public void setMaxPlayers(int maxPlayers)
      Player slots shown in the server list.
    • setJavaCommand

      public void setJavaCommand(String javaCommand)
      The Java the servers run with: java from the wrapper's PATH or the path of an installed runtime.
    • setCustomJar

      public void setCustomJar(boolean customJar)
      The group's servers run the server.jar the user put into the template (e.g. a Minestom server with the MinestomBridge) instead of a downloaded Paper/Spigot jar. Such servers get no cloud plugin, no Paper/Spigot configuration and no start arguments; they read everything from their cloud.json.