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