public abstract class Host extends java.lang.Object implements ExtraDataHandler
Constructor and Description |
---|
Host(SubPlugin plugin,
java.lang.String name,
java.lang.Boolean enabled,
java.net.InetAddress address,
java.lang.String directory,
java.lang.String gitBash)
This constructor is required to launch your host from the drivers list.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtra(java.lang.String handle,
java.lang.Object value)
Add an extra value to this Server
|
SubServer |
addSubServer(java.lang.String name,
boolean enabled,
int port,
java.lang.String motd,
boolean log,
java.lang.String directory,
Executable executable,
java.lang.String stopcmd,
boolean start,
boolean restart,
boolean hidden,
boolean restricted,
boolean temporary)
Adds a SubServer
|
abstract SubServer |
addSubServer(java.util.UUID player,
java.lang.String name,
boolean enabled,
int port,
java.lang.String motd,
boolean log,
java.lang.String directory,
Executable executable,
java.lang.String stopcmd,
boolean start,
boolean restart,
boolean hidden,
boolean restricted,
boolean temporary)
Adds a SubServer
|
int |
command(java.lang.String command,
java.lang.String... servers)
Commands the Servers Specified
|
int |
command(java.util.UUID player,
java.lang.String command,
java.lang.String... servers)
Commands the Servers Specified
|
boolean |
forceRemoveSubServer(java.lang.String name)
Forces the Removal of a SubServer
|
abstract boolean |
forceRemoveSubServer(java.util.UUID player,
java.lang.String name)
Forces the Removal of a SubServer
|
abstract java.net.InetAddress |
getAddress()
Get the Address of this Host
|
abstract SubCreator |
getCreator()
Gets the SubCreator Instance for this Host
|
abstract java.lang.String |
getDirectory()
Get the Directory of this Host
|
java.lang.String |
getDisplayName()
Get the Display Name of this Host
|
YAMLSection |
getExtra()
Get the extra value section
|
YAMLValue |
getExtra(java.lang.String handle)
Get an extra value
|
abstract java.lang.String |
getName()
Get the Name of this Host
|
abstract SubServer |
getSubServer(java.lang.String name)
Gets a SubServer
|
abstract java.util.Map<java.lang.String,? extends SubServer> |
getSubServers()
Gets the SubServers on this Host
|
boolean |
hasExtra(java.lang.String handle)
Determine if an extra value exists
|
abstract boolean |
isEnabled()
Is this Host Enabled?
|
void |
removeExtra(java.lang.String handle)
Remove an extra value from this Server
|
boolean |
removeSubServer(java.lang.String name)
Removes a SubServer
|
abstract boolean |
removeSubServer(java.util.UUID player,
java.lang.String name)
Removes a SubServer
|
void |
setDisplayName(java.lang.String value)
Sets the Display Name for this Host
|
abstract void |
setEnabled(boolean value)
Set if this Host is Enabled
|
int |
start(java.lang.String... servers)
Starts the Servers Specified
|
int |
start(java.util.UUID player,
java.lang.String... servers)
Starts the Servers Specified
|
int |
stop(java.lang.String... servers)
Stops the Servers Specified
|
int |
stop(java.util.UUID player,
java.lang.String... servers)
Stops the Servers Specified
|
int |
terminate(java.lang.String... servers)
Terminates the Servers Specified
|
int |
terminate(java.util.UUID player,
java.lang.String... servers)
Terminates the Servers Specified
|
public Host(SubPlugin plugin, java.lang.String name, java.lang.Boolean enabled, java.net.InetAddress address, java.lang.String directory, java.lang.String gitBash)
plugin
- SubServers Internalsname
- The Name of your Hostenabled
- If your host is Enabledaddress
- The address of your Hostdirectory
- The runtime directory of your HostgitBash
- The Git Bash directorypublic abstract boolean isEnabled()
public abstract void setEnabled(boolean value)
value
- Valuepublic abstract java.net.InetAddress getAddress()
public abstract java.lang.String getDirectory()
public abstract java.lang.String getName()
public java.lang.String getDisplayName()
public void setDisplayName(java.lang.String value)
value
- Value (or null to reset)public int start(java.lang.String... servers)
servers
- Serverspublic int start(java.util.UUID player, java.lang.String... servers)
player
- Player who startedservers
- Serverspublic int stop(java.lang.String... servers)
servers
- Serverspublic int stop(java.util.UUID player, java.lang.String... servers)
player
- Player who startedservers
- Serverspublic int terminate(java.lang.String... servers)
servers
- Serverspublic int terminate(java.util.UUID player, java.lang.String... servers)
player
- Player who startedservers
- Serverspublic int command(java.lang.String command, java.lang.String... servers)
command
- Command to sendservers
- Serverspublic int command(java.util.UUID player, java.lang.String command, java.lang.String... servers)
player
- Player who startedcommand
- Command to sendservers
- Serverspublic abstract SubCreator getCreator()
public abstract java.util.Map<java.lang.String,? extends SubServer> getSubServers()
public abstract SubServer getSubServer(java.lang.String name)
name
- SubServer Namepublic abstract SubServer addSubServer(java.util.UUID player, java.lang.String name, boolean enabled, int port, java.lang.String motd, boolean log, java.lang.String directory, Executable executable, java.lang.String stopcmd, boolean start, boolean restart, boolean hidden, boolean restricted, boolean temporary) throws InvalidServerException
player
- Player who Addedname
- Name of Serverenabled
- Enabled Statusport
- Port Numbermotd
- Motd of the Serverlog
- Logging Statusdirectory
- Directoryexecutable
- Executablestopcmd
- Command to Stop the Serverrestart
- Auto Restart Statushidden
- if the server should be hidden from playersrestricted
- Players will need a permission to join if truetemporary
- Temporary StatusInvalidServerException
public SubServer addSubServer(java.lang.String name, boolean enabled, int port, java.lang.String motd, boolean log, java.lang.String directory, Executable executable, java.lang.String stopcmd, boolean start, boolean restart, boolean hidden, boolean restricted, boolean temporary) throws InvalidServerException
name
- Name of Serverenabled
- Enabled Statusport
- Port Numbermotd
- Motd of the Serverlog
- Logging Statusdirectory
- Directoryexecutable
- Executablestopcmd
- Command to Stop the Serverrestart
- Auto Restart Statushidden
- if the server should be hidden from playersrestricted
- Players will need a permission to join if truetemporary
- Temporary StatusInvalidServerException
public boolean removeSubServer(java.lang.String name) throws java.lang.InterruptedException
name
- SubServer Namejava.lang.InterruptedException
public abstract boolean removeSubServer(java.util.UUID player, java.lang.String name) throws java.lang.InterruptedException
player
- Player Removingname
- SubServer Namejava.lang.InterruptedException
public boolean forceRemoveSubServer(java.lang.String name)
name
- SubServer Namepublic abstract boolean forceRemoveSubServer(java.util.UUID player, java.lang.String name)
player
- Player Removingname
- SubServer Namepublic void addExtra(java.lang.String handle, java.lang.Object value)
ExtraDataHandler
addExtra
in interface ExtraDataHandler
handle
- Handlevalue
- Valuepublic boolean hasExtra(java.lang.String handle)
ExtraDataHandler
hasExtra
in interface ExtraDataHandler
handle
- Handlepublic YAMLValue getExtra(java.lang.String handle)
ExtraDataHandler
getExtra
in interface ExtraDataHandler
handle
- Handlepublic YAMLSection getExtra()
ExtraDataHandler
getExtra
in interface ExtraDataHandler
public void removeExtra(java.lang.String handle)
ExtraDataHandler
removeExtra
in interface ExtraDataHandler
handle
- Handle