# SubAPI (SubServers.Bungee)

net.ME1312.SubServers.Bungee

## Class SubAPI

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

    public final class SubAPI
    extends java.lang.Object

SubAPI Class

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`Host` `addHost(java.lang.String driver, java.lang.String name, boolean enabled, java.net.InetAddress address, java.lang.String directory, java.lang.String gitBash)` Add a Host to the Network
`Host` `addHost(java.util.UUID player, java.lang.String driver, java.lang.String name, boolean enabled, java.net.InetAddress address, java.lang.String directory, java.lang.String gitBash)` Add a Host to the Network
`void` `addHostDriver(java.lang.Class<? extends Host> driver, java.lang.String handle)` Adds a Driver for Hosts
`void` `addListener(java.lang.Runnable enable, java.lang.Runnable disable)` Adds a SubAPI Listener
`Server` `addServer(java.lang.String name, java.net.InetAddress ip, int port, java.lang.String motd, boolean hidden, boolean restricted)` Adds a Server to the Network
`Server` `addServer(java.util.UUID player, java.lang.String name, java.net.InetAddress ip, int port, java.lang.String motd, boolean hidden, boolean restricted)` Adds a Server to the Network
`boolean` `forceRemoveHost(java.lang.String name)` Force Remove a Host from the Network
`boolean` `forceRemoveHost(java.util.UUID player, java.lang.String name)` Force Remove a Host from the Network
`boolean` `forceRemoveServer(java.lang.String name)` Force Remove a Server from the Network
`boolean` `forceRemoveServer(java.util.UUID player, java.lang.String name)` Force Remove a Server from the Network
`Version` `getBetaVersion()` Gets the SubServers Beta Version
`Version` `getGameVersion()` Gets the Recommended Minecraft Version
`java.util.List<Server>` `getGroup(java.lang.String name)` Gets a Server Group
`java.util.Map<java.lang.String,java.util.List<Server>>` `getGroups()` Gets the Server Groups
`Host` `getHost(java.lang.String name)` Gets a Host
`java.util.List<java.lang.String>` `getHostDrivers()` Get a list of all available Host Drivers
`java.util.Map<java.lang.String,Host>` `getHosts()` Gets the Hosts
`static SubAPI` `getInstance()` Gets the SubAPI Methods
`SubPlugin` `getInternals()` Deprecated. Use SubAPI Methods when available
`java.util.Map<java.lang.String,java.lang.String>` `getLang()` Gets the SubServers Lang
`java.lang.String` `getLang(java.lang.String key)` Gets a value from the SubServers Lang
`Version` `getProxyVersion()` Gets the BungeeCord Version
`UniversalFile` `getRuntimeDirectory()` Gets the Runtime Directory
`Server` `getServer(java.lang.String name)` Gets a Server
`java.util.Map<java.lang.String,Server>` `getServers()` Gets the Servers (including SubServers)
`SubDataServer` `getSubDataNetwork()` Gets the SubData Network Manager
`SubServer` `getSubServer(java.lang.String name)` Gets a SubServer
`java.util.Map<java.lang.String,SubServer>` `getSubServers()` Gets the SubServers
`Version` `getWrapperVersion()` Gets the SubServers Version
`boolean` `removeHost(java.lang.String name)` Remove a Host from the Network
`boolean` `removeHost(java.util.UUID player, java.lang.String name)` Remove a Host from the Network
`boolean` `removeServer(java.lang.String name)` Remove a Server from the Network
`boolean` `removeServer(java.util.UUID player, java.lang.String name)` Remove a Server from the Network
`void` `setLang(java.lang.String key, java.lang.String value)` Adds to the Language Map

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

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

### Method Detail

#### getInstance

    public static SubAPI getInstance()

Gets the SubAPI Methods

Returns:
  SubAPI

#### getInternals

    @Deprecated
    public SubPlugin getInternals()

Deprecated. Use SubAPI Methods when available
Gets the SubServers Internals

Returns:
  SubPlugin Internals

#### addListener

    public void addListener(java.lang.Runnable enable,
                            java.lang.Runnable disable)

Adds a SubAPI Listener

Parameters:
  `enable` - An Event that will be called when SubAPI is ready
  `disable` - An Event that will be called before SubAPI is disabled

#### getSubDataNetwork

    public SubDataServer getSubDataNetwork()

Gets the SubData Network Manager

Returns:
  SubData Network Manager

#### getHostDrivers

    public java.util.List<java.lang.String> getHostDrivers()

Get a list of all available Host Drivers

Returns:
  Host Driver handle list

#### addHostDriver

    public void addHostDriver(java.lang.Class<? extends Host> driver,
                              java.lang.String handle)

Adds a Driver for Hosts

Parameters:
  `driver` - Driver to add
  `handle` - Handle to Bind

#### getHosts

    public java.util.Map<java.lang.String,Host> getHosts()

Gets the Hosts

Returns:
  Host Map

#### getHost

    public Host getHost(java.lang.String name)

Gets a Host

Parameters:
  `name` - Host name
Returns:
  a Host

#### addHost

    public Host addHost(java.lang.String driver,
                        java.lang.String name,
                        boolean enabled,
                        java.net.InetAddress address,
                        java.lang.String directory,
                        java.lang.String gitBash)
                 throws java.lang.NoSuchMethodException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException,
                        java.lang.InstantiationException

Add a Host to the Network

Parameters:
  `driver` - Driver to initiate
  `name` - Name of the Host
  `enabled` - Enabled Status
  `address` - Address of the Host
  `directory` - Directory of the Host
  `gitBash` - Git Bash Directory
Returns:
  The Host
