// Path: XServer-API/src/main/java/de/mickare/xserver/AbstractXServerManager.java
// public interface AbstractXServerManager {
// 
//   public abstract void start() throws IOException;
// 
//   public abstract void start_async();
// 
//   public abstract void reconnectAll_soft();
// 
//   public abstract void reconnectAll_forced();
// 
//   public abstract void stop() throws IOException;
// 
//   /**
//    * Reload configuration
//    * 
//    * @throws IOException
//    * 
//    * @throws InvalidConfigurationException
//    */
//   public abstract void reload() throws IOException;
// 
//   public abstract XServer getHomeServer();
// 
//   public abstract XServer getServer(String servername);
// 
//   public abstract XServerPlugin getPlugin();
// 
//   public abstract Logger getLogger();
// 
//   public abstract ServerThreadPoolExecutor getThreadPool();
// 
//   public abstract SocketFactory getSocketFactory();
// 
//   public abstract XServer getXServer(String name);
// 
//   /**
//    * Get the list of all available servers
//    * 
//    * @return servers
//    */
//   public abstract Set<XServer> getServers();
// 
//   /**
//    * Get a string list of all servernames
//    * 
//    * @return
//    */
//   public abstract String[] getServernames();
// 
//   /**
//    * Get the XServer Object with the servername name
//    * 
//    * @param name servername
//    * @return XServer with that name
//    */
//   public abstract XServer getServerIgnoreCase(String name);
// 
//   /**
//    * Get the XServer Object via host and port
//    * 
//    * @param host
//    * @param port
//    * @return XServer
//    */
//   public abstract XServer getServer(String host, int port);
// 
//   public abstract String getHomeServerName();
// 
//   public abstract Message createMessage(String subChannel, byte[] content);
// 
//   public abstract Message readMessage(XServer sender, byte[] data) throws IOException;
// 
//   public abstract EventHandler<?> getEventHandler();
// 
//   public abstract void registerOwnListeners();
// 
//   Set<XServer> getServers(XGroup group);
// 
//   Set<? extends XGroup> getGroups();
// 
//   XGroup getGroupByName(String name);
// 
// }
// 
// Path: XServer-API/src/main/java/de/mickare/xserver/Message.java
// public interface Message {
// 
//   /**
//    * Get Sender Server Name
//    * 
//    * @return sender name
//    */
//   public abstract XServer getSender();
// 
//   /**
//    * SubChannel
//    * 
//    * @return subchannel name
//    */
//   public abstract String getSubChannel();
// 
//   /**
//    * Get the content of this message...
//    * 
//    * @return byte array
//    */
//   public abstract byte[] getContent();
// 
//   /**
//    * Get the compiled byte array of this message...
//    * 
//    * @return byte array
//    * @throws IOException
//    */
//   public abstract byte[] getData() throws IOException;
// 
// }
// 
// Path: XServer-API/src/main/java/de/mickare/xserver/XType.java
// public enum XType {
//   Other(0, "Other"), Bukkit(1, "Bukkit"), BungeeCord(2, "BungeeCord");
// 
//   private final int number;
//   private final String name;
// 
//   private XType(int number, String name) {
//     this.number = number;
//     this.name = name;
//   }
// 
//   public static XType getByNumber(int number) {
//     switch (number) {
//       case 1:
//         return Bukkit;
//       case 2:
//         return BungeeCord;
//       default:
//         return Other;
//     }
//   }
// 
//   public int getNumber() {
//     return number;
//   }
// 
//   public String getName() {
//     return name;
//   }
// 
// }
// 
// Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
// 
//   public NotInitializedException() {}
// 
//   public NotInitializedException(String reason) {
//     super(reason);
//   }
// 
//   public NotInitializedException(Throwable cause) {
//     super(cause);
//   }
// 
//   public NotInitializedException(String msg, Throwable cause) {
//     super(msg, cause);
//   }
// 
// }


