Package org.jivesoftware.smack

Examples of org.jivesoftware.smack.AccountManager


      return true;
    } catch (XMPPException e) {
      e.printStackTrace();
      if(e.getXMPPError() != null && e.getXMPPError().getCode() == 401) {
        Kernel.debug(this,"Unauthorized.. trying to register ..",-1);
        AccountManager manager = new AccountManager(connection);
        try {
          manager.createAccount(StringUtils.parseName(jid),password);
          login();
          return true;
        } catch (XMPPException e1) {
          e1.printStackTrace();
          return false;
View Full Code Here


    private void createAccount()
    {
        try
        {
            AccountManager accountManager = new AccountManager(connection);
            accountManager.createAccount(user, password);
        }
        catch (XMPPException ex)
        {
            // User probably already exists, throw away...
            logger.warn("Account (" + user + ") already exists");
View Full Code Here

    }.start();
  }
  public void tryRegister() throws XMPPException {
    if(conn != null) conn.close();
    createConnection();
    AccountManager manager = new AccountManager(conn);
    manager.createAccount(account.getUsername(),account.password);
    conn.close();
    conn = null;
  }
View Full Code Here

                    connection = new XMPPConnection(host);
                }
            }
            if (login && !connection.isAuthenticated()) {
                if (user != null) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);

                    log.info("Logging in to Jabber as user: " + user + " on connection: " + connection);
                    connection.login(user, password, resource);
                }
                else {
View Full Code Here

        if (jpwdPassword.getText().equals(jpwdPasswordwiederholung.getText()) ){
        strPassword = jpwdPassword.getText();

        //baut die Connection zum Server auf
        this.connectToServerNoPort(strIP);
        AccountManager accountManager = new AccountManager(xmppconnection);

        //führt die Registrierung durch
        try {
            accountManager.createAccount(strUsername, strPassword, attributes);
            JOptionPane.showMessageDialog(null, "Die Registrierung war erfolgreich. Sie können sich nun anmelden.");
            this.dispose();
        } catch (XMPPException ex) {
            Logger.getLogger(UseraccountWindow.class.getName()).log(Level.SEVERE, null, ex);
        }
View Full Code Here

            if (errorMessage != null)
                throw new XMPPException(errorMessage);

            monitor.worked(1);

            AccountManager manager = connection.getAccountManager();
            manager.createAccount(username, password);
            monitor.worked(1);

            connection.disconnect();
        } catch (XMPPException e) {
            String message = e.getMessage();
View Full Code Here

                    }
                }
            }
            monitor.worked(1);

            AccountManager manager = connection.getAccountManager();
            manager.createAccount(username, password);
            monitor.worked(1);

            connection.disconnect();
        } finally {
            monitor.done();
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

                if (password == null) {
                    LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
                }

                if (createAccount) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
View Full Code Here

                if (password == null) {
                    LOG.warn("No password configured for user: " + user + " on connection: " + getConnectionMessage(connection));
                }

                if (createAccount) {
                    AccountManager accountManager = new AccountManager(connection);
                    accountManager.createAccount(user, password);
                }
                if (resource != null) {
                    connection.login(user, password, resource);
                } else {
                    connection.login(user, password);
View Full Code Here

TOP

Related Classes of org.jivesoftware.smack.AccountManager

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.