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