import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Set;
import de.mickare.xserver.AbstractXServerManager;
import de.mickare.xserver.Message;
import de.mickare.xserver.XGroup;
import de.mickare.xserver.XType;
import de.mickare.xserver.exceptions.NotInitializedException;
package de.mickare.xserver.net;



public interface XServer {

  /**
   * Try to establish a connection to this server
   * 
   * @throws UnknownHostException
   * @throws IOException
   * @throws InterruptedException
   * @throws NotInitializedException
   */
  public abstract void connect() throws UnknownHostException, IOException, InterruptedException, NotInitializedException;

  /**
   * Returns the connection status
   * 
   * @return true if connected, otherwise false
   */
  public abstract boolean isConnected();

  /**
   * Disconnect from this server
   */
  public abstract void disconnect();

  /**
   * Get the Server Name
   * 
   * @return name
   */
  public abstract String getName();

  /**
   * Get the host/ip address
   * 
   * @return host
   */
  public abstract String getHost();

  /**
   * Get the port
   * 
   * @return port
   */
  public abstract int getPort();

  /**
   * Get the md5-encrypted password that is needed to login to this server
   * 
   * @return
   */
  public abstract String getPassword();

  /**
   * Send a data Message to this server
   * 
   * @param message
   * @return true, if queued for sending into connection (= did send); otherwise false (= message
   *         cached)
   * @throws IOException
   */
  public abstract boolean sendMessage(Message message) throws IOException;

  /**
   * Ping this server with a new Ping
   * 
   * @param ping that is used to verify this ping
   * @throws InterruptedException
   * @throws IOException
   */
  public abstract void ping(Ping ping) throws InterruptedException, IOException;

  /**
   * Send cached packets = queue packets into connection
   */
  public abstract void flushCache();

