# Host (SubServers.Bungee)

net.ME1312.SubServers.Bungee.Host

## Class Host

- java.lang.Object
- - net.ME1312.SubServers.Bungee.Host.Host

All Implemented Interfaces:
  ExtraDataHandler

Direct Known Subclasses:
  ExternalHost, InternalHost

    public abstract class Host
    extends java.lang.Object
    implements ExtraDataHandler

Host Layout Class

### Constructor Summary

Constructors
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.

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`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` `deleteSubServer(java.lang.String name)` Delete a SubServer
`abstract boolean` `deleteSubServer(java.util.UUID player, java.lang.String name)` Delete a SubServer
`abstract int` `edit(java.util.UUID player, YAMLSection edit)` Edits the Host
`int` `edit(YAMLSection edit)` Edits the Host
`boolean` `forceDeleteSubServer(java.lang.String name)` Forced the Deletion of a SubServer
`abstract boolean` `forceDeleteSubServer(java.util.UUID player, java.lang.String name)` Forces the Deletion of a SubServer
`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
`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 java.lang.String` `getPath()` Get the host Directory Path
`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
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### Host

    public 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. Do not add or remove any arguments.

Parameters:
  `plugin` - SubServers Internals
  `name` - The Name of your Host
  `enabled` - If your host is Enabled
  `address` - The address of your Host
  `directory` - The runtime directory of your Host
  `gitBash` - The Git Bash directory

### Method Detail

#### 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

    public abstract java.net.InetAddress getAddress()

Get the Address of this Host

Returns:
  Host Address

#### getPath

    public abstract java.lang.String getPath()

Get the host Directory Path

Returns:
  Host Directory Path

#### getName

    public abstract java.lang.String getName()

Get the Name of this Host

Returns:
  Host Name

#### getDisplayName

    public java.lang.String getDisplayName()

Get the Display Name of this Host

Returns:
  Display Name

#### setDisplayName

    public void setDisplayName(java.lang.String value)

Sets the Display Name for this Host

Parameters:
  `value` - Value (or null to reset)

#### start

    public int start(java.lang.String... servers)

Starts the Servers Specified

Parameters:
  `servers` - Servers
Returns:
  Success Status

#### start

    public int start(java.util.UUID player,
                     java.lang.String... servers)

Starts the Servers Specified

Parameters:
  `player` - Player who started
  `servers` - Servers
Returns:
  Success Status

#### stop

    public int stop(java.lang.String... servers)

Stops the Servers Specified

Parameters:
  `servers` - Servers
Returns:
  Success Status

#### stop

    public int stop(java.util.UUID player,
                    java.lang.String... servers)

Stops the Servers Specified

Parameters:
  `player` - Player who started
  `servers` - Servers
Returns:
  Success Status

#### terminate

    public int terminate(java.lang.String... servers)

Terminates the Servers Specified

Parameters:
  `servers` - Servers
Returns:
  Success Status

#### terminate

    public int terminate(java.util.UUID player,
                         java.lang.String... servers)

Terminates the Servers Specified

Parameters:
  `player` - Player who started
  `servers` - Servers
Returns:
  Success Status

#### command

    public int command(java.lang.String command,
                       java.lang.String... servers)

Commands the Servers Specified

Parameters:
  `command` - Command to send
  `servers` - Servers
Returns:
  Success Status

#### command

    public int command(java.util.UUID player,
                       java.lang.String command,
                       java.lang.String... servers)

Commands the Servers Specified

Parameters:
  `player` - Player who started
  `command` - Command to send
  `servers` - Servers
Returns:
  Success Status

#### edit

    public abstract int edit(java.util.UUID player,
                             YAMLSection edit)

Edits the Host

Parameters:
  `player` - Player Editing
  `edit` - Edits
Returns:
  Success Status

#### edit

    public int edit(YAMLSection edit)

Edits the Host

Parameters:
  `edit` - Edits
Returns:
  Success Status

#### getCreator

    public abstract SubCreator getCreator()

Gets the SubCreator Instance for this Host

Returns:
  SubCreator

#### getSubServers

    public abstract java.util.Map<java.lang.String,? extends SubServer> getSubServers()

Gets the SubServers on this Host

Returns:
  SubServer Map

#### getSubServer

    public abstract SubServer getSubServer(java.lang.String name)

Gets a SubServer

Parameters:
  `name` - SubServer Name
Returns:
  a SubServer

#### addSubServer

    public 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

Adds a SubServer

Parameters:
  `player` - Player who Added
  `name` - Name of Server
  `enabled` - Enabled Status
  `port` - Port Number
  `motd` - Motd of the Server
  `log` - Logging Status
  `directory` - Directory
  `executable` - Executable
  `stopcmd` - Command to Stop the Server
  `restart` - Auto Restart Status
  `hidden` - if the server should be hidden from players
  `restricted` - Players will need a permission to join if true
  `temporary` - Temporary Status
