Search in sources :

Example 46 with HttpException

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;
}
Also used : GetRatingsResponse(com.willshex.blogwt.shared.api.blog.call.GetRatingsResponse) UpdatePropertiesResponse(com.willshex.blogwt.shared.api.blog.call.UpdatePropertiesResponse) SubmitRatingResponse(com.willshex.blogwt.shared.api.blog.call.SubmitRatingResponse) UpdatePostResponse(com.willshex.blogwt.shared.api.blog.call.UpdatePostResponse) GetTagsResponse(com.willshex.blogwt.shared.api.blog.call.GetTagsResponse) DeleteResourceResponse(com.willshex.blogwt.shared.api.blog.call.DeleteResourceResponse) GetArchiveEntriesResponse(com.willshex.blogwt.shared.api.blog.call.GetArchiveEntriesResponse) Response(com.google.gwt.http.client.Response) GetPostResponse(com.willshex.blogwt.shared.api.blog.call.GetPostResponse) SetupBlogResponse(com.willshex.blogwt.shared.api.blog.call.SetupBlogResponse) GetResourcesResponse(com.willshex.blogwt.shared.api.blog.call.GetResourcesResponse) CreatePostResponse(com.willshex.blogwt.shared.api.blog.call.CreatePostResponse) GetRelatedPostsResponse(com.willshex.blogwt.shared.api.blog.call.GetRelatedPostsResponse) GetResourceResponse(com.willshex.blogwt.shared.api.blog.call.GetResourceResponse) GetPostsResponse(com.willshex.blogwt.shared.api.blog.call.GetPostsResponse) UpdateResourceResponse(com.willshex.blogwt.shared.api.blog.call.UpdateResourceResponse) DeletePostResponse(com.willshex.blogwt.shared.api.blog.call.DeletePostResponse) GetPropertiesResponse(com.willshex.blogwt.shared.api.blog.call.GetPropertiesResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) UpdatePostResponse(com.willshex.blogwt.shared.api.blog.call.UpdatePostResponse) UpdatePostRequest(com.willshex.blogwt.shared.api.blog.call.UpdatePostRequest) GetResourcesRequest(com.willshex.blogwt.shared.api.blog.call.GetResourcesRequest) GetResourceRequest(com.willshex.blogwt.shared.api.blog.call.GetResourceRequest) DeleteResourceRequest(com.willshex.blogwt.shared.api.blog.call.DeleteResourceRequest) GetRelatedPostsRequest(com.willshex.blogwt.shared.api.blog.call.GetRelatedPostsRequest) GetTagsRequest(com.willshex.blogwt.shared.api.blog.call.GetTagsRequest) UpdatePropertiesRequest(com.willshex.blogwt.shared.api.blog.call.UpdatePropertiesRequest) GetRatingsRequest(com.willshex.blogwt.shared.api.blog.call.GetRatingsRequest) DeletePostRequest(com.willshex.blogwt.shared.api.blog.call.DeletePostRequest) SubmitRatingRequest(com.willshex.blogwt.shared.api.blog.call.SubmitRatingRequest) CreatePostRequest(com.willshex.blogwt.shared.api.blog.call.CreatePostRequest) GetArchiveEntriesRequest(com.willshex.blogwt.shared.api.blog.call.GetArchiveEntriesRequest) Request(com.google.gwt.http.client.Request) UpdateResourceRequest(com.willshex.blogwt.shared.api.blog.call.UpdateResourceRequest) GetPostsRequest(com.willshex.blogwt.shared.api.blog.call.GetPostsRequest) GetPropertiesRequest(com.willshex.blogwt.shared.api.blog.call.GetPropertiesRequest) GetPostRequest(com.willshex.blogwt.shared.api.blog.call.GetPostRequest) SetupBlogRequest(com.willshex.blogwt.shared.api.blog.call.SetupBlogRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException)

