use of com.willshex.blogwt.shared.api.user.call.ResetPasswordResponse in project blogwt by billy1380.
the class UserController method resetPassword.
/**
* @param email
*/
public void resetPassword(String email) {
final ResetPasswordRequest input = ApiHelper.setAccessCode(new ResetPasswordRequest());
input.session = SessionController.get().sessionForApiCall();
input.email = email;
ApiHelper.createUserClient().resetPassword(input, new AsyncCallback<ResetPasswordResponse>() {
@Override
public void onSuccess(ResetPasswordResponse output) {
if (output.status == StatusType.StatusTypeSuccess) {
}
DefaultEventBus.get().fireEventFromSource(new ResetPasswordSuccess(input, output), UserController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new ResetPasswordFailure(input, caught), UserController.this);
}
});
}
use of com.willshex.blogwt.shared.api.user.call.ResetPasswordResponse in project blogwt by billy1380.
the class UserService method resetPassword.
public Request resetPassword(ResetPasswordRequest input, AsyncSuccess<ResetPasswordRequest, ResetPasswordResponse> onSuccess, AsyncFailure<ResetPasswordRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodResetPassword, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
ResetPasswordResponse outputParameter = new ResetPasswordResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodResetPassword, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodResetPassword, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodResetPassword, input, exception);
}
});
onCallStart(UserService.this, UserMethodResetPassword, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodResetPassword, input, exception);
}
return handle;
}
Aggregations