Search in sources :

Example 1 with DeleteGeneratedDownloadsResponse

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);
        }
    });
}
Also used : DeleteGeneratedDownloadsRequest(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest) DeleteGeneratedDownloadsFailure(com.willshex.blogwt.client.api.download.event.DeleteGeneratedDownloadsEventHandler.DeleteGeneratedDownloadsFailure) DeleteGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse) DeleteGeneratedDownloadsSuccess(com.willshex.blogwt.client.api.download.event.DeleteGeneratedDownloadsEventHandler.DeleteGeneratedDownloadsSuccess)

Example 2 with DeleteGeneratedDownloadsResponse

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;
}
Also used : GenerateDownloadResponse(com.willshex.blogwt.shared.api.download.call.GenerateDownloadResponse) GetGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsResponse) DeleteGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse) Response(com.google.gwt.http.client.Response) RequestCallback(com.google.gwt.http.client.RequestCallback) DeleteGeneratedDownloadsRequest(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest) GenerateDownloadRequest(com.willshex.blogwt.shared.api.download.call.GenerateDownloadRequest) Request(com.google.gwt.http.client.Request) GetGeneratedDownloadsRequest(com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsRequest) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) DeleteGeneratedDownloadsResponse(com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse) RequestException(com.google.gwt.http.client.RequestException)

Aggregations

DeleteGeneratedDownloadsRequest (com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsRequest)2 DeleteGeneratedDownloadsResponse (com.willshex.blogwt.shared.api.download.call.DeleteGeneratedDownloadsResponse)2 Request (com.google.gwt.http.client.Request)1 RequestCallback (com.google.gwt.http.client.RequestCallback)1 RequestException (com.google.gwt.http.client.RequestException)1 Response (com.google.gwt.http.client.Response)1 JSONException (com.google.gwt.json.client.JSONException)1 DeleteGeneratedDownloadsFailure (com.willshex.blogwt.client.api.download.event.DeleteGeneratedDownloadsEventHandler.DeleteGeneratedDownloadsFailure)1 DeleteGeneratedDownloadsSuccess (com.willshex.blogwt.client.api.download.event.DeleteGeneratedDownloadsEventHandler.DeleteGeneratedDownloadsSuccess)1 GenerateDownloadRequest (com.willshex.blogwt.shared.api.download.call.GenerateDownloadRequest)1 GenerateDownloadResponse (com.willshex.blogwt.shared.api.download.call.GenerateDownloadResponse)1 GetGeneratedDownloadsRequest (com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsRequest)1 GetGeneratedDownloadsResponse (com.willshex.blogwt.shared.api.download.call.GetGeneratedDownloadsResponse)1 HttpException (com.willshex.gson.web.service.client.HttpException)1