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