public void createAccount(Localpart username, String password, Map<String, String> attributes)
                    throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        if (!connection().isSecureConnection() && !allowSensitiveOperationOverInsecureConnection) {
            throw new IllegalStateException("Creating account over insecure connection");
        }
        if (username == null) {
            throw new IllegalArgumentException("Username must not be null");
        }
        if (StringUtils.isNullOrEmpty(password)) {
            throw new IllegalArgumentException("Password must not be null");
        }

        attributes.put("username", username.toString());
        attributes.put("password", password);
        Registration reg = new Registration(attributes);
        reg.setType(IQ.Type.set);
        reg.setTo(connection().getXMPPServiceDomain());
        createStanzaCollectorAndSend(reg).nextResultOrThrow();
    }
public void createAccount ( Localpart username , String password , Map < String , String > attributes ) throws NoResponseException , XMPPErrorException , NotConnectedException , InterruptedException { if ( ! connection ( ) . isSecureConnection ( ) && ! allowSensitiveOperationOverInsecureConnection ) { throw new IllegalStateException ( "Creating account over insecure connection" ) ; } if ( username == null ) { throw new IllegalArgumentException ( "Username must not be null" ) ; } if ( StringUtils . isNullOrEmpty ( password ) ) { throw new IllegalArgumentException ( "Password must not be null" ) ; } attributes . put ( "username" , username . toString ( ) ) ; attributes . put ( "password" , password ) ; Registration reg = new Registration ( attributes ) ; reg . setType ( IQ . Type . set ) ; reg . setTo ( connection ( ) . getXMPPServiceDomain ( ) ) ; createStanzaCollectorAndSend ( reg ) . nextResultOrThrow ( ) ; }
Creates a new account using the specified username, password and account attributes.
The attributes Map must contain only String name/value pairs and must also have values
for all required attributes.

@param username the username.
@param password the password.
@param attributes the account attributes.
@throws XMPPErrorException if an error occurs creating the account.
@throws NoResponseException if there was no response from the server.
@throws NotConnectedException
@throws InterruptedException
@see #getAccountAttributes()