Example 47 with HttpException

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;
}
Also used : GetRatingsResponse(com.willshex.blogwt.shared.api.blog.call.GetRatingsResponse) UpdatePropertiesResponse(com.willshex.blogwt.shared.api.blog.call.UpdatePropertiesResponse) SubmitRatingResponse(com.willshex.blogwt.shared.api.blog.call.SubmitRatingResponse) UpdatePostResponse(com.willshex.blogwt.shared.api.blog.call.UpdatePostResponse) GetTagsResponse(com.willshex.blogwt.shared.api.blog.call.GetTagsResponse) DeleteResourceResponse(com.willshex.blogwt.shared.api.blog.call.DeleteResourceResponse) GetArchiveEntriesResponse(com.willshex.blogwt.shared.api.blog.call.GetArchiveEntriesResponse) Response(com.google.gwt.http.client.Response) GetPostResponse(com.willshex.blogwt.shared.api.blog.call.GetPostResponse) SetupBlogResponse(com.willshex.blogwt.shared.api.blog.call.SetupBlogResponse) GetResourcesResponse(com.willshex.blogwt.shared.api.blog.call.GetResourcesResponse) CreatePostResponse(com.willshex.blogwt.shared.api.blog.call.CreatePostResponse) GetRelatedPostsResponse(com.willshex.blogwt.shared.api.blog.call.GetRelatedPostsResponse) GetResourceResponse(com.willshex.blogwt.shared.api.blog.call.GetResourceResponse) GetPostsResponse(com.willshex.blogwt.shared.api.blog.call.GetPostsResponse) UpdateResourceResponse(com.willshex.blogwt.shared.api.blog.call.UpdateResourceResponse) DeletePostResponse(com.willshex.blogwt.shared.api.blog.call.DeletePostResponse) GetPropertiesResponse(com.willshex.blogwt.shared.api.blog.call.GetPropertiesResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) SetupBlogResponse(com.willshex.blogwt.shared.api.blog.call.SetupBlogResponse) UpdatePostRequest(com.willshex.blogwt.shared.api.blog.call.UpdatePostRequest) GetResourcesRequest(com.willshex.blogwt.shared.api.blog.call.GetResourcesRequest) GetResourceRequest(com.willshex.blogwt.shared.api.blog.call.GetResourceRequest) DeleteResourceRequest(com.willshex.blogwt.shared.api.blog.call.DeleteResourceRequest) GetRelatedPostsRequest(com.willshex.blogwt.shared.api.blog.call.GetRelatedPostsRequest) GetTagsRequest(com.willshex.blogwt.shared.api.blog.call.GetTagsRequest) UpdatePropertiesRequest(com.willshex.blogwt.shared.api.blog.call.UpdatePropertiesRequest) GetRatingsRequest(com.willshex.blogwt.shared.api.blog.call.GetRatingsRequest) DeletePostRequest(com.willshex.blogwt.shared.api.blog.call.DeletePostRequest) SubmitRatingRequest(com.willshex.blogwt.shared.api.blog.call.SubmitRatingRequest) CreatePostRequest(com.willshex.blogwt.shared.api.blog.call.CreatePostRequest) GetArchiveEntriesRequest(com.willshex.blogwt.shared.api.blog.call.GetArchiveEntriesRequest) Request(com.google.gwt.http.client.Request) UpdateResourceRequest(com.willshex.blogwt.shared.api.blog.call.UpdateResourceRequest) GetPostsRequest(com.willshex.blogwt.shared.api.blog.call.GetPostsRequest) GetPropertiesRequest(com.willshex.blogwt.shared.api.blog.call.GetPropertiesRequest) GetPostRequest(com.willshex.blogwt.shared.api.blog.call.GetPostRequest) SetupBlogRequest(com.willshex.blogwt.shared.api.blog.call.SetupBlogRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException)

Example 48 with HttpException

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;
}
Also used : GetRatingsResponse(com.willshex.blogwt.shared.api.blog.call.GetRatingsResponse) UpdatePropertiesResponse(com.willshex.blogwt.shared.api.blog.call.UpdatePropertiesResponse) SubmitRatingResponse(com.willshex.blogwt.shared.api.blog.call.SubmitRatingResponse) UpdatePostResponse(com.willshex.blogwt.shared.api.blog.call.UpdatePostResponse) GetTagsResponse(com.willshex.blogwt.shared.api.blog.call.GetTagsResponse) DeleteResourceResponse(com.willshex.blogwt.shared.api.blog.call.DeleteResourceResponse) GetArchiveEntriesResponse(com.willshex.blogwt.shared.api.blog.call.GetArchiveEntriesResponse) Response(com.google.gwt.http.client.Response) GetPostResponse(com.willshex.blogwt.shared.api.blog.call.GetPostResponse) SetupBlogResponse(com.willshex.blogwt.shared.api.blog.call.SetupBlogResponse) GetResourcesResponse(com.willshex.blogwt.shared.api.blog.call.GetResourcesResponse) CreatePostResponse(com.willshex.blogwt.shared.api.blog.call.CreatePostResponse) GetRelatedPostsResponse(com.willshex.blogwt.shared.api.blog.call.GetRelatedPostsResponse) GetResourceResponse(com.willshex.blogwt.shared.api.blog.call.GetResourceResponse) GetPostsResponse(com.willshex.blogwt.shared.api.blog.call.GetPostsResponse) UpdateResourceResponse(com.willshex.blogwt.shared.api.blog.call.UpdateResourceResponse) DeletePostResponse(com.willshex.blogwt.shared.api.blog.call.DeletePostResponse) GetPropertiesResponse(com.willshex.blogwt.shared.api.blog.call.GetPropertiesResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) UpdatePostRequest(com.willshex.blogwt.shared.api.blog.call.UpdatePostRequest) GetResourcesRequest(com.willshex.blogwt.shared.api.blog.call.GetResourcesRequest) GetResourceRequest(com.willshex.blogwt.shared.api.blog.call.GetResourceRequest) DeleteResourceRequest(com.willshex.blogwt.shared.api.blog.call.DeleteResourceRequest) GetRelatedPostsRequest(com.willshex.blogwt.shared.api.blog.call.GetRelatedPostsRequest) GetTagsRequest(com.willshex.blogwt.shared.api.blog.call.GetTagsRequest) UpdatePropertiesRequest(com.willshex.blogwt.shared.api.blog.call.UpdatePropertiesRequest) GetRatingsRequest(com.willshex.blogwt.shared.api.blog.call.GetRatingsRequest) DeletePostRequest(com.willshex.blogwt.shared.api.blog.call.DeletePostRequest) SubmitRatingRequest(com.willshex.blogwt.shared.api.blog.call.SubmitRatingRequest) CreatePostRequest(com.willshex.blogwt.shared.api.blog.call.CreatePostRequest) GetArchiveEntriesRequest(com.willshex.blogwt.shared.api.blog.call.GetArchiveEntriesRequest) Request(com.google.gwt.http.client.Request) UpdateResourceRequest(com.willshex.blogwt.shared.api.blog.call.UpdateResourceRequest) GetPostsRequest(com.willshex.blogwt.shared.api.blog.call.GetPostsRequest) GetPropertiesRequest(com.willshex.blogwt.shared.api.blog.call.GetPropertiesRequest) GetPostRequest(com.willshex.blogwt.shared.api.blog.call.GetPostRequest) SetupBlogRequest(com.willshex.blogwt.shared.api.blog.call.SetupBlogRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException) GetArchiveEntriesResponse(com.willshex.blogwt.shared.api.blog.call.GetArchiveEntriesResponse)

