Search in sources :

Example 1 with SendAdhocNotificationResponse

use of com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationResponse 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)

Aggregations

Request (com.google.gwt.http.client.Request)1 RequestCallback (com.google.gwt.http.client.RequestCallback)1 RequestException (com.google.gwt.http.client.RequestException)1 Response (com.google.gwt.http.client.Response)1 JSONException (com.google.gwt.json.client.JSONException)1 AddMetaNotificationRequest (com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationRequest)1 AddMetaNotificationResponse (com.willshex.blogwt.shared.api.notification.call.AddMetaNotificationResponse)1 GetMetaNotificationRequest (com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationRequest)1 GetMetaNotificationResponse (com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationResponse)1 GetMetaNotificationsRequest (com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsRequest)1 GetMetaNotificationsResponse (com.willshex.blogwt.shared.api.notification.call.GetMetaNotificationsResponse)1 GetNotificationSettingsRequest (com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsRequest)1 GetNotificationSettingsResponse (com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsResponse)1 GetNotificationsRequest (com.willshex.blogwt.shared.api.notification.call.GetNotificationsRequest)1 GetNotificationsResponse (com.willshex.blogwt.shared.api.notification.call.GetNotificationsResponse)1 SendAdhocNotificationRequest (com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationRequest)1 SendAdhocNotificationResponse (com.willshex.blogwt.shared.api.notification.call.SendAdhocNotificationResponse)1 SetPushTokenRequest (com.willshex.blogwt.shared.api.notification.call.SetPushTokenRequest)1 SetPushTokenResponse (com.willshex.blogwt.shared.api.notification.call.SetPushTokenResponse)1 UpdateMetaNotificationRequest (com.willshex.blogwt.shared.api.notification.call.UpdateMetaNotificationRequest)1