Search in sources :

Example 1 with SetPushTokenResponse

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

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