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