Returns:
  The SubServer
Throws:
  `InvalidServerException`

#### addSubServer

    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

Adds a SubServer

Parameters:
  `name` - Name of Server
  `enabled` - Enabled Status
  `port` - Port Number
  `motd` - Motd of the Server
  `log` - Logging Status
  `directory` - Directory
  `executable` - Executable
  `stopcmd` - Command to Stop the Server
  `restart` - Auto Restart Status
  `hidden` - if the server should be hidden from players
  `restricted` - Players will need a permission to join if true
  `temporary` - Temporary Status
Returns:
  The SubServer
Throws:
  `InvalidServerException`

#### removeSubServer

    public boolean removeSubServer(java.lang.String name)
                            throws java.lang.InterruptedException

Removes a SubServer

Parameters:
  `name` - SubServer Name
Returns:
  Success Status
Throws:
  `java.lang.InterruptedException`

#### removeSubServer

    public abstract boolean removeSubServer(java.util.UUID player,
                                            java.lang.String name)
                                     throws java.lang.InterruptedException

Removes a SubServer

Parameters:
  `player` - Player Removing
  `name` - SubServer Name
Returns:
  Success Status
Throws:
  `java.lang.InterruptedException`

#### forceRemoveSubServer

    public boolean forceRemoveSubServer(java.lang.String name)
                                 throws java.lang.InterruptedException

Forces the Removal of a SubServer

Parameters:
  `name` - SubServer Name
Throws:
  `java.lang.InterruptedException`

#### forceRemoveSubServer

    public abstract boolean forceRemoveSubServer(java.util.UUID player,
                                                 java.lang.String name)
                                          throws java.lang.InterruptedException

Forces the Removal of a SubServer

Parameters:
  `player` - Player Removing
  `name` - SubServer Name
Throws:
  `java.lang.InterruptedException`

#### deleteSubServer

    public boolean deleteSubServer(java.lang.String name)
                            throws java.lang.InterruptedException

Delete a SubServer

Parameters:
  `name` - SubServer Name
Returns:
  Success Status
Throws:
  `java.lang.InterruptedException`

#### deleteSubServer

    public abstract boolean deleteSubServer(java.util.UUID player,
                                            java.lang.String name)
                                     throws java.lang.InterruptedException

Delete a SubServer

Parameters:
  `player` - Player Deleting
  `name` - SubServer Name
Returns:
  Success Status
Throws:
  `java.lang.InterruptedException`

#### forceDeleteSubServer

    public boolean forceDeleteSubServer(java.lang.String name)
                                 throws java.lang.InterruptedException

Forced the Deletion of a SubServer

Parameters:
  `name` - SubServer Name
Returns:
  Success Status
Throws:
  `java.lang.InterruptedException`

#### forceDeleteSubServer

    public abstract boolean forceDeleteSubServer(java.util.UUID player,
                                                 java.lang.String name)
                                          throws java.lang.InterruptedException

Forces the Deletion of a SubServer

Parameters:
  `player` - Player Deleting
  `name` - SubServer Name
Returns:
  Success Status
Throws:
  `java.lang.InterruptedException`

#### addExtra

    public void addExtra(java.lang.String handle,
                         java.lang.Object value)

Description copied from interface: `ExtraDataHandler`
Add an extra value to this Server

Specified by:
  `addExtra` in interface `ExtraDataHandler`
Parameters:
  `handle` - Handle
  `value` - Value

#### hasExtra

    public boolean hasExtra(java.lang.String handle)

Description copied from interface: `ExtraDataHandler`
Determine if an extra value exists

Specified by:
  `hasExtra` in interface `ExtraDataHandler`
Parameters:
  `handle` - Handle
Returns:
  Value Status

#### getExtra

    public YAMLValue getExtra(java.lang.String handle)

Description copied from interface: `ExtraDataHandler`
Get an extra value

Specified by:
  `getExtra` in interface `ExtraDataHandler`
Parameters:
  `handle` - Handle
Returns:
  Value

#### getExtra

    public YAMLSection getExtra()

Description copied from interface: `ExtraDataHandler`
Get the extra value section

Specified by:
  `getExtra` in interface `ExtraDataHandler`
Returns:
  Extra Value Section

#### removeExtra

    public void removeExtra(java.lang.String handle)

Description copied from interface: `ExtraDataHandler`
Remove an extra value from this Server

Specified by:
  `removeExtra` in interface `ExtraDataHandler`
Parameters:
  `handle` - Handle

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`