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