use of com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse in project blogwt by billy1380.
the class GeneratedDownloadController method deleteGeneratedDownload.
public void deleteGeneratedDownload(GeneratedDownload generatedDownload) {
final DeleteGeneratedDownloadsRequest input = ApiHelper.setAccessCode(new DeleteGeneratedDownloadsRequest());
input.session = SessionController.get().sessionForApiCall();
input.downloads = Arrays.asList(generatedDownload);
ApiHelper.createDownloadClient().deleteGeneratedDownloads(input, new AsyncCallback<DeleteGeneratedDownloadsResponse>() {
@Override
public void onSuccess(DeleteGeneratedDownloadsResponse output) {
DefaultEventBus.get().fireEventFromSource(new DeleteGeneratedDownloadsSuccess(input, output), GeneratedDownloadController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new DeleteGeneratedDownloadsFailure(input, caught), GeneratedDownloadController.this);
}
});
}
use of com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse 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;
}
Aggregations