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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd this Server to a GroupvoidAdd this Server to a GroupvoidEdits the Servervoidedit(UUID player, ObjectMap<String> edit, IntConsumer response) Edits the ServervoidEdits the Servervoidedit(ObjectMap<String> edit, IntConsumer response) Edits the ServerbooleanGet incompatibility issues this server currently hasvoidgetCurrentIncompatibilities(Consumer<List<SubServer>> callback) Get incompatibility issues this server currently hasGet the Server's Executable StringgetHost()Grabs the Host of the ServervoidGrabs the Host of the ServerGet all listed incompatibilities for this ServervoidgetIncompatibilities(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 fromvoidgetTemplate(Consumer<SubCreator.ServerTemplate> callback) Grabs the Template this Server was created frombooleanIs this Server Available?booleanisCompatible(String server) Checks if a Server is compatiblebooleanIf the Server is accepting requests to edit()booleanIf the Server is EnabledbooleanIf the Server is LoggingbooleanisOnline()If the Server is Online
This method can only be true when a SubData connection is made!booleanIf the Server is RunningbooleanIf the Server is Stopping
This method can only be true when the server is stopped through the server manager!voidEdits the Server (& Saves Changes)voidpermaEdit(UUID player, ObjectMap<String> edit, IntConsumer response) Edits the Server (& Saves Changes)voidEdits the Server (& Saves Changes)voidpermaEdit(ObjectMap<String> edit, IntConsumer response) Edits the Server (& Saves Changes)voidrefresh()Download a new copy of the data from SubDatavoidremoveGroup(String value) Remove this Server from a GroupvoidremoveGroup(String value, Consumer<Boolean> response) Remove this Server from a GroupvoidsetDisplayName(String value) Sets the Display Name for this ServervoidsetDisplayName(String value, Consumer<Boolean> response) Sets the Display Name for this ServervoidsetEnabled(boolean value) Set if the Server is EnabledvoidsetEnabled(boolean value, Consumer<Boolean> response) Set if the Server is EnabledvoidsetHidden(boolean value) Set if the server is hidden from playersvoidSet if the server is hidden from playersvoidsetLogging(boolean value) Set if the Server is LoggingvoidsetLogging(boolean value, Consumer<Boolean> response) Set if the Server is LoggingvoidSets the MOTD of the ServervoidSets the MOTD of the ServervoidsetRestricted(boolean value) Sets if the Server is RestrictedvoidsetRestricted(boolean value, Consumer<Boolean> response) Sets if the Server is RestrictedvoidsetStopAction(SubServer.StopAction action) Set the action the Server will take when it stopsvoidsetStopAction(SubServer.StopAction action, Consumer<Boolean> response) Set the action the Server will take when it stopsvoidsetStopCommand(String value) Set the Command that Stops the ServervoidsetStopCommand(String value, Consumer<Boolean> response) Set the Command that Stops the Servervoidstart()Starts the Servervoidstart(IntConsumer response) Starts the ServervoidStarts the Servervoidstart(UUID player, IntConsumer response) Starts the Servervoidstop()Stops the Servervoidstop(IntConsumer response) Stops the ServervoidStops the Servervoidstop(UUID player, IntConsumer response) Stops the ServervoidTerminates the Servervoidterminate(IntConsumer response) Terminates the ServervoidTerminates the Servervoidterminate(UUID player, IntConsumer response) Terminates the ServervoidtoggleCompatibility(String server) Toggles compatibility with other ServersvoidtoggleCompatibility(String server, Consumer<Boolean> response) Toggles compatibility with other Serversvoidunwhitelist(UUID player) Remove a player to the whitelistvoidunwhitelist(UUID player, Consumer<Boolean> response) Remove a player to the whitelistvoidAdd a player to the whitelist (for use with restricted servers)voidAdd 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:ServerDownload 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
-