Search in sources :

Example 56 with Request

use of com.google.gwt.http.client.Request 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 57 with Request

use of com.google.gwt.http.client.Request 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)

Example 58 with Request

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

the class DownloadService method deleteGeneratedDownloads.

public Request deleteGeneratedDownloads(final DeleteGeneratedDownloadsRequest input, final AsyncCallback<DeleteGeneratedDownloadsResponse> callback) {
    Request handle = null;
    try {
        handle = sendRequest(DownloadMethodDeleteGeneratedDownloads, input, new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                try {
                    DeleteGeneratedDownloadsResponse outputParameter = new DeleteGeneratedDownloadsResponse();
                    parseResponse(response, outputParameter);
                    callback.onSuccess(outputParameter);
                    onCallSuccess(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, outputParameter);
                } catch (JSONException | HttpException exception) {
                    callback.onFailure(exception);
                    onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
                }
            }

            @Override
            public void onError(Request request, Throwable exception) {
                callback.onFailure(exception);
                onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
            }
        });
        onCallStart(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, handle);
    } catch (RequestException exception) {
        callback.onFailure(exception);
        onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, 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) DeleteGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse) RequestException(com.google.gwt.http.client.RequestException)

Example 59 with Request

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

the class NotificationService method updateNotificationSettings.

public Request updateNotificationSettings(UpdateNotificationSettingsRequest input, AsyncSuccess<UpdateNotificationSettingsRequest, UpdateNotificationSettingsResponse> onSuccess, AsyncFailure<UpdateNotificationSettingsRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodUpdateNotificationSettings, input, new RequestCallback() {

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

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
            }
        });
        onCallStart(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, 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) UpdateNotificationSettingsResponse(com.willshex.blogwt.shared.api.notification.call.UpdateNotificationSettingsResponse) 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 60 with Request

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

the class NotificationService method addMetaNotification.

public Request addMetaNotification(AddMetaNotificationRequest input, AsyncSuccess<AddMetaNotificationRequest, AddMetaNotificationResponse> onSuccess, AsyncFailure<AddMetaNotificationRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodAddMetaNotification, input, new RequestCallback() {

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

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(NotificationService.this, NotificationMethodAddMetaNotification, input, exception);
            }
        });
        onCallStart(NotificationService.this, NotificationMethodAddMetaNotification, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(NotificationService.this, NotificationMethodAddMetaNotification, 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) AddMetaNotificationResponse(com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationResponse) RequestException(com.google.gwt.http.client.RequestException)

Aggregations

Request (com.google.gwt.http.client.Request)63 RequestCallback (com.google.gwt.http.client.RequestCallback)62 Response (com.google.gwt.http.client.Response)62 RequestException (com.google.gwt.http.client.RequestException)59 JSONException (com.google.gwt.json.client.JSONException)55 HttpException (com.willshex.gson.web.service.client.HttpException)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