use of com.google.gwt.json.client.JSONException 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;
}
use of com.google.gwt.json.client.JSONException 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.json.client.JSONException 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.json.client.JSONException 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.json.client.JSONException 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;
}
Aggregations