Search in sources :

Example 21 with RequestCallback

use of com.google.gwt.http.client.RequestCallback 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;
}
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) GetTagsResponse(com.willshex.blogwt.shared.api.blog.call.GetTagsResponse) 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 22 with RequestCallback

use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.

the class NotificationService method updateMetaNotification.

public Request updateMetaNotification(UpdateMetaNotificationRequest input, AsyncSuccess<UpdateMetaNotificationRequest, UpdateMetaNotificationResponse> onSuccess, AsyncFailure<UpdateMetaNotificationRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodUpdateMetaNotification, input, new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                try {
                    UpdateMetaNotificationResponse outputParameter = new UpdateMetaNotificationResponse();
                    parseResponse(response, outputParameter);
                    if (onSuccess != null) {
                        onSuccess.call(input, outputParameter);
                    }
                    onCallSuccess(NotificationService.this, NotificationMethodUpdateMetaNotification, input, outputParameter);
                } catch (JSONException | HttpException exception) {
                    if (onFailure != null) {
                        onFailure.call(input, exception);
                    }
                    onCallFailure(NotificationService.this, NotificationMethodUpdateMetaNotification, input, exception);
                }
            }

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(NotificationService.this, NotificationMethodUpdateMetaNotification, input, exception);
            }
        });
        onCallStart(NotificationService.this, NotificationMethodUpdateMetaNotification, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(NotificationService.this, NotificationMethodUpdateMetaNotification, input, exception);
    }
    return handle;
}
Also used : GetMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationResponse) GetMetaNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsResponse) UpdateNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsResponse) SetPushTokenResponse(com.willshex.blogwt.shared.api.notification.call.SetPushTokenResponse) AddMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationResponse) Response(com.google.gwt.http.client.Response) GetNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsResponse) GetNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationsResponse) UpdateMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationResponse) SendAdhocNotificationResponse(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) UpdateNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsRequest) GetMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationRequest) UpdateMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationRequest) GetMetaNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsRequest) SendAdhocNotificationRequest(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationRequest) Request(com.google.gwt.http.client.Request) GetNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsRequest) GetNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationsRequest) SetPushTokenRequest(com.willshex.blogwt.shared.api.notification.call.SetPushTokenRequest) AddMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) UpdateMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationResponse) RequestException(com.google.gwt.http.client.RequestException)

Example 23 with RequestCallback

use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.

the class NotificationService method getNotifications.

public Request getNotifications(GetNotificationsRequest input, AsyncSuccess<GetNotificationsRequest, GetNotificationsResponse> onSuccess, AsyncFailure<GetNotificationsRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodGetNotifications, input, new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                try {
                    GetNotificationsResponse outputParameter = new GetNotificationsResponse();
                    parseResponse(response, outputParameter);
                    if (onSuccess != null) {
                        onSuccess.call(input, outputParameter);
                    }
                    onCallSuccess(NotificationService.this, NotificationMethodGetNotifications, input, outputParameter);
                } catch (JSONException | HttpException exception) {
                    if (onFailure != null) {
                        onFailure.call(input, exception);
                    }
                    onCallFailure(NotificationService.this, NotificationMethodGetNotifications, input, exception);
                }
            }

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(NotificationService.this, NotificationMethodGetNotifications, input, exception);
            }
        });
        onCallStart(NotificationService.this, NotificationMethodGetNotifications, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(NotificationService.this, NotificationMethodGetNotifications, input, exception);
    }
    return handle;
}
Also used : GetMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationResponse) GetMetaNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsResponse) UpdateNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsResponse) SetPushTokenResponse(com.willshex.blogwt.shared.api.notification.call.SetPushTokenResponse) AddMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationResponse) Response(com.google.gwt.http.client.Response) GetNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsResponse) GetNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationsResponse) UpdateMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationResponse) SendAdhocNotificationResponse(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationResponse) GetNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationsResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) UpdateNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsRequest) GetMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationRequest) UpdateMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationRequest) GetMetaNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsRequest) SendAdhocNotificationRequest(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationRequest) Request(com.google.gwt.http.client.Request) GetNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsRequest) GetNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationsRequest) SetPushTokenRequest(com.willshex.blogwt.shared.api.notification.call.SetPushTokenRequest) AddMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException)

Example 24 with RequestCallback

use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.

the class NotificationService method sendAdhocNotification.

