use of com.willshex.blogwt.shared.api.notification.call.GetNotificationSettingsResponse in project blogwt by billy1380.
the class NotificationService method getNotificationSettings.
public Request getNotificationSettings(GetNotificationSettingsRequest input, AsyncSuccess<GetNotificationSettingsRequest, GetNotificationSettingsResponse> onSuccess, AsyncFailure<GetNotificationSettingsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodGetNotificationSettings, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetNotificationSettingsResponse outputParameter = new GetNotificationSettingsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodGetNotificationSettings, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotificationSettings, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotificationSettings, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodGetNotificationSettings, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotificationSettings, input, exception);
}
return handle;
}
Aggregations