use of com.google.gwt.json.client.JSONException 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.google.gwt.json.client.JSONException 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;
}
use of com.google.gwt.json.client.JSONException in project blogwt by billy1380.
the class PageService method updatePage.
public Request updatePage(UpdatePageRequest input, AsyncSuccess<UpdatePageRequest, UpdatePageResponse> onSuccess, AsyncFailure<UpdatePageRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodUpdatePage, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdatePageResponse outputParameter = new UpdatePageResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodUpdatePage, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodUpdatePage, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodUpdatePage, input, exception);
}
});
onCallStart(PageService.this, PageMethodUpdatePage, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodUpdatePage, input, exception);
}
return handle;
}
use of com.google.gwt.json.client.JSONException 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.google.gwt.json.client.JSONException 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;
}
Aggregations