java.lang.Object
net.ME1312.SubServers.Client.Common.Network.API.Server
net.ME1312.SubServers.Client.Common.Network.API.SubServer

public class SubServer extends Server
Simplified SubServer Data Class
  • Constructor Details

    • SubServer

      public SubServer(ObjectMap<String> raw)
      Create an API representation of a SubServer
      Parameters:
      raw - JSON representation of the SubServer
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Server
    • refresh

      public void refresh()
      Description copied from class: Server
      Download a new copy of the data from SubData
      Overrides:
      refresh in class Server
    • start

      public void start(UUID player, IntConsumer response)
      Starts the Server
      Parameters:
      player - Player who Started
      response - Response Code
    • start

      public void start(IntConsumer response)
      Starts the Server
      Parameters:
      response - Response Code
    • start

      public void start(UUID player)
      Starts the Server
      Parameters:
      player - Player who Started
    • start

      public void start()
      Starts the Server
    • stop

      public void stop(UUID player, IntConsumer response)
      Stops the Server
      Parameters:
      player - Player who Stopped
      response - Response Code
    • stop

      public void stop(IntConsumer response)
      Stops the Server
      Parameters:
      response - Response Code
    • stop

      public void stop(UUID player)
      Stops the Server
      Parameters:
      player - Player who Stopped
    • stop

      public void stop()
      Stops the Server
    • terminate

      public void terminate(UUID player, IntConsumer response)
      Terminates the Server
      Parameters:
      player - Player who Terminated
      response - Response Code
    • terminate

      public void terminate(IntConsumer response)
      Terminates the Server
      Parameters:
      response - Response Code
    • terminate

      public void terminate(UUID player)
      Terminates the Server
      Parameters:
      player - Player who Terminated
    • terminate

      public void terminate()
      Terminates the Server
    • edit

      public void edit(UUID player, ObjectMap<String> edit, IntConsumer response)
      Edits the Server
      Parameters:
      player - Player Editing
      edit - Edits
      response - Negative Response Code -or- Positive Success Status
    • edit

      public void edit(ObjectMap<String> edit, IntConsumer response)
      Edits the Server
      Parameters:
      edit - Edits
      response - Negative Response Code -or- Positive Success Status
    • edit

      public void edit(UUID player, ObjectMap<String> edit)
      Edits the Server
      Parameters:
      player - Player Editing
      edit - Edits
    • edit

      public void edit(ObjectMap<String> edit)
      Edits the Server
      Parameters:
      edit - Edits
    • permaEdit

      public void permaEdit(UUID player, ObjectMap<String> edit, IntConsumer response)
      Edits the Server (& Saves Changes)
      Parameters:
      player - Player Editing
      edit - Edits
      response - Negative Response Code -or- Positive Success Status
    • permaEdit

      public void permaEdit(ObjectMap<String> edit, IntConsumer response)
      Edits the Server (& Saves Changes)
      Parameters:
      edit - Edits
      response - Negative Response Code -or- Positive Success Status
    • permaEdit

      public void permaEdit(UUID player, ObjectMap<String> edit)
      Edits the Server (& Saves Changes)
      Parameters:
      player - Player Editing
      edit - Edits
    • permaEdit

      public void permaEdit(ObjectMap<String> edit)
      Edits the Server (& Saves Changes)
      Parameters:
      edit - Edits
    • isRunning

      public boolean isRunning()
      If the Server is Running
      Returns:
      Running Status
    • isOnline

      public boolean isOnline()
      If the Server is Online
      This method can only be true when a SubData connection is made!
      Returns:
      Online Status
    • isStopping

      public boolean isStopping()
      If the Server is Stopping
      This method can only be true when the server is stopped through the server manager!
      Returns:
      Stopping Status
    • getHost

      public String getHost()
      Grabs the Host of the Server
      Returns:
      The Host Name
    • getHost

      public void getHost(Consumer<Host> callback)
      Grabs the Host of the Server
      Parameters:
      callback - The Host
    • getTemplate

      public String getTemplate()
      Grabs the Template this Server was created from
      Returns:
      The Template
    • getTemplate

      public void getTemplate(Consumer<SubCreator.ServerTemplate> callback)
      Grabs the Template this Server was created from
      Parameters:
      callback - The Template
    • isAvailable

      public boolean isAvailable()
      Is this Server Available?
      Returns:
      Availability Status
    • isEnabled

      public boolean isEnabled()
      If the Server is Enabled
      Returns:
      Enabled Status
    • setEnabled

      public void setEnabled(boolean value)
      Set if the Server is Enabled
      Parameters:
      value - Value
    • setEnabled

      public void setEnabled(boolean value, Consumer<Boolean> response)
      Set if the Server is Enabled
      Parameters:
      value - Value
      response - Success Status
    • isEditable

      public boolean isEditable()
      If the Server is accepting requests to edit()
      Returns:
      Edit Status
    • isLogging

      public boolean isLogging()
      If the Server is Logging
      Returns:
      Logging Status
    • setLogging

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

      public void setLogging(boolean value, Consumer<Boolean> response)
      Set if the Server is Logging
      Parameters:
      value - Value
      response - Success Status
    • getPath

      public String getPath()
      Get the Server Directory Path
      Returns:
      Server Directory Path
    • getExecutable

      public String getExecutable()
      Get the Server's Executable String
      Returns:
      Executable String
    • getStopCommand

      public String getStopCommand()
      Grab the Command to Stop the Server
      Returns:
      Stop Command
    • setStopCommand

      public void setStopCommand(String value)
      Set the Command that Stops the Server
      Parameters:
      value - Value
    • setStopCommand

      public void setStopCommand(String value, Consumer<Boolean> response)
      Set the Command that Stops the Server
      Parameters:
      value - Value
      response - Success Status
    • getStopAction

      public SubServer.StopAction getStopAction()
      Get the action the Server will take when it stops
      Returns:
      Stop Action
    • setStopAction

      public void setStopAction(SubServer.StopAction action)
      Set the action the Server will take when it stops
      Parameters:
      action - Stop Action
    • setStopAction

      public void setStopAction(SubServer.StopAction action, Consumer<Boolean> response)
      Set the action the Server will take when it stops
      Parameters:
      action - Stop Action
      response - Success Status
    • toggleCompatibility

      public void toggleCompatibility(String server)
      Toggles compatibility with other Servers
      Parameters:
      server - SubServer to toggle
    • toggleCompatibility

      public void toggleCompatibility(String server, Consumer<Boolean> response)
      Toggles compatibility with other Servers
      Parameters:
      server - SubServer to toggle
    • isCompatible

      public boolean isCompatible(String server)
      Checks if a Server is compatible
      Parameters:
      server - Server name to check
      Returns:
      Compatible Status
    • getIncompatibilities

      public List<String> getIncompatibilities()
      Get all listed incompatibilities for this Server
      Returns:
      Incompatibility List
    • getIncompatibilities

      public void getIncompatibilities(Consumer<List<SubServer>> callback)
      Get all listed incompatibilities for this Server
      Parameters:
      callback - Incompatibility List
    • getCurrentIncompatibilities

      public List<String> getCurrentIncompatibilities()
      Get incompatibility issues this server currently has
      Returns:
      Current Incompatibility List
    • getCurrentIncompatibilities

      public void getCurrentIncompatibilities(Consumer<List<SubServer>> callback)
      Get incompatibility issues this server currently has
      Parameters:
      callback - Current Incompatibility List
    • setDisplayName

      public void setDisplayName(String value)
      Sets the Display Name for this Server
      Parameters:
      value - Value (or null to reset)
    • setDisplayName

      public void setDisplayName(String value, Consumer<Boolean> response)
      Sets the Display Name for this Server
      Parameters:
      value - Value (or null to reset)
      response - Success Status
    • addGroup

      public void addGroup(String value)
      Add this Server to a Group
      Parameters:
      value - Group name
    • addGroup

      public void addGroup(String value, Consumer<Boolean> response)
      Add this Server to a Group
      Parameters:
      value - Group name
      response - Success Status
    • removeGroup

      public void removeGroup(String value)
      Remove this Server from a Group
      Parameters:
      value - value Group name
    • removeGroup

      public void removeGroup(String value, Consumer<Boolean> response)
      Remove this Server from a Group
      Parameters:
      value - value Group name
      response - Success Status
    • setHidden

      public void setHidden(boolean value)
      Set if the server is hidden from players
      Parameters:
      value - Value
    • setHidden

      public void setHidden(boolean value, Consumer<Boolean> response)
      Set if the server is hidden from players
      Parameters:
      value - Value
      response - Success Status
    • setMotd

      public void setMotd(String value)
      Sets the MOTD of the Server
      Parameters:
      value - Value
    • setMotd

      public void setMotd(String value, Consumer<Boolean> response)
      Sets the MOTD of the Server
      Parameters:
      value - Value
      response - Success Status
    • setRestricted

      public void setRestricted(boolean value)
      Sets if the Server is Restricted
      Parameters:
      value - Value
    • setRestricted

      public void setRestricted(boolean value, Consumer<Boolean> response)
      Sets if the Server is Restricted
      Parameters:
      value - Value
      response - Success Status
    • whitelist

      public void whitelist(UUID player)
      Add a player to the whitelist (for use with restricted servers)
      Parameters:
      player - Player to add
    • whitelist

      public void whitelist(UUID player, Consumer<Boolean> response)
      Add a player to the whitelist (for use with restricted servers)
      Parameters:
      player - Player to add
      response - Success Status
    • unwhitelist

      public void unwhitelist(UUID player)
      Remove a player to the whitelist
      Parameters:
      player - Player to remove
    • unwhitelist

      public void unwhitelist(UUID player, Consumer<Boolean> response)
      Remove a player to the whitelist
      Parameters:
      player - Player to remove
      response - Success Status