use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class DownloadService method generateDownload.
public Request generateDownload(final GenerateDownloadRequest input, final AsyncCallback<GenerateDownloadResponse> callback) {
Request handle = null;
try {
handle = sendRequest(DownloadMethodGenerateDownload, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GenerateDownloadResponse outputParameter = new GenerateDownloadResponse();
parseResponse(response, outputParameter);
callback.onSuccess(outputParameter);
onCallSuccess(DownloadService.this, DownloadMethodGenerateDownload, input, outputParameter);
} catch (JSONException | HttpException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGenerateDownload, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGenerateDownload, input, exception);
}
});
onCallStart(DownloadService.this, DownloadMethodGenerateDownload, input, handle);
} catch (RequestException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGenerateDownload, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request in project blogwt by billy1380.
the class DownloadService method getGeneratedDownloads.
public Request getGeneratedDownloads(final GetGeneratedDownloadsRequest input, final AsyncCallback<GetGeneratedDownloadsResponse> callback) {
Request handle = null;
try {
handle = sendRequest(DownloadMethodGetGeneratedDownloads, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetGeneratedDownloadsResponse outputParameter = new GetGeneratedDownloadsResponse();
parseResponse(response, outputParameter);
callback.onSuccess(outputParameter);
onCallSuccess(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, outputParameter);
} catch (JSONException | HttpException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, exception);
}
});
onCallStart(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, handle);
} catch (RequestException exception) {
callback.onFailure(exception);
onCallFailure(DownloadService.this, DownloadMethodGetGeneratedDownloads, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.Request 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.google.gwt.http.client.Request 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.google.gwt.http.client.Request 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