Class SubCreator

java.lang.Object
net.ME1312.SubServers.Bungee.Host.SubCreator
Direct Known Subclasses:
ExternalSubCreator, InternalSubCreator

public abstract class SubCreator extends Object
SubCreator Layout Class
  • Constructor Details

    • SubCreator

      public SubCreator()
  • Method Details

    • create

      public abstract boolean create(UUID player, String name, SubCreator.ServerTemplate template, Version version, Integer port, Consumer<SubServer> callback)
      Create a SubServer
      Parameters:
      player - Player Creating
      name - Server Name
      template - Server Template
      version - Server Version (may be null)
      port - Server Port Number (null to auto-select)
      callback - Callback
      Returns:
      Success Status
    • create

      public boolean create(UUID player, String name, SubCreator.ServerTemplate template, Version version, Integer port)
      Create a SubServer
      Parameters:
      player - Player Creating
      name - Server Name
      template - Server Template
      version - Server Version (may be null)
      port - Server Port Number (null to auto-select)
      Returns:
      Success Status
    • create

      public boolean create(String name, SubCreator.ServerTemplate template, Version version, Integer port, Consumer<SubServer> callback)
      Create a SubServer
      Parameters:
      name - Server Name
      template - Server Template
      version - Server Version (may be null)
      port - Server Port Number (null to auto-select)
      callback - Callback
      Returns:
      Success Status
    • create

      public boolean create(String name, SubCreator.ServerTemplate template, Version version, Integer port)
      Create a SubServer
      Parameters:
      name - Server Name
      template - Server Template
      version - Server Version (may be null)
      port - Server Port Number (null to auto-select)
      Returns:
      Success Status
    • update

      public abstract boolean update(UUID player, SubServer server, SubCreator.ServerTemplate template, Version version, Consumer<Boolean> callback)
      Update a SubServer
      Parameters:
      player - Player Updating
      server - Server to Update
      template - Server Template
      version - Server Version (may be null)
      callback - Callback
      Returns:
      Success Status
    • update

      public boolean update(UUID player, SubServer server, SubCreator.ServerTemplate template, Version version)
      Update a SubServer
      Parameters:
      player - Player Updating
      server - Server to Update
      template - Server Template
      version - Server Version (may be null)
      Returns:
      Success Status
    • update

      public boolean update(SubServer server, SubCreator.ServerTemplate template, Version version, Consumer<Boolean> callback)
      Update a SubServer
      Parameters:
      server - Server to Update
      template - Server Template
      version - Server Version (may be null)
      callback - Callback
      Returns:
      Success Status
    • update

      public boolean update(SubServer server, SubCreator.ServerTemplate template, Version version)
      Update a SubServer
      Parameters:
      server - Server to Update
      template - Server Template
      version - Server Version (may be null)
      Returns:
      Success Status
    • update

      public boolean update(UUID player, SubServer server, Version version)
      Update a SubServer
      Parameters:
      player - Player Updating
      server - Server to Update
      version - Server Version (may be null)
      Returns:
      Success Status
    • update

      public boolean update(SubServer server, Version version)
      Update a SubServer
      Parameters:
      server - Server to Update
      version - Server Version (may be null)
      Returns:
      Success Status
    • terminate

      public abstract void terminate()
      Terminate All SubCreator Instances on this host
    • terminate

      public abstract void terminate(String name)
      Terminate a SubCreator Instance
      Parameters:
      name - Name of current creating server
    • waitFor

      public abstract void waitFor() throws InterruptedException
      Wait for All SubCreator Instances to Finish
      Throws:
      InterruptedException
    • waitFor

      public abstract void waitFor(String name) throws InterruptedException
      Wait for SubCreator to Finish
      Parameters:
      name - Name of current creating server
      Throws:
      InterruptedException
    • getHost

      public abstract Host getHost()
      Gets the host this creator belongs to
      Returns:
      Host
    • getPortRange

      public abstract com.google.common.collect.Range getPortRange()
      Get the range of available port numbers
      Returns:
      Port Range
    • setPortRange

      public abstract void setPortRange(com.google.common.collect.Range<Integer> value)
      Get the range of available port numbers
      Parameters:
      value - Value
    • getBashDirectory

      public abstract String getBashDirectory()
      Gets the Git Bash install directory
      Returns:
      Git Bash Directory
    • getLoggers

      public abstract List<SubLogger> getLoggers()
      Gets all loggers for All SubCreator Instances
      Returns:
      SubCreator Loggers
    • getLogger

      public abstract SubLogger getLogger(String thread)
      Gets the Logger for a SubCreator Instance
      Parameters:
      thread - Thread ID
      Returns:
      SubCreator Logger
    • isLogging

      public abstract boolean isLogging()
      If the Creator is Logging to console
      Returns:
      Logging Status
    • setLogging

      public abstract void setLogging(boolean value)
      Set if the Creator is Logging
      Parameters:
      value - Value
    • getReservedNames

      public abstract List<String> getReservedNames()
      Get a list of currently reserved Server names
      Returns:
      Reserved Names
    • getReservedPorts

      public abstract List<Integer> getReservedPorts()
      Get a list of currently reserved Server ports
      Returns:
      Reserved Ports
    • isReserved

      public static boolean isReserved(String name)
      Check if a name has been reserved
      Parameters:
      name - Name to check
      Returns:
      Reserved Status
    • isReserved

      public static boolean isReserved(InetSocketAddress address)
      Check if an address has been reserved
      Parameters:
      address - Address to check
      Returns:
      Reserved Status
    • getAllReservedNames

      public static Map<Host,List<String>> getAllReservedNames()
      Get a list of all currently reserved Server names across all hosts
      Returns:
      All Reserved Names
    • getAllReservedAddresses

      public static List<InetSocketAddress> getAllReservedAddresses()
      Get a list of all currently reserved Server names across all hosts
      Returns:
      All Reserved Names
    • getTemplates

      public abstract Map<String,SubCreator.ServerTemplate> getTemplates()
      Gets the Templates that can be used in this SubCreator instance
      Returns:
      Template Map
    • getTemplate

      public abstract SubCreator.ServerTemplate getTemplate(String name)
      Gets a SubCreator Template by name
      Parameters:
      name - Template Name
      Returns:
      Template
    • loadTemplate

      protected SubCreator.ServerTemplate loadTemplate(String name, boolean enabled, boolean internal, String icon, File directory, ObjectMap<String> build, ObjectMap<String> options)
      Create a SubCreator Template
      Parameters:
      name - Template Name
      enabled - Template Enabled Status
      internal - Template Internal Status
      icon - Template Item Icon Name
      directory - Template Directory
      build - Build Options
      options - Configuration Options
    • reload

      public abstract void reload()
      Reload SubCreator
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object