Class ExternalHost
java.lang.Object
net.ME1312.SubServers.Bungee.Host.Host
net.ME1312.SubServers.Bungee.Host.External.ExternalHost
- All Implemented Interfaces:
ExtraDataHandler<String>
,ClientHandler
,SubDataSerializable
External Host Class
-
Constructor Summary
ConstructorDescriptionExternalHost
(SubProxy plugin, String name, boolean enabled, com.google.common.collect.Range<Integer> ports, boolean log, InetAddress address, String directory, String gitBash) Creates an External Host -
Method Summary
Modifier and TypeMethodDescriptionboolean
addSubServer
(UUID player, SubServer server) Adds a 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)protected boolean
deleteSubServer
(UUID player, String name, boolean forced) Deletes a SubServerboolean
destroy()
Resets this Host objectGet the Address of this HostGets the SubCreator Instance for this HostgetName()
Get the Name of this HostgetPath()
Get the host Directory PathgetSubServer
(String name) Gets a SubServerGets the SubServers on this Hostboolean
Is this Host Available?boolean
Is this Host Enabled?protected boolean
recycleSubServer
(UUID player, String name, boolean forced) Deletes a SubServer (will move to 'Recently Deleted')void
removeSubData
(DataClient client) protected boolean
removeSubServer
(UUID player, String name, boolean forced) Removes a SubServervoid
setEnabled
(boolean value) Set if this Host is Enabledvoid
setSubData
(DataClient client, int channel) Methods inherited from class net.ME1312.SubServers.Bungee.Host.Host
addExtra, addSubServer, addSubServer, addSubServer, command, command, deleteSubServer, deleteSubServer, equals, forceDeleteSubServer, forceDeleteSubServer, forceRecycleSubServer, forceRecycleSubServer, forceRemoveSubServer, forceRemoveSubServer, getDisplayName, getExtra, getExtra, getPlayers, getRemotePlayers, getSignature, hasExtra, recycleSubServer, recycleSubServer, removeExtra, removeSubServer, removeSubServer, setDisplayName, start, start, stop, stop, terminate, terminate
-
Constructor Details
-
ExternalHost
public ExternalHost(SubProxy plugin, String name, boolean enabled, com.google.common.collect.Range<Integer> ports, boolean log, InetAddress address, String directory, String gitBash) Creates an External Host- 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
-
getSubData
- Specified by:
getSubData
in interfaceClientHandler
-
setSubData
-
removeSubData
- Specified by:
removeSubData
in interfaceClientHandler
-
isAvailable
public boolean isAvailable()Description copied from class:Host
Is this Host Available?- Overrides:
isAvailable
in classHost
- Returns:
- Availability Status
-
isEnabled
public boolean isEnabled()Description copied from class:Host
Is this Host Enabled? -
setEnabled
public void setEnabled(boolean value) Description copied from class:Host
Set if this Host is Enabled- Specified by:
setEnabled
in classHost
- Parameters:
value
- Value
-
getAddress
Description copied from class:Host
Get the Address of this Host- Specified by:
getAddress
in classHost
- Returns:
- Host Address
-
getPath
Description copied from class:Host
Get the host Directory Path -
getName
Description copied from class:Host
Get the Name of this Host -
getCreator
Description copied from class:Host
Gets the SubCreator Instance for this Host- Specified by:
getCreator
in classHost
- Returns:
- SubCreator
-
getSubServers
Description copied from class:Host
Gets the SubServers on this Host- Specified by:
getSubServers
in classHost
- Returns:
- SubServer Map
-
getSubServer
Description copied from class:Host
Gets a SubServer- Specified by:
getSubServer
in classHost
- Parameters:
name
- SubServer Name- Returns:
- a SubServer
-
constructSubServer
public SubServer constructSubServer(String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) throws InvalidServerException Description copied from class:Host
Constructs a SubServer (but doesn't add it to the server manager)- Specified by:
constructSubServer
in classHost
- 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
Description copied from class:Host
Adds a SubServer- Specified by:
addSubServer
in classHost
- Parameters:
player
- Player who addedserver
- SubServer to add- Returns:
- Success status
- Throws:
InvalidServerException
-
removeSubServer
protected boolean removeSubServer(UUID player, String name, boolean forced) throws InterruptedException Description copied from class:Host
Removes a SubServer- Specified by:
removeSubServer
in classHost
- Parameters:
player
- Player Removingname
- SubServer Nameforced
- Forces the Removal- Returns:
- Success Status
- Throws:
InterruptedException
-
recycleSubServer
protected boolean recycleSubServer(UUID player, String name, boolean forced) throws InterruptedException Description copied from class:Host
Deletes a SubServer (will move to 'Recently Deleted')- Specified by:
recycleSubServer
in classHost
- Parameters:
player
- Player Deletingname
- SubServer Nameforced
- Forces the Deletion- Returns:
- Success Status
- Throws:
InterruptedException
-
deleteSubServer
protected boolean deleteSubServer(UUID player, String name, boolean forced) throws InterruptedException Description copied from class:Host
Deletes a SubServer- Specified by:
deleteSubServer
in classHost
- Parameters:
player
- Player Deletingname
- SubServer Nameforced
- Forces the Deletion- Returns:
- Success Status
- Throws:
InterruptedException
-
destroy
public boolean destroy()Description copied from class:Host
Resets this Host object -
forSubData
- Specified by:
forSubData
in interfaceClientHandler
- Specified by:
forSubData
in interfaceSubDataSerializable
- Overrides:
forSubData
in classHost
-