Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.XMPPConnection.connect()


             connection = new XMPPConnection(conf);
           } else {
             connection = new XMPPConnection(service);
           }

           connection.connect();
           System.out.println("Connected to " + connection.getHost());

        } catch (XMPPException ex) {
            Logger.getLogger(JabberWorkItemHandler.class.getName()).log(Level.SEVERE, null, ex);
            System.out.println("Failed to connect to " + connection.getHost());
View Full Code Here


   
    XMPPConnection connection = new XMPPConnection(connConfig);
   
   
    try {
      connection.connect();
      connection.login("admin", "admin");
     
      String username="demo";
      String pw="test";
      String email="test@test.ch";
View Full Code Here

  }

  public void run() {
    try {
      XMPPConnection connection = client.getConnection();
      connection.connect();
      connection.login(client.getChatUsername(), client.getPassword(), IMConfig.RESOURCE);
     
      if (log.isDebug()) {
        log.debug("Connection to IM server with username: "+client.getChatUsername());
      }
View Full Code Here

  DatatypeFactory xmlDataTypeFac;
   
    protected XMPPConnection connect(String resource) throws XMPPException {
      XMPPConnection c = new XMPPConnection(connConfig);
     
        c.connect();
        c.login(username, passwd, resource);       
        Presence presence = new Presence(Presence.Type.available);
        c.sendPacket(presence);
       
        return c;
View Full Code Here

  DatatypeFactory xmlDataTypeFac;
   
    protected XMPPConnection connect(String resource) throws XMPPException {
      XMPPConnection c = new XMPPConnection(connConfig);
     
        c.connect();
        c.login(username, passwd, resource);       
//        Presence presence = new Presence(Presence.Type.available);
//        c.sendPacket(presence);
       
        return c;
View Full Code Here

            connection = new XMPPConnection(new ConnectionConfiguration(host, port));
        } else {
            connection = new XMPPConnection(host);
        }

        connection.connect();

        if (login && !connection.isAuthenticated()) {
            if (user != null) {
                LOG.info("Logging in to XMPP as user: " + user + " on connection: " + connection);
                if (password == null) {
View Full Code Here

        connectionConfiguration.setDebuggerEnabled(false);
       
        XMPPConnection.DEBUG_ENABLED = true;
        XMPPConnection client = new XMPPConnection(connectionConfiguration);
       
        client.connect();
       
        client.login(username, password);
        return client;
    }
View Full Code Here

        return true;
    }

    private XMPPConnection connect(String username, String password, String host) throws XMPPException {
        XMPPConnection connection = new XMPPConnection(host);
        connection.connect();
        connection.login(username, password);
        return connection;
    }

    public void refresh() {
View Full Code Here

            }
        } else {
            connection = new XMPPConnection(host);
        }

        connection.connect();

        if (login && !connection.isAuthenticated()) {
            if (user != null) {
                LOG.info("Logging in to XMPP as user: " + user + " on connection: " + connection);
                if (password == null) {
View Full Code Here

            connectionConfiguration.setDebuggerEnabled(true);
            connectionConfiguration.setSASLAuthenticationEnabled(true);
            connectionConfiguration.setSecurityMode(ConnectionConfiguration.SecurityMode.required);
            XMPPConnection.DEBUG_ENABLED = true;
            XMPPConnection connection = new XMPPConnection(connectionConfiguration);
            connection.connect();

            SASLAuthentication saslAuthentication = connection.getSASLAuthentication();
            //            saslAuthentication.authenticateAnonymously();
            //            saslAuthentication.authenticate("user1@vysper.org", "password1", "test");
View Full Code Here

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.