Class SubServer
java.lang.Object
net.ME1312.SubServers.Client.Common.Network.API.Server
net.ME1312.SubServers.Client.Common.Network.API.SubServer
Simplified SubServer Data Class
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add this Server to a Groupvoid
Add this Server to a Groupvoid
Edits the Servervoid
edit
(UUID player, ObjectMap<String> edit, IntConsumer response) Edits the Servervoid
Edits the Servervoid
edit
(ObjectMap<String> edit, IntConsumer response) Edits the Serverboolean
Get incompatibility issues this server currently hasvoid
getCurrentIncompatibilities
(Consumer<List<SubServer>> callback) Get incompatibility issues this server currently hasGet the Server's Executable StringgetHost()
Grabs the Host of the Servervoid
Grabs the Host of the ServerGet all listed incompatibilities for this Servervoid
getIncompatibilities
(Consumer<List<SubServer>> callback) Get all listed incompatibilities for this ServergetPath()
Get the Server Directory PathGet the action the Server will take when it stopsGrab the Command to Stop the ServerGrabs the Template this Server was created fromvoid
getTemplate
(Consumer<SubCreator.ServerTemplate> callback) Grabs the Template this Server was created fromboolean
Is this Server Available?boolean
isCompatible
(String server) Checks if a Server is compatibleboolean
If the Server is accepting requests to edit()boolean
If the Server is Enabledboolean
If the Server is Loggingboolean
isOnline()
If the Server is Online
This method can only be true when a SubData connection is made!boolean
If the Server is Runningboolean
If the Server is Stopping
This method can only be true when the server is stopped through the server manager!void
Edits the Server (& Saves Changes)void
permaEdit
(UUID player, ObjectMap<String> edit, IntConsumer response) Edits the Server (& Saves Changes)void
Edits the Server (& Saves Changes)void
permaEdit
(ObjectMap<String> edit, IntConsumer response) Edits the Server (& Saves Changes)void
refresh()
Download a new copy of the data from SubDatavoid
removeGroup
(String value) Remove this Server from a Groupvoid
removeGroup
(String value, Consumer<Boolean> response) Remove this Server from a Groupvoid
setDisplayName
(String value) Sets the Display Name for this Servervoid
setDisplayName
(String value, Consumer<Boolean> response) Sets the Display Name for this Servervoid
setEnabled
(boolean value) Set if the Server is Enabledvoid
setEnabled
(boolean value, Consumer<Boolean> response) Set if the Server is Enabledvoid
setHidden
(boolean value) Set if the server is hidden from playersvoid
Set if the server is hidden from playersvoid
setLogging
(boolean value) Set if the Server is Loggingvoid
setLogging
(boolean value, Consumer<Boolean> response) Set if the Server is Loggingvoid
Sets the MOTD of the Servervoid
Sets the MOTD of the Servervoid
setRestricted
(boolean value) Sets if the Server is Restrictedvoid
setRestricted
(boolean value, Consumer<Boolean> response) Sets if the Server is Restrictedvoid
setStopAction
(SubServer.StopAction action) Set the action the Server will take when it stopsvoid
setStopAction
(SubServer.StopAction action, Consumer<Boolean> response) Set the action the Server will take when it stopsvoid
setStopCommand
(String value) Set the Command that Stops the Servervoid
setStopCommand
(String value, Consumer<Boolean> response) Set the Command that Stops the Servervoid
start()
Starts the Servervoid
start
(IntConsumer response) Starts the Servervoid
Starts the Servervoid
start
(UUID player, IntConsumer response) Starts the Servervoid
stop()
Stops the Servervoid
stop
(IntConsumer response) Stops the Servervoid
Stops the Servervoid
stop
(UUID player, IntConsumer response) Stops the Servervoid
Terminates the Servervoid
terminate
(IntConsumer response) Terminates the Servervoid
Terminates the Servervoid
terminate
(UUID player, IntConsumer response) Terminates the Servervoid
toggleCompatibility
(String server) Toggles compatibility with other Serversvoid
toggleCompatibility
(String server, Consumer<Boolean> response) Toggles compatibility with other Serversvoid
unwhitelist
(UUID player) Remove a player to the whitelistvoid
unwhitelist
(UUID player, Consumer<Boolean> response) Remove a player to the whitelistvoid
Add a player to the whitelist (for use with restricted servers)void
Add a player to the whitelist (for use with restricted servers)Methods inherited from class net.ME1312.SubServers.Client.Common.Network.API.Server
command, command, command, command, command, command, getAddress, getDisplayName, getGroups, getMotd, getName, getRaw, getRemotePlayers, getRemotePlayers, getSignature, getSubData, getTimestamp, getWhitelist, isHidden, isRestricted, isWhitelisted
-
Constructor Details
-
SubServer
Create an API representation of a SubServer- Parameters:
raw
- JSON representation of the SubServer
-
-
Method Details
-
equals
-
refresh
public void refresh()Description copied from class:Server
Download a new copy of the data from SubData -
start
Starts the Server- Parameters:
player
- Player who Startedresponse
- Response Code
-
start
Starts the Server- Parameters:
response
- Response Code
-
start
Starts the Server- Parameters:
player
- Player who Started
-
start
public void start()Starts the Server -
stop
Stops the Server- Parameters:
player
- Player who Stoppedresponse
- Response Code
-
stop
Stops the Server- Parameters:
response
- Response Code
-
stop
Stops the Server- Parameters:
player
- Player who Stopped
-
stop
public void stop()Stops the Server -
terminate
Terminates the Server- Parameters:
player
- Player who Terminatedresponse
- Response Code
-
terminate
Terminates the Server- Parameters:
response
- Response Code
-
terminate
Terminates the Server- Parameters:
player
- Player who Terminated
-
terminate
public void terminate()Terminates the Server -
edit
Edits the Server- Parameters:
player
- Player Editingedit
- Editsresponse
- Negative Response Code -or- Positive Success Status
-
edit
Edits the Server- Parameters:
edit
- Editsresponse
- Negative Response Code -or- Positive Success Status
-
edit
Edits the Server- Parameters:
player
- Player Editingedit
- Edits
-
edit
Edits the Server- Parameters:
edit
- Edits
-
permaEdit
Edits the Server (& Saves Changes)- Parameters:
player
- Player Editingedit
- Editsresponse
- Negative Response Code -or- Positive Success Status
-
permaEdit
Edits the Server (& Saves Changes)- Parameters:
edit
- Editsresponse
- Negative Response Code -or- Positive Success Status
-
permaEdit
Edits the Server (& Saves Changes)- Parameters:
player
- Player Editingedit
- Edits
-
permaEdit
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
Grabs the Host of the Server- Returns:
- The Host Name
-
getHost
Grabs the Host of the Server- Parameters:
callback
- The Host
-
getTemplate
Grabs the Template this Server was created from- Returns:
- The Template
-
getTemplate
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
Set if the Server is Enabled- Parameters:
value
- Valueresponse
- 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
Set if the Server is Logging- Parameters:
value
- Valueresponse
- Success Status
-
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
-
setStopCommand
Set the Command that Stops the Server- Parameters:
value
- Valueresponse
- Success Status
-
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
-
setStopAction
Set the action the Server will take when it stops- Parameters:
action
- Stop Actionresponse
- Success Status
-
toggleCompatibility
Toggles compatibility with other Servers- Parameters:
server
- SubServer to toggle
-
toggleCompatibility
Toggles compatibility with other Servers- Parameters:
server
- SubServer to toggle
-
isCompatible
Checks if a Server is compatible- Parameters:
server
- Server name to check- Returns:
- Compatible Status
-
getIncompatibilities
Get all listed incompatibilities for this Server- Returns:
- Incompatibility List
-
getIncompatibilities
Get all listed incompatibilities for this Server- Parameters:
callback
- Incompatibility List
-
getCurrentIncompatibilities
Get incompatibility issues this server currently has- Returns:
- Current Incompatibility List
-
getCurrentIncompatibilities
Get incompatibility issues this server currently has- Parameters:
callback
- Current Incompatibility List
-
setDisplayName
Sets the Display Name for this Server- Parameters:
value
- Value (or null to reset)
-
setDisplayName
Sets the Display Name for this Server- Parameters:
value
- Value (or null to reset)response
- Success Status
-
addGroup
Add this Server to a Group- Parameters:
value
- Group name
-
addGroup
Add this Server to a Group- Parameters:
value
- Group nameresponse
- Success Status
-
removeGroup
Remove this Server from a Group- Parameters:
value
- value Group name
-
removeGroup
Remove this Server from a Group- Parameters:
value
- value Group nameresponse
- Success Status
-
setHidden
public void setHidden(boolean value) Set if the server is hidden from players- Parameters:
value
- Value
-
setHidden
Set if the server is hidden from players- Parameters:
value
- Valueresponse
- Success Status
-
setMotd
Sets the MOTD of the Server- Parameters:
value
- Value
-
setMotd
Sets the MOTD of the Server- Parameters:
value
- Valueresponse
- Success Status
-
setRestricted
public void setRestricted(boolean value) Sets if the Server is Restricted- Parameters:
value
- Value
-
setRestricted
Sets if the Server is Restricted- Parameters:
value
- Valueresponse
- Success Status
-
whitelist
Add a player to the whitelist (for use with restricted servers)- Parameters:
player
- Player to add
-
whitelist
Add a player to the whitelist (for use with restricted servers)- Parameters:
player
- Player to addresponse
- Success Status
-
unwhitelist
Remove a player to the whitelist- Parameters:
player
- Player to remove
-
unwhitelist
Remove a player to the whitelist- Parameters:
player
- Player to removeresponse
- Success Status
-