use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class DownloadService method deleteGeneratedDownloads.
public Request deleteGeneratedDownloads(final DeleteGeneratedDownloadsRequest input, final AsyncCallback<DeleteGeneratedDownloadsResponse> callback) {
Request handle = null;
try {
handle = sendRequest(DownloadMethodDeleteGeneratedDownloads, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
DeleteGeneratedDownloadsResponse outputParameter = new DeleteGeneratedDownloadsResponse();
parseResponse(response, outputParameter);
callback.onSuccess(outputParameter);
onCallSuccess(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, outputParameter);
} catch (JSONException | HttpException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
}
});
onCallStart(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, handle);
} catch (RequestException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodDeleteGeneratedDownloads, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class NotificationService method updateNotificationSettings.
public Request updateNotificationSettings(UpdateNotificationSettingsRequest input, AsyncSuccess<UpdateNotificationSettingsRequest, UpdateNotificationSettingsResponse> onSuccess, AsyncFailure<UpdateNotificationSettingsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodUpdateNotificationSettings, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdateNotificationSettingsResponse outputParameter = new UpdateNotificationSettingsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateNotificationSettings, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException 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;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class PageService method deletePage.
public Request deletePage(DeletePageRequest input, AsyncSuccess<DeletePageRequest, DeletePageResponse> onSuccess, AsyncFailure<DeletePageRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodDeletePage, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
DeletePageResponse outputParameter = new DeletePageResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodDeletePage, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodDeletePage, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodDeletePage, input, exception);
}
});
onCallStart(PageService.this, PageMethodDeletePage, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodDeletePage, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class PageService method getPage.
public Request getPage(GetPageRequest input, AsyncSuccess<GetPageRequest, GetPageResponse> onSuccess, AsyncFailure<GetPageRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodGetPage, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetPageResponse outputParameter = new GetPageResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodGetPage, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodGetPage, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodGetPage, input, exception);
}
});
onCallStart(PageService.this, PageMethodGetPage, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodGetPage, input, exception);
}
return handle;
}
Aggregations