use of com.willshex.gson.web.service.client.HttpException 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.willshex.gson.web.service.client.HttpException 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.willshex.gson.web.service.client.HttpException 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;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class DownloadService method generateDownload.
public Request generateDownload(final GenerateDownloadRequest input, final AsyncCallback<GenerateDownloadResponse> callback) {
Request handle = null;
try {
handle = sendRequest(DownloadMethodGenerateDownload, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GenerateDownloadResponse outputParameter = new GenerateDownloadResponse();
parseResponse(response, outputParameter);
callback.onSuccess(outputParameter);
onCallSuccess(DownloadService.this, DownloadMethodGenerateDownload, input, outputParameter);
} catch (JSONException | HttpException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGenerateDownload, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGenerateDownload, input, exception);
}
});
onCallStart(DownloadService.this, DownloadMethodGenerateDownload, input, handle);
} catch (RequestException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGenerateDownload, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class DownloadService method getGeneratedDownloads.
public Request getGeneratedDownloads(final GetGeneratedDownloadsRequest input, final AsyncCallback<GetGeneratedDownloadsResponse> callback) {
Request handle = null;
try {
handle = sendRequest(DownloadMethodGetGeneratedDownloads, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetGeneratedDownloadsResponse outputParameter = new GetGeneratedDownloadsResponse();
parseResponse(response, outputParameter);
callback.onSuccess(outputParameter);
onCallSuccess(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, outputParameter);
} catch (JSONException | HttpException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, exception);
}
});
onCallStart(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, handle);
} catch (RequestException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, exception);
}
return handle;
}
Aggregations