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