Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.ConnectionConfiguration


            return connection;
        }

        if (port > 0) {
            if (getServiceName() == null) {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port));
            } else {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port, serviceName));
            }
        } else {
            connection = new XMPPConnection(host);
        }
View Full Code Here


  private static XMPPConnection connection;

  public static XMPPConnection getConnection() {
    if (connection == null) {
      //Connection.DEBUG_ENABLED = true;
      ConnectionConfiguration config = new ConnectionConfiguration(
          ServerInfo.currentServerInfo.XMPPserver, 5223);
      config.setSecurityMode(SecurityMode.enabled);
      config.setSocketFactory(new DummySSLSocketFactory());
      config.setCompressionEnabled(true);
      config.setServiceName("pvp.net");
      connection = new XMPPConnection(config);
     
    }
    return connection;
  }
View Full Code Here

        }

        if (connection == null) {
            if (port > 0) {
                if (getServiceName() == null) {
                    connection = new XMPPConnection(new ConnectionConfiguration(host, port));
                } else {
                    connection = new XMPPConnection(new ConnectionConfiguration(host, port, serviceName));
                }
            } else {
                connection = new XMPPConnection(host);
            }
        }
View Full Code Here

  public Sequence eval( Sequence[] args, Sequence contextSequence ) throws XPathException
  {
    Properties props = ModuleUtils.parseProperties( ((NodeValue) args[0].itemAt(0)).getNode() );
   
    ProxyInfo proxy;
    ConnectionConfiguration config;
   
    if (props.containsKey("proxy.type")){
      ProxyType type   = ProxyType.valueOf(props.getProperty("proxy.type"));
      String    host   = props.getProperty("proxy.host");
      int       port   = new Integer(props.getProperty("proxy.port")).intValue();
      String    user   = props.getProperty("proxy.user");
      String    passwd = props.getProperty("proxy.password");
      proxy  =  new ProxyInfo(type, host, port, user, passwd);
    } else proxy = null;
   
    String service  = props.getProperty("xmpp.service");
    String host     = props.getProperty("xmpp.host");
    String tmp     = props.getProperty("xmpp.port");
    int    port    = tmp == null ? 5222 : new Integer(tmp).intValue();  
   
    if (proxy == null){
      if (host == null)
         config = new ConnectionConfiguration(service);
      else if (service == null)
         config = new ConnectionConfiguration(host, port);
      else config = new ConnectionConfiguration(host, port, service);
    } else {
      if (host == null)
         config = new ConnectionConfiguration(service, proxy);
      else if (service == null)
         config = new ConnectionConfiguration(host, port, proxy);
      else config = new ConnectionConfiguration(host, port, service, proxy);
    }
   
    XMPPConnection connection = new XMPPConnection(config);
   
    // store the connection and return the handle of the connection
View Full Code Here

            return connection;
        }

        if (port > 0) {
            if (getServiceName() == null) {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port));
            } else {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port, serviceName));
            }
        } else {
            connection = new XMPPConnection(host);
        }
View Full Code Here

    // -------------------------------------------------------------------------
    protected XMPPConnection createConnection() throws XMPPException {
        XMPPConnection connection;
        if (port > 0) {           
            if (getServiceName() == null) {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port));
            } else {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port, getServiceName()));
            }
        } else {
            connection = new XMPPConnection(host);
        }
View Full Code Here

            return connection;
        }

        if (port > 0) {
            if (getServiceName() == null) {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port));
            } else {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port, serviceName));
            }
        } else {
            connection = new XMPPConnection(host);
        }
View Full Code Here

    public XMPPConnection createConnection() throws XMPPException {
        XMPPConnection connection;

        if (port > 0) {
            if (getServiceName() == null) {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port));
            } else {
                connection = new XMPPConnection(new ConnectionConfiguration(host, port, getServiceName()));
            }
        } else {
            connection = new XMPPConnection(host);
        }
View Full Code Here

        block = true;
        TestRunner.run(XmppTest.class);
    }

    public void testConnect() throws Exception {
        ConnectionConfiguration config = new
            ConnectionConfiguration("localhost", 61222);
        // config.setDebuggerEnabled(true);

        try {
            // SmackConfiguration.setPacketReplyTimeout(1000);
View Full Code Here

    private ChatManager chat;
    private Roster roster;
    private static ArrayList<String> chats = new ArrayList<>();

    public void login(String userName, String password) throws XMPPException {
        ConnectionConfiguration config = new ConnectionConfiguration("chat.eu.lol.riotgames.com", 5223, "pvp.net");
        config.setSecurityMode(ConnectionConfiguration.SecurityMode.enabled);
        config.setSocketFactory(new DummySSLSocketFactory());
        connection = new XMPPConnection(config);
        connection.connect();
        connection.login(userName, "AIR_" + password);
        presence = new Presence(Presence.Type.available, "", 0, Presence.Mode.available);
        chat = connection.getChatManager();
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.ConnectionConfiguration

Copyright © 2018 www.massapicom. 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.