Package org.jivesoftware.smack

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


            System.exit(1);

        }

        try{
            connection.login(user, password);
            System.out.println("Logged in as " + connection.getUser());
            Presence presence = new Presence(Presence.Type.available);
            connection.sendPacket(presence);

        } catch (XMPPException ex){
View Full Code Here


              return true;
            }} );

          // -- log in
          log( RECEIVER, "logging on as " + username + "/" + RECEIVER );
          connection.login(username, password, RECEIVER);
         
          // -- just hang out until we are asked to exit.
          // the work will be done by the ReceiverJingleSession
          // we created and applied earlier.
          log( RECEIVER, "Waiting..." );
View Full Code Here

//              return true;
//            }} );
         
          // log in:
          log( CALLER, "logging on as " + username + "/" + CALLER );
          connection.login(username, password, CALLER);
         
          //this only works if they are in our roster
//          log( CALLER, "Waiting for Receiver to become available." );
//          while( running && !connection.getRoster().contains(receiverJid) ) {
//            collector.nextResult(100);
View Full Code Here

      XMPPConnection con = getConnection(connectionIndex);
     
      if (!con.isConnected())
        con.connect();
      try {
          con.login(usernamePrefix + (connectionIndex + 1), password, "Smack");
      } catch (XMPPException e) {
          createAccount(connectionIndex, usernamePrefix + (connectionIndex + 1), password);
            con.login(usernamePrefix + (connectionIndex + 1), password, "Smack");
      }
    }
View Full Code Here

        con.connect();
      try {
          con.login(usernamePrefix + (connectionIndex + 1), password, "Smack");
      } catch (XMPPException e) {
          createAccount(connectionIndex, usernamePrefix + (connectionIndex + 1), password);
            con.login(usernamePrefix + (connectionIndex + 1), password, "Smack");
      }
    }

    protected void disconnect(int connectionIndex) throws XMPPException
    {
View Full Code Here

                try {
                    // If not connected, connect so that we can delete the account.
                    if (!getConnection(i).isConnected()) {
                        XMPPConnection con = getConnection(i);
                        con.connect();
                        con.login(getUsername(i), getUsername(i));
                    }
                    else if (!getConnection(i).isAuthenticated()) {
                        getConnection(i).login(getUsername(i), getUsername(i));    
                    }
                    // Delete the created account for the 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.