Interface PasswordChange
- All Superinterfaces:
Operation
The object that can be used to change the password.
Example:
private void changePassword(Operations operations, String username) { operations.passwordChange() .username(username) .passwordChanger((context, consumer) -> { if (context.lastRecoverableError().isPresent()) { // Display error. } char[] oldPassword = askUserForOldPassword(); char[] newPassword = askUserForNewPassword(); if (oldPassword != null && newPassword != null) { consumer.passwords(oldPassword, newPassword); } else { consumer.cancel(); } }) .onError(passwordError -> { // handle error }) .onSuccess(() -> { // handle success }) .execute(); }
-
Method Summary
Modifier and TypeMethodDescriptiononError
(Consumer<PasswordChangeError> errorConsumer) The method invoked when the password could not be changed: the password was not enrolled, the password is locked or the operation was canceled.Specifies the object that will be invoked if the password was successfully modified.passwordChanger
(PasswordChanger passwordChanger) Specifies the object that will be informed of the potential recoverable errors and is responsible for obtaining the password from the end-user.The username whose password must be changed.
-
Method Details
-
username
The username whose password must be changed.Providing the username is required.
- Parameters:
username
- the username- Returns:
- a
PasswordChange
-
passwordChanger
Specifies the object that will be informed of the potential recoverable errors and is responsible for obtaining the password from the end-user.Providing the password changer is required.
- Parameters:
passwordChanger
- thePasswordChanger
.- Returns:
- a
PasswordChange
-
onError
The method invoked when the password could not be changed: the password was not enrolled, the password is locked or the operation was canceled.The specified object will receive a
PasswordChangeError
. This object will be invoked in the main/UI thread.Providing the object handling the error is required.
- Parameters:
errorConsumer
- the consumer of anPasswordChangeError
- Returns:
- a
PasswordChange
-
onSuccess
Specifies the object that will be invoked if the password was successfully modified. This object will be invoked in the main/UI thread.Providing the object handling the success is required.
- Parameters:
onSuccess
- the object invoked on successful password modification- Returns:
- a
PasswordChange
-