Package org.jivesoftware.smack

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


                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
                }
            } else {
                LOG.info("Logging in anonymously to XMPP on connection: " + connection);
                connection.loginAnonymously();
            }
View Full Code Here


            config.setSecurityMode(ConnectionConfiguration.SecurityMode.disabled);
            final XMPPConnection con = new XMPPConnection(config);
            System.out.print("Connecting to " + server + "... ");
            con.connect();

            con.login(username, password, "writer");
            System.out.print("success.");
            System.out.println("");

            // Get the "real" server address.
            server = con.getServiceName();
View Full Code Here

    String password = args[1];
    XMPPConnection.DEBUG_ENABLED = true;
    XMPPConnection conn;
    try {
      conn = new XMPPConnection(StringUtils.parseServer(jid));
      conn.login(StringUtils.parseName(jid),password);
      System.out.println("Logged In.");
      conn.close();
    } catch (XMPPException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

        localConnectionConfiguration.setTruststorePath(keystorePath);
        localConnectionConfiguration.setTruststorePassword(keystorePassword);
        XMPPConnection localClient = new XMPPConnection(localConnectionConfiguration);

        localClient.connect();
        localClient.login(localUser.getNode(), "password1");
        localClient.addPacketListener(new PacketListener() {
            public void processPacket(Packet packet) {
                System.out.println("# " + packet);
            }
        }, new PacketFilter() {
View Full Code Here

        remoteConnectionConfiguration.setTruststorePath(keystorePath);
        remoteConnectionConfiguration.setTruststorePassword(keystorePassword);
        XMPPConnection remoteClient = new XMPPConnection(remoteConnectionConfiguration);

        remoteClient.connect();
        remoteClient.login(remoteUser.getNode(), remotePassword);
       
        Thread.sleep(3000);
       
        Message msg = new Message(remoteUser.getFullQualifiedName());
//        Message msg = new Message(localUser.getFullQualifiedName());
View Full Code Here

        XMPPConnection.DEBUG_ENABLED = true;
        XMPPConnection client = new XMPPConnection(connectionConfiguration);

        client.connect();

        client.login(username, password);
        return client;
    }

    protected Packet sendSync(XMPPConnection client, Packet request) {
        // Create a packet collector to listen for a response.
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

    public static void deleteUserAccoountOnServer(String serverAddress,
        String username, String defaultPassword) throws XMPPException {
        XMPPConnection connection = new XMPPConnection(serverAddress);
        connection.connect();
        connection.login(username, defaultPassword);
        AccountManager manager = connection.getAccountManager();
        manager.deleteAccount();
        connection.disconnect();
    }
}
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.