public final class RegistrationManager extends ExtensionManager
features, xmppSession| Modifier and Type | Method and Description |
|---|---|
void |
cancelRegistration()
Cancels a registration.
|
void |
changePassword(String username,
String password)
Changes the password for the current user.
|
Registration |
getRegistration()
Gets the registration data (instructions, fields and form) from the server.
|
boolean |
isRegistrationSupported()
Determines, if in-band registration is supported by the server.
|
void |
register(Registration registration)
Registers a new account.
|
setEnabledpublic boolean isRegistrationSupported()
throws rocks.xmpp.core.XmppException
rocks.xmpp.core.stanza.model.StanzaException - If the server returned a stanza error. Common errors are Conflict (username is already in use) or NotAcceptable (some required information not provided).NoResponseException - If the server did not respond.rocks.xmpp.core.XmppExceptionpublic Registration getRegistration() throws rocks.xmpp.core.XmppException
In order to check if a field is required, you should check if a field is not null.
If you are already registered to the server, this method returns your registration data andRegistration.isRegistered() returns true.rocks.xmpp.core.stanza.model.StanzaException - If the server returned a stanza error.NoResponseException - If the server did not respond.rocks.xmpp.core.XmppExceptionRegistrationpublic void register(Registration registration) throws rocks.xmpp.core.XmppException
registration - The registration.rocks.xmpp.core.stanza.model.StanzaException - If the server returned a stanza error. Common errors are Conflict (username is already in use) or NotAcceptable (some required information not provided).NoResponseException - If the server did not respond.rocks.xmpp.core.XmppExceptionpublic void cancelRegistration()
throws rocks.xmpp.core.XmppException
rocks.xmpp.core.stanza.model.StanzaException - If the server returned a stanza error.NoResponseException - If the server did not respond.rocks.xmpp.core.XmppExceptionpublic void changePassword(String username, String password) throws rocks.xmpp.core.XmppException
username - The user name.password - The password.rocks.xmpp.core.stanza.model.StanzaException - If the server returned a stanza error.NoResponseException - If the server did not respond.rocks.xmpp.core.XmppExceptionCopyright © 2014 XMPP.rocks. All rights reserved.