use of com.willshex.blogwt.shared.api.notification.call.GetNotificationsResponse 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;
}
Aggregations