use of com.google.gwt.http.client.RequestException in project blogwt by billy1380.
the class BlogService method getResources.
public Request getResources(GetResourcesRequest input, AsyncSuccess<GetResourcesRequest, GetResourcesResponse> onSuccess, AsyncFailure<GetResourcesRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetResources, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetResourcesResponse outputParameter = new GetResourcesResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetResources, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResources, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResources, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetResources, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResources, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestException in project blogwt by billy1380.
the class BlogService method createPost.
public Request createPost(CreatePostRequest input, AsyncSuccess<CreatePostRequest, CreatePostResponse> onSuccess, AsyncFailure<CreatePostRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodCreatePost, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
CreatePostResponse outputParameter = new CreatePostResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodCreatePost, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodCreatePost, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodCreatePost, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodCreatePost, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodCreatePost, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestException 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;
}
use of com.google.gwt.http.client.RequestException in project blogwt by billy1380.
the class BlogService method getResource.
public Request getResource(GetResourceRequest input, AsyncSuccess<GetResourceRequest, GetResourceResponse> onSuccess, AsyncFailure<GetResourceRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetResource, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetResourceResponse outputParameter = new GetResourceResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetResource, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResource, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResource, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetResource, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResource, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestException in project blogwt by billy1380.
the class BlogService method getPosts.
public Request getPosts(GetPostsRequest input, AsyncSuccess<GetPostsRequest, GetPostsResponse> onSuccess, AsyncFailure<GetPostsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetPosts, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetPostsResponse outputParameter = new GetPostsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetPosts, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetPosts, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetPosts, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetPosts, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetPosts, input, exception);
}
return handle;
}
Aggregations