public class AccountManager
extends java.lang.Object
Connection.getAccountManager()
Constructor and Description |
---|
AccountManager(Connection connection)
Creates a new AccountManager instance.
|
Modifier and Type | Method and Description |
---|---|
void |
changePassword(java.lang.String newPassword)
Changes the password of the currently logged-in account.
|
void |
createAccount(java.lang.String username,
java.lang.String password)
Creates a new account using the specified username and password.
|
void |
createAccount(java.lang.String username,
java.lang.String password,
java.util.Map<java.lang.String,java.lang.String> attributes)
Creates a new account using the specified username, password and account attributes.
|
void |
deleteAccount()
Deletes the currently logged-in account from the server.
|
java.lang.String |
getAccountAttribute(java.lang.String name)
Returns the value of a given account attribute or null if the account
attribute wasn't found.
|
java.util.Collection<java.lang.String> |
getAccountAttributes()
Returns an unmodifiable collection of the names of the required account attributes.
|
java.lang.String |
getAccountInstructions()
Returns the instructions for creating a new account, or null if there
are no instructions.
|
boolean |
supportsAccountCreation()
Returns true if the server supports creating new accounts.
|
public AccountManager(Connection connection)
connection
- a connection to a XMPP server.public boolean supportsAccountCreation()
public java.util.Collection<java.lang.String> getAccountAttributes()
Typically, servers require no attributes when creating new accounts, or just the user's email address.
public java.lang.String getAccountAttribute(java.lang.String name)
name
- the name of the account attribute to return its value.public java.lang.String getAccountInstructions()
public void createAccount(java.lang.String username, java.lang.String password) throws XMPPException
username
- the username.password
- the password.XMPPException
- if an error occurs creating the account.public void createAccount(java.lang.String username, java.lang.String password, java.util.Map<java.lang.String,java.lang.String> attributes) throws XMPPException
username
- the username.password
- the password.attributes
- the account attributes.XMPPException
- if an error occurs creating the account.getAccountAttributes()
public void changePassword(java.lang.String newPassword) throws XMPPException
java.lang.IllegalStateException
- if not currently logged-in to the server.XMPPException
- if an error occurs when changing the password.public void deleteAccount() throws XMPPException
java.lang.IllegalStateException
- if not currently logged-in to the server.XMPPException
- if an error occurs when deleting the account.Copyright © 2003-2007 Jive Software.