use of com.willshex.blogwt.shared.api.user.call.CheckUsernameResponse in project blogwt by billy1380.
the class UserService method checkUsername.
public Request checkUsername(CheckUsernameRequest input, AsyncSuccess<CheckUsernameRequest, CheckUsernameResponse> onSuccess, AsyncFailure<CheckUsernameRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodCheckUsername, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
CheckUsernameResponse outputParameter = new CheckUsernameResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodCheckUsername, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodCheckUsername, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodCheckUsername, input, exception);
}
});
onCallStart(UserService.this, UserMethodCheckUsername, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodCheckUsername, input, exception);
}
return handle;
}
Aggregations