# SubAPI (SubServers.Host)

net.ME1312.SubServers.Host

## Class SubAPI

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

    public final class SubAPI
    extends java.lang.Object

SubAPI Class

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods
`void` `addCommand(Command command, java.lang.String... handles)` Registers a Command
`void` `cancelTask(java.util.UUID sid)` Cancel a task
`void` `executeEvent(Event event)` Run a SubEvent
`Version` `getAppVersion()` Gets the SubServers Version
`Version` `getBetaVersion()` Gets the SubServers Beta Version
`static SubAPI` `getInstance()` Gets the SubAPI Methods
`ExHost` `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
`SubPluginInfo` `getPlugin(java.lang.String plugin)` Gets a Plugin
`java.util.Map<java.lang.String,SubPluginInfo>` `getPlugins()` Get a map of the Plugins
`UniversalFile` `getRuntimeDirectory()` Gets the Runtime Directory
`SubDataClient` `getSubDataNetwork()` Gets the SubData Network Manager
`void` `removeCommand(java.lang.String... handles)` Unregisters a Command
`void` `removeListener(SubPluginInfo plugin, java.lang.Object... listeners)` Unregister SubEvent Listeners
`java.util.UUID` `schedule(SubPluginInfo plugin, java.lang.Runnable run)` Schedule a task
`java.util.UUID` `schedule(SubPluginInfo plugin, java.lang.Runnable run, long delay)` Schedule a task
`java.util.UUID` `schedule(SubPluginInfo plugin, java.lang.Runnable run, long delay, long repeat)` Schedule a task
`java.util.UUID` `schedule(SubTask builder)` Schedule a task

### 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 ExHost getInternals()

Deprecated. Use SubAPI Methods when available
Gets the SubServers Internals

Returns:
  SubServers.Host Internals

#### getSubDataNetwork

    public SubDataClient getSubDataNetwork()

Gets the SubData Network Manager

Returns:
  SubData Network Manager

#### getPlugins

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

Get a map of the Plugins

Returns:
  PluginInfo Map

#### getPlugin

    public SubPluginInfo getPlugin(java.lang.String plugin)

Gets a Plugin

Parameters:
  `plugin` - Plugin Name
Returns:
  PluginInfo

#### addCommand

    public void addCommand(Command command,
                           java.lang.String... handles)

Registers a Command

Parameters:
  `command` - Command
  `handles` - Aliases

#### removeCommand

    public void removeCommand(java.lang.String... handles)

Unregisters a Command

Parameters:
  `handles` - Aliases

#### schedule

    public java.util.UUID schedule(SubTask builder)

Schedule a task

Parameters:
  `builder` - SubTaskBuilder
Returns:
  Task ID

#### schedule

    public java.util.UUID schedule(SubPluginInfo plugin,
                                   java.lang.Runnable run)

Schedule a task

Parameters:
  `plugin` - Plugin Scheduling
  `run` - What to run
Returns:
  Task ID

#### schedule

    public java.util.UUID schedule(SubPluginInfo plugin,
                                   java.lang.Runnable run,
                                   long delay)

Schedule a task

Parameters:
  `plugin` - Plugin Scheduling
  `run` - What to Run
  `delay` - Task Delay
Returns:
  Task ID

#### schedule

    public java.util.UUID schedule(SubPluginInfo plugin,
                                   java.lang.Runnable run,
                                   long delay,
                                   long repeat)

Schedule a task

Parameters:
  `plugin` - Plugin Scheduling
  `run` - What to Run
  `delay` - Task Delay
  `repeat` - Task Repeat Interval
Returns:
  Task ID

#### cancelTask

    public void cancelTask(java.util.UUID sid)

Cancel a task

Parameters:
  `sid` - Task ID

#### removeListener

    public void removeListener(SubPluginInfo plugin,
                               java.lang.Object... listeners)

Unregister SubEvent Listeners

Parameters:
  `plugin` - PluginInfo
  `listeners` - Listeners

#### executeEvent

    public void executeEvent(Event event)

Run a SubEvent

Parameters:
  `event` - SubEvent

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

#### getAppVersion

    public Version getAppVersion()

Gets the SubServers Version

Returns:
  SubServers Version