Throws:
  `java.lang.NoSuchMethodException`
  `java.lang.IllegalAccessException`
  `java.lang.reflect.InvocationTargetException`
  `java.lang.InstantiationException`

#### addHost

    public Host addHost(java.util.UUID player,
                        java.lang.String driver,
                        java.lang.String name,
                        boolean enabled,
                        java.net.InetAddress address,
                        java.lang.String directory,
                        java.lang.String gitBash)
                 throws java.lang.NoSuchMethodException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException,
                        java.lang.InstantiationException

Add a Host to the Network

Parameters:
  `player` - Player who added
  `driver` - Driver to initiate
  `name` - Name of the Host
  `enabled` - Enabled Status
  `address` - Address of the Host
  `directory` - Directory of the Host
  `gitBash` - Git Bash Directory
Returns:
  The Host
Throws:
  `java.lang.NoSuchMethodException`
  `java.lang.IllegalAccessException`
  `java.lang.reflect.InvocationTargetException`
  `java.lang.InstantiationException`

#### removeHost

    public boolean removeHost(java.lang.String name)

Remove a Host from the Network

Parameters:
  `name` - Name of the Host
Returns:
  Success Status

#### removeHost

    public boolean removeHost(java.util.UUID player,
                              java.lang.String name)

Remove a Host from the Network

Parameters:
  `player` - Player Removing
  `name` - Name of the Host
Returns:
  Success Status

#### forceRemoveHost

    public boolean forceRemoveHost(java.lang.String name)

Force Remove a Host from the Network

Parameters:
  `name` - Name of the Host
Returns:
  Success Status

#### forceRemoveHost

    public boolean forceRemoveHost(java.util.UUID player,
                                   java.lang.String name)

Force Remove a Host from the Network

Parameters:
  `player` - Player Removing
  `name` - Name of the Host
Returns:
  Success Status

#### getGroups

    public java.util.Map<java.lang.String,java.util.List<Server>> getGroups()

Gets the Server Groups

Returns:
  Group Map

#### getGroup

    public java.util.List<Server> getGroup(java.lang.String name)

Gets a Server Group

Parameters:
  `name` - Group name
Returns:
  a Server Group

#### getServers

    public java.util.Map<java.lang.String,Server> getServers()

Gets the Servers (including SubServers)

Returns:
  Server Map

#### getServer

    public Server getServer(java.lang.String name)

Gets a Server

Parameters:
  `name` - Server name
Returns:
  a Server

#### addServer

    public Server addServer(java.lang.String name,
                            java.net.InetAddress ip,
                            int port,
                            java.lang.String motd,
                            boolean hidden,
                            boolean restricted)

Adds a Server to the Network

Parameters:
  `name` - Name of the Server
  `ip` - IP of the Server
  `port` - Port of the Server
  `motd` - MOTD of the Server
  `hidden` - if the server should be hidden from players
  `restricted` - Players will need a permission to join if true
Returns:
  The Server

#### addServer

    public Server addServer(java.util.UUID player,
                            java.lang.String name,
                            java.net.InetAddress ip,
                            int port,
                            java.lang.String motd,
                            boolean hidden,
                            boolean restricted)

Adds a Server to the Network

Parameters:
  `player` - Player who added
  `name` - Name of the Server
  `ip` - IP of the Server
  `port` - Port of the Server
  `motd` - MOTD of the Server
  `hidden` - If the server should be hidden from players
  `restricted` - Players will need a permission to join if true
Returns:
  The Server

#### removeServer

    public boolean removeServer(java.lang.String name)

Remove a Server from the Network

Parameters:
  `name` - Name of the Server
Returns:
  Success Status

#### removeServer

    public boolean removeServer(java.util.UUID player,
                                java.lang.String name)

Remove a Server from the Network

Parameters:
  `player` - Player Removing
  `name` - Name of the Server
Returns:
  Success Status

#### forceRemoveServer

    public boolean forceRemoveServer(java.lang.String name)

Force Remove a Server from the Network

Parameters:
  `name` - Name of the Server
Returns:
  Success Status

#### forceRemoveServer

    public boolean forceRemoveServer(java.util.UUID player,
                                     java.lang.String name)

Force Remove a Server from the Network

Parameters:
  `player` - Player Removing
  `name` - Name of the Server
Returns:
  Success Status

#### getSubServers

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

Gets the SubServers

Returns:
  SubServer Map

#### getSubServer

    public SubServer getSubServer(java.lang.String name)

Gets a SubServer

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

#### setLang

    public void setLang(java.lang.String key,
                        java.lang.String value)

Adds to the Language Map

Parameters:
  `key` - Key
  `value` - Lang Value

#### getLang

    public java.lang.String getLang(java.lang.String key)

Gets a value from the SubServers Lang

Parameters:
  `key` - Key
Returns:
  Lang Value

#### getLang

    public java.util.Map<java.lang.String,java.lang.String> getLang()

Gets the SubServers Lang

Returns:
  SubServers Lang

#### getRuntimeDirectory

    public UniversalFile getRuntimeDirectory()

Gets the Runtime Directory

Returns:
  Directory

#### getBetaVersion

    public Version getBetaVersion()

Gets the SubServers Beta Version

Returns:
  SubServers Beta Version (or null if this is a release version)

#### getWrapperVersion

    public Version getWrapperVersion()

Gets the SubServers Version

Returns:
  SubServers Version

#### getProxyVersion

    public Version getProxyVersion()

Gets the BungeeCord Version

Returns:
  BungeeCord Version

#### getGameVersion

    public Version getGameVersion()

Gets the Recommended Minecraft Version

Returns:
  Minecraft Version