Class Host
java.lang.Object
net.ME1312.SubServers.Bungee.Host.Host
- All Implemented Interfaces:
ExtraDataHandler<String>
- Direct Known Subclasses:
ExternalHost,InternalHost
Host Layout Class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubServer(String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) Adds a SubServeraddSubServer(UUID player, String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) Adds a SubServerabstract booleanaddSubServer(UUID player, SubServer server) Adds a SubServerbooleanaddSubServer(SubServer server) Adds a SubServerintCommands the Servers SpecifiedintCommands the Servers Specifiedabstract SubServerconstructSubServer(String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) Constructs a SubServer (but doesn't add it to the server manager)booleandeleteSubServer(String name) Deletes a SubServerbooleandeleteSubServer(UUID player, String name) Deletes a SubServerprotected abstract booleandeleteSubServer(UUID player, String name, boolean forced) Deletes a SubServerbooleandestroy()Resets this Host objectbooleanbooleanforceDeleteSubServer(String name) Forces the Deletion of a SubServerbooleanforceDeleteSubServer(UUID player, String name) Forces the Deletion of a SubServerbooleanforceRecycleSubServer(String name) Forces the Deletion of a SubServer (will move to 'Recently Deleted')booleanforceRecycleSubServer(UUID player, String name) Forces the Deletion of a SubServer (will move to 'Recently Deleted')booleanforceRemoveSubServer(String name) Forces the Removal of a SubServerbooleanforceRemoveSubServer(UUID player, String name) Forces the Removal of a SubServerabstract InetAddressGet the Address of this Hostabstract SubCreatorGets the SubCreator Instance for this HostGet the Display Name of this HostgetExtra()abstract StringgetName()Get the Name of this Hostabstract StringgetPath()Get the host Directory PathGet players on servers provided by this hostGet players on servers provided by this host across all known proxiesfinal StringGet the Signature of this Objectabstract SubServergetSubServer(String name) Gets a SubServerGets the SubServers on this HostbooleanbooleanIs this Host Available?abstract booleanIs this Host Enabled?booleanrecycleSubServer(String name) Deletes a SubServer (will move to 'Recently Deleted')booleanrecycleSubServer(UUID player, String name) Deletes a SubServer (will move to 'Recently Deleted')protected abstract booleanrecycleSubServer(UUID player, String name, boolean forced) Deletes a SubServer (will move to 'Recently Deleted')voidremoveExtra(String handle) booleanremoveSubServer(String name) Removes a SubServerbooleanremoveSubServer(UUID player, String name) Removes a SubServerprotected abstract booleanremoveSubServer(UUID player, String name, boolean forced) Removes a SubServervoidsetDisplayName(String value) Sets the Display Name for this Hostabstract voidsetEnabled(boolean value) Set if this Host is EnabledintStarts the Servers SpecifiedintStarts the Servers SpecifiedintStops the Servers SpecifiedintStops the Servers SpecifiedintTerminates the Servers SpecifiedintTerminates the Servers Specified
-
Constructor Details
-
Host
public Host(SubProxy plugin, String name, boolean enabled, com.google.common.collect.Range<Integer> ports, boolean log, InetAddress address, String directory, String gitBash) This constructor is required to launch your host from the drivers list. Do not add or remove any arguments.- Parameters:
plugin- SubServers Internalsname- The Name of your Hostports- The range of ports to auto-select fromlog- Whether apps like SubCreator should log to console (does not apply to servers)enabled- If your host is Enabledaddress- The address of your Hostdirectory- The runtime directory of your HostgitBash- The Git Bash directory
-
-
Method Details
-
isAvailable
public boolean isAvailable()Is this Host Available?- Returns:
- Availability Status
-
isEnabled
public abstract boolean isEnabled()Is this Host Enabled?- Returns:
- Enabled Status
-
setEnabled
public abstract void setEnabled(boolean value) Set if this Host is Enabled- Parameters:
value- Value
-
getAddress
Get the Address of this Host- Returns:
- Host Address
-
getPath
Get the host Directory Path- Returns:
- Host Directory Path
-
getName
Get the Name of this Host- Returns:
- Host Name
-
getDisplayName
Get the Display Name of this Host- Returns:
- Display Name
-
setDisplayName
Sets the Display Name for this Host- Parameters:
value- Value (or null to reset)
-
getPlayers
Get players on servers provided by this host- Returns:
- Local Player Collection
-
getRemotePlayers
Get players on servers provided by this host across all known proxies- Returns:
- Remote Player Collection
-
start
Starts the Servers Specified- Parameters:
servers- Servers- Returns:
- Success Status
-
start
Starts the Servers Specified- Parameters:
player- Player who startedservers- Servers- Returns:
- Success Status
-
stop
Stops the Servers Specified- Parameters:
servers- Servers- Returns:
- Success Status
-
stop
Stops the Servers Specified- Parameters:
player- Player who startedservers- Servers- Returns:
- Success Status
-
terminate
Terminates the Servers Specified- Parameters:
servers- Servers- Returns:
- Success Status
-
terminate
Terminates the Servers Specified- Parameters:
player- Player who startedservers- Servers- Returns:
- Success Status
-
command
Commands the Servers Specified- Parameters:
command- Command to sendservers- Servers- Returns:
- Success Status
-
command
Commands the Servers Specified- Parameters:
player- Player who startedcommand- Command to sendservers- Servers- Returns:
- Success Status
-
getCreator
Gets the SubCreator Instance for this Host- Returns:
- SubCreator
-
getSubServers
Gets the SubServers on this Host- Returns:
- SubServer Map
-
getSubServer
Gets a SubServer- Parameters:
name- SubServer Name- Returns:
- a SubServer
-
constructSubServer
public abstract SubServer constructSubServer(String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) throws InvalidServerException Constructs a SubServer (but doesn't add it to the server manager)- Parameters:
name- Name of Serverenabled- Enabled Statusport- Port Numbermotd- Motd of the Serverlog- Logging Statusdirectory- Directoryexecutable- Executable Stringstopcmd- Command to Stop the Serverhidden- if the server should be hidden from playersrestricted- Players will need a permission to join if true- Returns:
- The SubServer
- Throws:
InvalidServerException
-
addSubServer
public SubServer addSubServer(String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) throws InvalidServerException Adds a SubServer- Parameters:
name- Name of Serverenabled- Enabled Statusport- Port Numbermotd- Motd of the Serverlog- Logging Statusdirectory- Directoryexecutable- Executable Stringstopcmd- Command to Stop the Serverhidden- if the server should be hidden from playersrestricted- Players will need a permission to join if true- Returns:
- The SubServer
- Throws:
InvalidServerException
-
addSubServer
public SubServer addSubServer(UUID player, String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) throws InvalidServerException Adds a SubServer- Parameters:
player- Player who Addedname- Name of Serverenabled- Enabled Statusport- Port Numbermotd- Motd of the Serverlog- Logging Statusdirectory- Directoryexecutable- Executable Stringstopcmd- Command to Stop the Serverhidden- if the server should be hidden from playersrestricted- Players will need a permission to join if true- Returns:
- The SubServer
- Throws:
InvalidServerException
-
addSubServer
Adds a SubServer- Parameters:
server- SubServer to add- Returns:
- Success status
- Throws:
InvalidServerException
-
addSubServer
Adds a SubServer- Parameters:
player- Player who addedserver- SubServer to add- Returns:
- Success status
- Throws:
InvalidServerException
-
removeSubServer
Removes a SubServer- Parameters:
name- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
removeSubServer
Removes a SubServer- Parameters:
player- Player Removingname- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
removeSubServer
protected abstract boolean removeSubServer(UUID player, String name, boolean forced) throws InterruptedException Removes a SubServer- Parameters:
player- Player Removingname- SubServer Nameforced- Forces the Removal- Returns:
- Success Status
- Throws:
InterruptedException
-
forceRemoveSubServer
Forces the Removal of a SubServer- Parameters:
name- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
forceRemoveSubServer
Forces the Removal of a SubServer- Parameters:
player- Player Removingname- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
recycleSubServer
Deletes a SubServer (will move to 'Recently Deleted')- Parameters:
name- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
recycleSubServer
Deletes a SubServer (will move to 'Recently Deleted')- Parameters:
player- Player Deletingname- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
recycleSubServer
protected abstract boolean recycleSubServer(UUID player, String name, boolean forced) throws InterruptedException Deletes a SubServer (will move to 'Recently Deleted')- Parameters:
player- Player Deletingname- SubServer Nameforced- Forces the Deletion- Returns:
- Success Status
- Throws:
InterruptedException
-
forceRecycleSubServer
Forces the Deletion of a SubServer (will move to 'Recently Deleted')- Parameters:
name- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
forceRecycleSubServer
Forces the Deletion of a SubServer (will move to 'Recently Deleted')- Parameters:
player- Player Deletingname- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
deleteSubServer
Deletes a SubServer- Parameters:
name- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
deleteSubServer
Deletes a SubServer- Parameters:
player- Player Deletingname- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
deleteSubServer
protected abstract boolean deleteSubServer(UUID player, String name, boolean forced) throws InterruptedException Deletes a SubServer- Parameters:
player- Player Deletingname- SubServer Nameforced- Forces the Deletion- Returns:
- Success Status
- Throws:
InterruptedException
-
forceDeleteSubServer
Forces the Deletion of a SubServer- Parameters:
name- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
forceDeleteSubServer
Forces the Deletion of a SubServer- Parameters:
player- Player Deletingname- SubServer Name- Returns:
- Success Status
- Throws:
InterruptedException
-
destroy
public boolean destroy()Resets this Host object- Returns:
- Success Status
-
getSignature
Get the Signature of this Object- Returns:
- Object Signature
-
equals
-
addExtra
- Specified by:
addExtrain interfaceExtraDataHandler<String>
-
hasExtra
- Specified by:
hasExtrain interfaceExtraDataHandler<String>
-
getExtra
- Specified by:
getExtrain interfaceExtraDataHandler<String>
-
getExtra
- Specified by:
getExtrain interfaceExtraDataHandler<String>
-
removeExtra
- Specified by:
removeExtrain interfaceExtraDataHandler<String>
-
forSubData
-