Class SubServerController
java.lang.Object
net.ME1312.SubServers.Bungee.Host.SubServerController
API-Safe SubServer Layout Class
-
Constructor Summary
ConstructorDescriptionSubServerController
(Host host, String name, int port, String motd, boolean hidden, boolean restricted) Creates a SubServer -
Method Summary
Modifier and TypeMethodDescriptionboolean
Commands the Serverabstract boolean
Commands the Serverprotected int
Edits the Serverget()
Get the SubServer that is being controlledabstract LinkedList<SubServer.LoggedCommand>
Gets all the commands that were sent to this Server successfullyabstract String
Get the Server's Executable Stringabstract Host
getHost()
Grabs the Host of the Serverabstract SubLogger
Get Process Loggerabstract String
getPath()
Get the Server Directory Pathabstract SubServer.StopAction
Get the action the Server will take when it stopsabstract String
Grab the Command to Stop the Serverabstract boolean
If the Server is Enabledabstract boolean
If the Server is Loggingabstract boolean
If the Server is Runningabstract void
setEnabled
(boolean value) Set if the Server is Enabledabstract void
setLogging
(boolean value) Set if the Server is Loggingabstract void
setStopAction
(SubServer.StopAction action) Set the action the Server will take when it stopsabstract void
setStopCommand
(String value) Set the Command that Stops the Serverboolean
start()
Starts the Serverabstract boolean
Starts the Serverboolean
stop()
Stops the Serverabstract boolean
Stops the Serverboolean
Terminates the Serverabstract boolean
Terminates the Serverabstract void
waitFor()
Waits for the Server to Stop
-
Constructor Details
-
SubServerController
public SubServerController(Host host, String name, int port, String motd, boolean hidden, boolean restricted) throws InvalidServerException Creates a SubServer- Parameters:
host
- Hostname
- Server Nameport
- Port Numbermotd
- Server MOTDrestricted
- Players will need a permission to join if true- Throws:
InvalidServerException
-
-
Method Details
-
get
Get the SubServer that is being controlled- Returns:
- SubServer
-
start
Starts the Server- Parameters:
player
- Player who Started- Returns:
- Success Status
-
start
public boolean start()Starts the Server- Returns:
- Success Status
-
stop
Stops the Server- Parameters:
player
- Player who Stopped- Returns:
- Success Status
-
stop
public boolean stop()Stops the Server- Returns:
- Success Status
-
terminate
Terminates the Server- Parameters:
player
- Player who Terminated- Returns:
- Success Status
-
terminate
public boolean terminate()Terminates the Server- Returns:
- Success Status
-
command
Commands the Server- Parameters:
player
- Player who's Commandingcommand
- Command to Send- Returns:
- Success Status
-
command
Commands the Server- Parameters:
command
- Command to Send- Returns:
- Success Status
-
edit
Edits the Server- Parameters:
player
- Player Editingedit
- Editsperma
- Saves Changes- Returns:
- Success Status
-
waitFor
Waits for the Server to Stop- Throws:
InterruptedException
-
isRunning
public abstract boolean isRunning()If the Server is Running- Returns:
- Running Status
-
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
Get Process Logger -
getCommandHistory
Gets all the commands that were sent to this Server successfully- Returns:
- Command History
-
getPath
Get the Server Directory Path- Returns:
- Server Directory Path
-
getExecutable
Get the Server's Executable String- Returns:
- Executable String
-
getStopCommand
Grab the Command to Stop the Server- Returns:
- Stop Command
-
setStopCommand
Set the Command that Stops the Server- Parameters:
value
- Value
-
getStopAction
Get the action the Server will take when it stops- Returns:
- Stop Action
-
setStopAction
Set the action the Server will take when it stops- Parameters:
action
- Stop Action
-