use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class BlogService method updateResource.
public Request updateResource(UpdateResourceRequest input, AsyncSuccess<UpdateResourceRequest, UpdateResourceResponse> onSuccess, AsyncFailure<UpdateResourceRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodUpdateResource, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdateResourceResponse outputParameter = new UpdateResourceResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodUpdateResource, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdateResource, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdateResource, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodUpdateResource, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodUpdateResource, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException 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.willshex.gson.web.service.client.HttpException 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.willshex.gson.web.service.client.HttpException 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.willshex.gson.web.service.client.HttpException 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;
}
Aggregations