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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubServer
(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 boolean
addSubServer
(UUID player, SubServer server) Adds a SubServerboolean
addSubServer
(SubServer server) Adds a SubServerint
Commands the Servers Specifiedint
Commands the Servers Specifiedabstract SubServer
constructSubServer
(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)boolean
deleteSubServer
(String name) Deletes a SubServerboolean
deleteSubServer
(UUID player, String name) Deletes a SubServerprotected abstract boolean
deleteSubServer
(UUID player, String name, boolean forced) Deletes a SubServerboolean
destroy()
Resets this Host objectboolean
boolean
forceDeleteSubServer
(String name) Forces the Deletion of a SubServerboolean
forceDeleteSubServer
(UUID player, String name) Forces the Deletion of a SubServerboolean
forceRecycleSubServer
(String name) Forces the Deletion of a SubServer (will move to 'Recently Deleted')boolean
forceRecycleSubServer
(UUID player, String name) Forces the Deletion of a SubServer (will move to 'Recently Deleted')boolean
forceRemoveSubServer
(String name) Forces the Removal of a SubServerboolean
forceRemoveSubServer
(UUID player, String name) Forces the Removal of a SubServerabstract InetAddress
Get the Address of this Hostabstract SubCreator
Gets the SubCreator Instance for this HostGet the Display Name of this HostgetExtra()
abstract String
getName()
Get the Name of this Hostabstract String
getPath()
Get the host Directory PathGet players on servers provided by this hostGet players on servers provided by this host across all known proxiesfinal String
Get the Signature of this Objectabstract SubServer
getSubServer
(String name) Gets a SubServerGets the SubServers on this Hostboolean
boolean
Is this Host Available?abstract boolean
Is this Host Enabled?boolean
recycleSubServer
(String name) Deletes a SubServer (will move to 'Recently Deleted')boolean
recycleSubServer
(UUID player, String name) Deletes a SubServer (will move to 'Recently Deleted')protected abstract boolean
recycleSubServer
(UUID player, String name, boolean forced) Deletes a SubServer (will move to 'Recently Deleted')void
removeExtra
(String handle) boolean
removeSubServer
(String name) Removes a SubServerboolean
removeSubServer
(UUID player, String name) Removes a SubServerprotected abstract boolean
removeSubServer
(UUID player, String name, boolean forced) Removes a SubServervoid
setDisplayName
(String value) Sets the Display Name for this Hostabstract void
setEnabled
(boolean value) Set if this Host is Enabledint
Starts the Servers Specifiedint
Starts the Servers Specifiedint
Stops the Servers Specifiedint
Stops the Servers Specifiedint
Terminates the Servers Specifiedint
Terminates 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:
addExtra
in interfaceExtraDataHandler<String>
-
hasExtra
- Specified by:
hasExtra
in interfaceExtraDataHandler<String>
-
getExtra
- Specified by:
getExtra
in interfaceExtraDataHandler<String>
-
getExtra
- Specified by:
getExtra
in interfaceExtraDataHandler<String>
-
removeExtra
- Specified by:
removeExtra
in interfaceExtraDataHandler<String>
-
forSubData
-