Example 49 with HttpException

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;
}
Also used : GenerateDownloadResponse(com.willshex.blogwt.shared.api.download.call.GenerateDownloadResponse) GetGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsResponse) DeleteGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse) Response(com.google.gwt.http.client.Response) RequestCallback(com.google.gwt.http.client.RequestCallback) DeleteGeneratedDownloadsRequest(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest) GenerateDownloadRequest(com.willshex.blogwt.shared.api.download.call.GenerateDownloadRequest) Request(com.google.gwt.http.client.Request) GetGeneratedDownloadsRequest(com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) GenerateDownloadResponse(com.willshex.blogwt.shared.api.download.call.GenerateDownloadResponse) RequestException(com.google.gwt.http.client.RequestException)

Example 50 with HttpException

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;
}
Also used : GenerateDownloadResponse(com.willshex.blogwt.shared.api.download.call.GenerateDownloadResponse) GetGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsResponse) DeleteGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse) Response(com.google.gwt.http.client.Response) RequestCallback(com.google.gwt.http.client.RequestCallback) GetGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsResponse) DeleteGeneratedDownloadsRequest(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest) GenerateDownloadRequest(com.willshex.blogwt.shared.api.download.call.GenerateDownloadRequest) Request(com.google.gwt.http.client.Request) GetGeneratedDownloadsRequest(com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException)

Aggregations

HttpException (com.willshex.gson.web.service.client.HttpException)56 Request (com.google.gwt.http.client.Request)55 RequestCallback (com.google.gwt.http.client.RequestCallback)55 RequestException (com.google.gwt.http.client.RequestException)55 Response (com.google.gwt.http.client.Response)55 JSONException (com.google.gwt.json.client.JSONException)55 BlockUsersRequest (com.willshex.blogwt.shared.api.user.call.BlockUsersRequest)12 BlockUsersResponse (com.willshex.blogwt.shared.api.user.call.BlockUsersResponse)12 ChangePasswordRequest (com.willshex.blogwt.shared.api.user.call.ChangePasswordRequest)12 ChangePasswordResponse (com.willshex.blogwt.shared.api.user.call.ChangePasswordResponse)12 ChangeUserAccessRequest (com.willshex.blogwt.shared.api.user.call.ChangeUserAccessRequest)12 ChangeUserAccessResponse (com.willshex.blogwt.shared.api.user.call.ChangeUserAccessResponse)12 ChangeUserDetailsRequest (com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsRequest)12 ChangeUserDetailsResponse (com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsResponse)12 CheckUsernameRequest (com.willshex.blogwt.shared.api.user.call.CheckUsernameRequest)12 CheckUsernameResponse (com.willshex.blogwt.shared.api.user.call.CheckUsernameResponse)12 FollowUsersRequest (com.willshex.blogwt.shared.api.user.call.FollowUsersRequest)12 FollowUsersResponse (com.willshex.blogwt.shared.api.user.call.FollowUsersResponse)12 ForgotPasswordRequest (com.willshex.blogwt.shared.api.user.call.ForgotPasswordRequest)12 ForgotPasswordResponse (com.willshex.blogwt.shared.api.user.call.ForgotPasswordResponse)12