Search in sources :

Example 71 with Response

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

the class UserService method followUsers.

public Request followUsers(FollowUsersRequest input, AsyncSuccess<FollowUsersRequest, FollowUsersResponse> onSuccess, AsyncFailure<FollowUsersRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(UserMethodFollowUsers, input, new RequestCallback() {

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

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(UserService.this, UserMethodFollowUsers, input, exception);
            }
        });
        onCallStart(UserService.this, UserMethodFollowUsers, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(UserService.this, UserMethodFollowUsers, input, exception);
    }
    return handle;
}
Also used : GetPermissionsResponse(com.willshex.blogwt.shared.api.user.call.GetPermissionsResponse) GetUsersResponse(com.willshex.blogwt.shared.api.user.call.GetUsersResponse) Response(com.google.gwt.http.client.Response) ChangeUserAccessResponse(com.willshex.blogwt.shared.api.user.call.ChangeUserAccessResponse) ResetPasswordResponse(com.willshex.blogwt.shared.api.user.call.ResetPasswordResponse) LogoutResponse(com.willshex.blogwt.shared.api.user.call.LogoutResponse) GetUserDetailsResponse(com.willshex.blogwt.shared.api.user.call.GetUserDetailsResponse) RegisterUserResponse(com.willshex.blogwt.shared.api.user.call.RegisterUserResponse) VerifyAccountResponse(com.willshex.blogwt.shared.api.user.call.VerifyAccountResponse) FollowUsersResponse(com.willshex.blogwt.shared.api.user.call.FollowUsersResponse) GetRolesResponse(com.willshex.blogwt.shared.api.user.call.GetRolesResponse) GetEmailAvatarResponse(com.willshex.blogwt.shared.api.user.call.GetEmailAvatarResponse) GetRolesAndPermissionsResponse(com.willshex.blogwt.shared.api.user.call.GetRolesAndPermissionsResponse) ChangeUserDetailsResponse(com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsResponse) IsAuthorisedResponse(com.willshex.blogwt.shared.api.user.call.IsAuthorisedResponse) ChangePasswordResponse(com.willshex.blogwt.shared.api.user.call.ChangePasswordResponse) CheckUsernameResponse(com.willshex.blogwt.shared.api.user.call.CheckUsernameResponse) LoginResponse(com.willshex.blogwt.shared.api.user.call.LoginResponse) BlockUsersResponse(com.willshex.blogwt.shared.api.user.call.BlockUsersResponse) ForgotPasswordResponse(com.willshex.blogwt.shared.api.user.call.ForgotPasswordResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) ForgotPasswordRequest(com.willshex.blogwt.shared.api.user.call.ForgotPasswordRequest) ChangeUserAccessRequest(com.willshex.blogwt.shared.api.user.call.ChangeUserAccessRequest) GetUserDetailsRequest(com.willshex.blogwt.shared.api.user.call.GetUserDetailsRequest) ChangePasswordRequest(com.willshex.blogwt.shared.api.user.call.ChangePasswordRequest) GetEmailAvatarRequest(com.willshex.blogwt.shared.api.user.call.GetEmailAvatarRequest) IsAuthorisedRequest(com.willshex.blogwt.shared.api.user.call.IsAuthorisedRequest) RegisterUserRequest(com.willshex.blogwt.shared.api.user.call.RegisterUserRequest) GetRolesRequest(com.willshex.blogwt.shared.api.user.call.GetRolesRequest) LogoutRequest(com.willshex.blogwt.shared.api.user.call.LogoutRequest) ChangeUserDetailsRequest(com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsRequest) GetRolesAndPermissionsRequest(com.willshex.blogwt.shared.api.user.call.GetRolesAndPermissionsRequest) VerifyAccountRequest(com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest) ResetPasswordRequest(com.willshex.blogwt.shared.api.user.call.ResetPasswordRequest) GetUsersRequest(com.willshex.blogwt.shared.api.user.call.GetUsersRequest) FollowUsersRequest(com.willshex.blogwt.shared.api.user.call.FollowUsersRequest) BlockUsersRequest(com.willshex.blogwt.shared.api.user.call.BlockUsersRequest) CheckUsernameRequest(com.willshex.blogwt.shared.api.user.call.CheckUsernameRequest) LoginRequest(com.willshex.blogwt.shared.api.user.call.LoginRequest) GetPermissionsRequest(com.willshex.blogwt.shared.api.user.call.GetPermissionsRequest) Request(com.google.gwt.http.client.Request) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) FollowUsersResponse(com.willshex.blogwt.shared.api.user.call.FollowUsersResponse) RequestException(com.google.gwt.http.client.RequestException)

Example 72 with Response

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

Example 73 with Response

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

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

the class NotificationService method getMetaNotifications.

public Request getMetaNotifications(GetMetaNotificationsRequest input, AsyncSuccess<GetMetaNotificationsRequest, GetMetaNotificationsResponse> onSuccess, AsyncFailure<GetMetaNotificationsRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodGetMetaNotifications, input, new RequestCallback() {

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

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

Example 75 with Response

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

the class NotificationService method setPushToken.

public Request setPushToken(SetPushTokenRequest input, AsyncSuccess<SetPushTokenRequest, SetPushTokenResponse> onSuccess, AsyncFailure<SetPushTokenRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(NotificationMethodSetPushToken, input, new RequestCallback() {

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

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

Aggregations

Response (com.google.gwt.http.client.Response)168 Request (com.google.gwt.http.client.Request)166 RequestCallback (com.google.gwt.http.client.RequestCallback)165 RequestException (com.google.gwt.http.client.RequestException)158 RequestBuilder (com.google.gwt.http.client.RequestBuilder)108 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