# Server (SubServers.Bungee)

net.ME1312.SubServers.Bungee.Host

## Class Server

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

All Implemented Interfaces:
  net.md_5.bungee.api.config.ServerInfo, ExtraDataHandler, ClientHandler

Direct Known Subclasses:
  SubServer

    public class Server
    extends java.lang.Object
    implements net.md_5.bungee.api.config.ServerInfo, ClientHandler, ExtraDataHandler

Server Class

### Constructor Summary

Constructors
Constructor and Description
`Server(java.lang.String name, java.net.InetSocketAddress address, java.lang.String motd, boolean hidden, boolean restricted)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addExtra(java.lang.String handle, java.lang.Object value)` Add an extra value to this Server
`void` `addGroup(java.lang.String value)` Add this Server to a Group
`boolean` `canAccess(net.md_5.bungee.api.CommandSender sender)` Whether the Player can access this Server
`java.net.InetSocketAddress` `getAddress()` Get this Server's Address
`java.lang.String` `getDisplayName()` Get the Display Name of this Server
`YAMLSection` `getExtra()` Get the extra value section
`YAMLValue` `getExtra(java.lang.String handle)` Get an extra value
`java.util.List<java.lang.String>` `getGroups()` Get this Server's Groups
`java.lang.String` `getMotd()` Get this Server's MOTD
`java.lang.String` `getName()` Get this Server's Name
`java.util.Collection<net.md_5.bungee.api.connection.ProxiedPlayer>` `getPlayers()` Get the Players connected to this Server
`Client` `getSubData()` Gets the SubData Client
`boolean` `hasExtra(java.lang.String handle)` Determine if an extra value exists
`boolean` `isHidden()` If the Server is hidden from players
`boolean` `isRestricted()` Get the Server's Restricted Status
`void` `ping(net.md_5.bungee.api.Callback<net.md_5.bungee.api.ServerPing> callback)` Ping the Server
`void` `removeExtra(java.lang.String handle)` Remove an extra value from this Server
`void` `removeGroup(java.lang.String value)` Remove this Server from a Group
`void` `sendData(java.lang.String channel, byte[] data)` Send PluginMessageChannel data to the Server
`boolean` `sendData(java.lang.String channel, byte[] data, boolean queue)` Send PluginMessageChannel data to the Server
`void` `setDisplayName(java.lang.String value)` Sets the Display Name for this Server
`void` `setHidden(boolean value)` Set if the Server is hidden from players
`void` `setMotd(java.lang.String value)` Set this Server's MOTD
`void` `setRestricted(boolean value)`
`void` `setSubData(Client client)` Link a SubData Client to this Object
`java.lang.String` `toString()`

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

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

### Constructor Detail

#### Server

    public Server(java.lang.String name,
                  java.net.InetSocketAddress address,
                  java.lang.String motd,
                  boolean hidden,
                  boolean restricted)
           throws InvalidServerException

Throws:
  `InvalidServerException`

### Method Detail

#### getSubData

    public Client getSubData()

Description copied from interface: `ClientHandler`
Gets the SubData Client

Specified by:
  `getSubData` in interface `ClientHandler`
Returns:
  SubData Client (or null if not linked)

#### setSubData

    public void setSubData(Client client)

Description copied from interface: `ClientHandler`
Link a SubData Client to this Object

Specified by:
  `setSubData` in interface `ClientHandler`
Parameters:
  `client` - Client to Link
See Also:
  `Client.setHandler(ClientHandler)`

#### getDisplayName

    public java.lang.String getDisplayName()

Get the Display Name of this Server

Returns:
  Display Name

#### setDisplayName

    public void setDisplayName(java.lang.String value)

Sets the Display Name for this Server

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

#### getGroups

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

Get this Server's Groups

Returns:
  Group names

#### addGroup

    public void addGroup(java.lang.String value)

Add this Server to a Group

Parameters:
  `value` - Group name

#### removeGroup

    public void removeGroup(java.lang.String value)

Remove this Server from a Group

Parameters:
  `value` - value Group name

#### isHidden

    public boolean isHidden()

If the Server is hidden from players

Returns:
  Hidden Status

#### setHidden

    public void setHidden(boolean value)

Set if the Server is hidden from players

Parameters:
  `value` - Value

#### getName

    public java.lang.String getName()

Get this Server's Name

Specified by:
  `getName` in interface `net.md_5.bungee.api.config.ServerInfo`
Returns:
  Server Name

#### getAddress

    public java.net.InetSocketAddress getAddress()

Get this Server's Address

Specified by:
  `getAddress` in interface `net.md_5.bungee.api.config.ServerInfo`
Returns:
  Server Address

#### getPlayers

    public java.util.Collection<net.md_5.bungee.api.connection.ProxiedPlayer> getPlayers()

Get the Players connected to this Server

Specified by:
  `getPlayers` in interface `net.md_5.bungee.api.config.ServerInfo`
Returns:
  Player list

#### getMotd

    public java.lang.String getMotd()

Get this Server's MOTD

Specified by:
  `getMotd` in interface `net.md_5.bungee.api.config.ServerInfo`
Returns:
  Server MOTD

#### setMotd

    public void setMotd(java.lang.String value)

Set this Server's MOTD

Parameters:
  `value` - Value

#### canAccess

    public boolean canAccess(net.md_5.bungee.api.CommandSender sender)

Whether the Player can access this Server

Specified by:
  `canAccess` in interface `net.md_5.bungee.api.config.ServerInfo`
Parameters:
  `sender` - Player
Returns:
  Player Access Status

#### sendData

    public void sendData(java.lang.String channel,
                         byte[] data)

Send PluginMessageChannel data to the Server

Specified by:
  `sendData` in interface `net.md_5.bungee.api.config.ServerInfo`
Parameters:
  `channel` - Channel name
  `data` - Data to send

#### sendData

    public boolean sendData(java.lang.String channel,
                            byte[] data,
                            boolean queue)

Send PluginMessageChannel data to the Server

Specified by:
  `sendData` in interface `net.md_5.bungee.api.config.ServerInfo`
Parameters:
  `channel` - Channel name
  `data` - Data to send
  `queue` - Queue message for later if cannot be sent immediately
Returns:
  If the message was sent immediately

#### ping

    public void ping(net.md_5.bungee.api.Callback<net.md_5.bungee.api.ServerPing> callback)

Ping the Server

Specified by:
  `ping` in interface `net.md_5.bungee.api.config.ServerInfo`
Parameters:
  `callback` - Ping Callback

#### isRestricted

    public boolean isRestricted()

Get the Server's Restricted Status

Returns:
  Restricted Status

#### setRestricted

    public void setRestricted(boolean value)

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