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