Class SubServerController

java.lang.Object
net.ME1312.SubServers.Bungee.Host.SubServerController

public abstract class SubServerController extends Object
API-Safe SubServer Layout Class
  • Constructor Details

    • SubServerController

      public SubServerController(Host host, String name, int port, String motd, boolean hidden, boolean restricted) throws InvalidServerException
      Creates a SubServer
      Parameters:
      host - Host
      name - Server Name
      port - Port Number
      motd - Server MOTD
      restricted - Players will need a permission to join if true
      Throws:
      InvalidServerException
  • Method Details

    • get

      public SubServer get()
      Get the SubServer that is being controlled
      Returns:
      SubServer
    • start

      public abstract boolean start(UUID player)
      Starts the Server
      Parameters:
      player - Player who Started
      Returns:
      Success Status
    • start

      public boolean start()
      Starts the Server
      Returns:
      Success Status
    • stop

      public abstract boolean stop(UUID player)
      Stops the Server
      Parameters:
      player - Player who Stopped
      Returns:
      Success Status
    • stop

      public boolean stop()
      Stops the Server
      Returns:
      Success Status
    • terminate

      public abstract boolean terminate(UUID player)
      Terminates the Server
      Parameters:
      player - Player who Terminated
      Returns:
      Success Status
    • terminate

      public boolean terminate()
      Terminates the Server
      Returns:
      Success Status
    • command

      public abstract boolean command(UUID player, String command)
      Commands the Server
      Parameters:
      player - Player who's Commanding
      command - Command to Send
      Returns:
      Success Status
    • command

      public boolean command(String command)
      Commands the Server
      Parameters:
      command - Command to Send
      Returns:
      Success Status
    • edit

      protected int edit(UUID player, ObjectMap<String> edit, boolean perma)
      Edits the Server
      Parameters:
      player - Player Editing
      edit - Edits
      perma - Saves Changes
      Returns:
      Success Status
    • waitFor

      public abstract void waitFor() throws InterruptedException
      Waits for the Server to Stop
      Throws:
      InterruptedException
    • isRunning

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

      public abstract Host getHost()
      Grabs the Host of the Server
      Returns:
      The Host
    • isEnabled

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

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

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

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

      public abstract SubLogger getLogger()
      Get Process Logger
    • getCommandHistory

      public abstract LinkedList<SubServer.LoggedCommand> getCommandHistory()
      Gets all the commands that were sent to this Server successfully
      Returns:
      Command History
    • getPath

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

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

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

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

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

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