Package rocks.xmpp.extensions.register
Class RegistrationManager
- java.lang.Object
-
- rocks.xmpp.core.session.Manager
-
- rocks.xmpp.extensions.register.RegistrationManager
-
public final class RegistrationManager extends Manager
This manager allows to register, cancel an existing registration (i.e. remove an account) or change the password with a host.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AsyncResult<Void>
cancelRegistration()
Cancels a registration.AsyncResult<Void>
changePassword(String username, String password)
Changes the password for the current user.AsyncResult<Registration>
getRegistration()
Gets the registration data (instructions, fields and form) from the server.AsyncResult<Boolean>
isRegistrationSupported()
Determines, if in-band registration is supported by the server.AsyncResult<Void>
register(Registration registration)
Registers a new account.-
Methods inherited from class rocks.xmpp.core.session.Manager
isEnabled, setEnabled
-
-
-
-
Method Detail
-
isRegistrationSupported
public final AsyncResult<Boolean> isRegistrationSupported()
Determines, if in-band registration is supported by the server.- Returns:
- The async result with true, if registration is supported by the server; otherwise false.
-
getRegistration
public final AsyncResult<Registration> getRegistration()
Gets the registration data (instructions, fields and form) from the server.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 and
Registration.isRegistered()
returns true.- Returns:
- The async result with the registration data.
- See Also:
- 3.1 Entity Registers with a Host,
Registration
-
register
public final AsyncResult<Void> register(Registration registration)
Registers a new account. Call this method before authenticating.- Parameters:
registration
- The registration.- Returns:
- The async result.
- See Also:
- 3.1 Entity Registers with a Host
-
cancelRegistration
public final AsyncResult<Void> cancelRegistration()
Cancels a registration. This method must be called after having authenticated to the server.- Returns:
- The async result.
- See Also:
- 3.2 Entity Cancels an Existing Registration
-
changePassword
public final AsyncResult<Void> changePassword(String username, String password)
Changes the password for the current user. This method must be called after having authenticated to the server.- Parameters:
username
- The user name.password
- The password.- Returns:
- The async result.
- See Also:
- 3.3 User Changes Password
-
-