use of com.google.gwt.http.client.Response 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.Response 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.Response 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;
}
use of com.google.gwt.http.client.Response in project blogwt by billy1380.
the class BlogService method getTags.
public Request getTags(GetTagsRequest input, AsyncSuccess<GetTagsRequest, GetTagsResponse> onSuccess, AsyncFailure<GetTagsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetTags, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetTagsResponse outputParameter = new GetTagsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetTags, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetTags, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetTags, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetTags, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetTags, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Response in project blogwt by billy1380.
the class BlogService method getProperties.
public Request getProperties(GetPropertiesRequest input, AsyncSuccess<GetPropertiesRequest, GetPropertiesResponse> onSuccess, AsyncFailure<GetPropertiesRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetProperties, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetPropertiesResponse outputParameter = new GetPropertiesResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetProperties, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetProperties, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetProperties, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetProperties, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetProperties, input, exception);
}
return handle;
}
Aggregations