  /**
   * Get the type of this server
   * 
   * @return Server Type
   */
// Path: XServer-API/src/main/java/de/mickare/xserver/AbstractXServerManager.java
// public interface AbstractXServerManager {
// 
//   public abstract void start() throws IOException;
// 
//   public abstract void start_async();
// 
//   public abstract void reconnectAll_soft();
// 
//   public abstract void reconnectAll_forced();
// 
//   public abstract void stop() throws IOException;
// 
//   /**
//    * Reload configuration
//    * 
//    * @throws IOException
//    * 
//    * @throws InvalidConfigurationException
//    */
//   public abstract void reload() throws IOException;
// 
//   public abstract XServer getHomeServer();
// 
//   public abstract XServer getServer(String servername);
// 
//   public abstract XServerPlugin getPlugin();
// 
//   public abstract Logger getLogger();
// 
//   public abstract ServerThreadPoolExecutor getThreadPool();
// 
//   public abstract SocketFactory getSocketFactory();
// 
//   public abstract XServer getXServer(String name);
// 
//   /**
//    * Get the list of all available servers
//    * 
//    * @return servers
//    */
//   public abstract Set<XServer> getServers();
// 
//   /**
//    * Get a string list of all servernames
//    * 
//    * @return
//    */
//   public abstract String[] getServernames();
// 
//   /**
//    * Get the XServer Object with the servername name
//    * 
//    * @param name servername
//    * @return XServer with that name
//    */
//   public abstract XServer getServerIgnoreCase(String name);
// 
//   /**
//    * Get the XServer Object via host and port
//    * 
//    * @param host
//    * @param port
//    * @return XServer
//    */
//   public abstract XServer getServer(String host, int port);
// 
//   public abstract String getHomeServerName();
// 
//   public abstract Message createMessage(String subChannel, byte[] content);
// 
//   public abstract Message readMessage(XServer sender, byte[] data) throws IOException;
// 
//   public abstract EventHandler<?> getEventHandler();
// 
//   public abstract void registerOwnListeners();
// 
//   Set<XServer> getServers(XGroup group);
// 
//   Set<? extends XGroup> getGroups();
// 
//   XGroup getGroupByName(String name);
// 
// }
// 
// Path: XServer-API/src/main/java/de/mickare/xserver/Message.java
// public interface Message {
// 
//   /**
//    * Get Sender Server Name
//    * 
//    * @return sender name
//    */
//   public abstract XServer getSender();
// 
//   /**
//    * SubChannel
//    * 
//    * @return subchannel name
//    */
//   public abstract String getSubChannel();
// 
//   /**
//    * Get the content of this message...
//    * 
//    * @return byte array
//    */
//   public abstract byte[] getContent();
// 
//   /**
//    * Get the compiled byte array of this message...
//    * 
//    * @return byte array
//    * @throws IOException
//    */
//   public abstract byte[] getData() throws IOException;
// 
// }
// 
// Path: XServer-API/src/main/java/de/mickare/xserver/XType.java
// public enum XType {
//   Other(0, "Other"), Bukkit(1, "Bukkit"), BungeeCord(2, "BungeeCord");
// 
//   private final int number;
//   private final String name;
// 
//   private XType(int number, String name) {
//     this.number = number;
//     this.name = name;
//   }
// 
//   public static XType getByNumber(int number) {
//     switch (number) {
//       case 1:
//         return Bukkit;
//       case 2:
//         return BungeeCord;
//       default:
//         return Other;
//     }
//   }
// 
//   public int getNumber() {
//     return number;
//   }
// 
//   public String getName() {
//     return name;
//   }
// 
// }
// 
// Path: XServer-API/src/main/java/de/mickare/xserver/exceptions/NotInitializedException.java
// @SuppressWarnings("serial")
// public class NotInitializedException extends RuntimeException {
// 
//   public NotInitializedException() {}
// 
//   public NotInitializedException(String reason) {
//     super(reason);
//   }
// 
//   public NotInitializedException(Throwable cause) {
//     super(cause);
//   }
// 
//   public NotInitializedException(String msg, Throwable cause) {
//     super(msg, cause);
//   }
// 
// }


// Path: XServer-API/src/main/java/de/mickare/xserver/net/XServer.java
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.Set;
import de.mickare.xserver.AbstractXServerManager;
import de.mickare.xserver.Message;
import de.mickare.xserver.XGroup;
import de.mickare.xserver.XType;
import de.mickare.xserver.exceptions.NotInitializedException;

package de.mickare.xserver.net;



public interface XServer {

  /**
   * Try to establish a connection to this server
   * 
   * @throws UnknownHostException
   * @throws IOException
   * @throws InterruptedException
   * @throws NotInitializedException
   */
  public abstract void connect() throws UnknownHostException, IOException, InterruptedException, NotInitializedException;

  /**
   * Returns the connection status
   * 
   * @return true if connected, otherwise false
   */
  public abstract boolean isConnected();

  /**
   * Disconnect from this server
   */
  public abstract void disconnect();

  /**
   * Get the Server Name
   * 
   * @return name
   */
  public abstract String getName();

  /**
   * Get the host/ip address
   * 
   * @return host
   */
  public abstract String getHost();

  /**
   * Get the port
   * 
   * @return port
   */
  public abstract int getPort();

  /**
   * Get the md5-encrypted password that is needed to login to this server
   * 
   * @return
   */
  public abstract String getPassword();

  /**
   * Send a data Message to this server
   * 
   * @param message
   * @return true, if queued for sending into connection (= did send); otherwise false (= message
   *         cached)
   * @throws IOException
   */
  public abstract boolean sendMessage(Message message) throws IOException;

  /**
   * Ping this server with a new Ping
   * 
   * @param ping that is used to verify this ping
   * @throws InterruptedException
   * @throws IOException
   */
  public abstract void ping(Ping ping) throws InterruptedException, IOException;

  /**
   * Send cached packets = queue packets into connection
   */
  public abstract void flushCache();

  /**
   * Get the type of this server
   * 
   * @return Server Type
   */
  public abstract XType getType();