public Request sendAdhocNotification(SendAdhocNotificationRequest input, AsyncSuccess<SendAdhocNotificationRequest, SendAdhocNotificationResponse> onSuccess, AsyncFailure<SendAdhocNotificationRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodSendAdhocNotification, input, new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                try {
                    SendAdhocNotificationResponse outputParameter = new SendAdhocNotificationResponse();
                    parseResponse(response, outputParameter);
                    if (onSuccess != null) {
                        onSuccess.call(input, outputParameter);
                    }
                    onCallSuccess(NotificationService.this, NotificationMethodSendAdhocNotification, input, outputParameter);
                } catch (JSONException | HttpException exception) {
                    if (onFailure != null) {
                        onFailure.call(input, exception);
                    }
                    onCallFailure(NotificationService.this, NotificationMethodSendAdhocNotification, input, exception);
                }
            }

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(NotificationService.this, NotificationMethodSendAdhocNotification, input, exception);
            }
        });
        onCallStart(NotificationService.this, NotificationMethodSendAdhocNotification, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(NotificationService.this, NotificationMethodSendAdhocNotification, input, exception);
    }
    return handle;
}
Also used : GetMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationResponse) GetMetaNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsResponse) UpdateNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsResponse) SetPushTokenResponse(com.willshex.blogwt.shared.api.notification.call.SetPushTokenResponse) AddMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationResponse) Response(com.google.gwt.http.client.Response) GetNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsResponse) GetNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationsResponse) UpdateMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationResponse) SendAdhocNotificationResponse(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationResponse) SendAdhocNotificationResponse(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) UpdateNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsRequest) GetMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationRequest) UpdateMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationRequest) GetMetaNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsRequest) SendAdhocNotificationRequest(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationRequest) Request(com.google.gwt.http.client.Request) GetNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsRequest) GetNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationsRequest) SetPushTokenRequest(com.willshex.blogwt.shared.api.notification.call.SetPushTokenRequest) AddMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException)

Example 25 with RequestCallback

use of com.google.gwt.http.client.RequestCallback in project blogwt by billy1380.

the class NotificationService method getMetaNotification.

public Request getMetaNotification(GetMetaNotificationRequest input, AsyncSuccess<GetMetaNotificationRequest, GetMetaNotificationResponse> onSuccess, AsyncFailure<GetMetaNotificationRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodGetMetaNotification, input, new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                try {
                    GetMetaNotificationResponse outputParameter = new GetMetaNotificationResponse();
                    parseResponse(response, outputParameter);
                    if (onSuccess != null) {
                        onSuccess.call(input, outputParameter);
                    }
                    onCallSuccess(NotificationService.this, NotificationMethodGetMetaNotification, input, outputParameter);
                } catch (JSONException | HttpException exception) {
                    if (onFailure != null) {
                        onFailure.call(input, exception);
                    }
                    onCallFailure(NotificationService.this, NotificationMethodGetMetaNotification, input, exception);
                }
            }

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(NotificationService.this, NotificationMethodGetMetaNotification, input, exception);
            }
        });
        onCallStart(NotificationService.this, NotificationMethodGetMetaNotification, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(NotificationService.this, NotificationMethodGetMetaNotification, input, exception);
    }
    return handle;
}
Also used : GetMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationResponse) GetMetaNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsResponse) UpdateNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsResponse) SetPushTokenResponse(com.willshex.blogwt.shared.api.notification.call.SetPushTokenResponse) AddMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationResponse) Response(com.google.gwt.http.client.Response) GetNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsResponse) GetNotificationsResponse(com.willshex.blogwt.shared.api.notification.call.GetNotificationsResponse) UpdateMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationResponse) SendAdhocNotificationResponse(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) UpdateNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsRequest) GetMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationRequest) UpdateMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationRequest) GetMetaNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsRequest) SendAdhocNotificationRequest(com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationRequest) Request(com.google.gwt.http.client.Request) GetNotificationSettingsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsRequest) GetNotificationsRequest(com.willshex.blogwt.shared.api.notification.call.GetNotificationsRequest) SetPushTokenRequest(com.willshex.blogwt.shared.api.notification.call.SetPushTokenRequest) AddMetaNotificationRequest(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationRequest) GetMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationResponse) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException)

Aggregations

RequestCallback (com.google.gwt.http.client.RequestCallback)166 Response (com.google.gwt.http.client.Response)165 Request (com.google.gwt.http.client.Request)164 RequestException (com.google.gwt.http.client.RequestException)159 RequestBuilder (com.google.gwt.http.client.RequestBuilder)109 JSONException (com.google.gwt.json.client.JSONException)55 HttpException (com.willshex.gson.web.service.client.HttpException)55 MessageDialogBox (org.pentaho.gwt.widgets.client.dialogs.MessageDialogBox)17 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