Package net.bnubot.core

Source Code of net.bnubot.core.ConnectionFactory

/**
* This file is distributed under the GPL
* $Id: ConnectionFactory.java 1590 2008-08-27 18:24:10Z scotta $
*/

package net.bnubot.core;

import net.bnubot.core.bncs.BNCSConnection;
import net.bnubot.core.digitaltext.DTConnection;
import net.bnubot.settings.ConnectionSettings;

/**
* @author scotta
*/
public class ConnectionFactory {
  public static Connection createConnection(ConnectionSettings cs, ChatQueue chatQueue, Profile profile) {
    switch(cs.connectionType) {
    case BNCS:
      if(cs.port == 1460)
        cs.port = 6112;
      return new BNCSConnection(cs, profile);
    case DigitalText:
      if(cs.port == 6112) {
        cs.server = "koolaid.sidoh.org";
        cs.port = 1460;
      }
      return new DTConnection(cs, profile);
    }
    return null;
  }
}
TOP

Related Classes of net.bnubot.core.ConnectionFactory

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.