use of com.google.gwt.json.client.JSONException 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;
}
use of com.google.gwt.json.client.JSONException in project blogwt by billy1380.
the class BlogService method getPost.
public Request getPost(GetPostRequest input, AsyncSuccess<GetPostRequest, GetPostResponse> onSuccess, AsyncFailure<GetPostRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetPost, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetPostResponse outputParameter = new GetPostResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetPost, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetPost, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetPost, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetPost, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetPost, input, exception);
}
return handle;
}
use of com.google.gwt.json.client.JSONException in project blogwt by billy1380.
the class BlogService method deletePost.
public Request deletePost(DeletePostRequest input, AsyncSuccess<DeletePostRequest, DeletePostResponse> onSuccess, AsyncFailure<DeletePostRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodDeletePost, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
DeletePostResponse outputParameter = new DeletePostResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodDeletePost, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodDeletePost, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodDeletePost, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodDeletePost, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodDeletePost, input, exception);
}
return handle;
}
use of com.google.gwt.json.client.JSONException in project blogwt by billy1380.
the class BlogService method updateProperties.
public Request updateProperties(UpdatePropertiesRequest input, AsyncSuccess<UpdatePropertiesRequest, UpdatePropertiesResponse> onSuccess, AsyncFailure<UpdatePropertiesRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodUpdateProperties, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdatePropertiesResponse outputParameter = new UpdatePropertiesResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodUpdateProperties, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdateProperties, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdateProperties, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodUpdateProperties, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdateProperties, input, exception);
}
return handle;
}
use of com.google.gwt.json.client.JSONException in project blogwt by billy1380.
the class BlogService method updatePost.
public Request updatePost(UpdatePostRequest input, AsyncSuccess<UpdatePostRequest, UpdatePostResponse> onSuccess, AsyncFailure<UpdatePostRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodUpdatePost, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdatePostResponse outputParameter = new UpdatePostResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodUpdatePost, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdatePost, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdatePost, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodUpdatePost, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdatePost, input, exception);
}
return handle;
}
Aggregations