use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class BlogService method getProperties.
public Request getProperties(GetPropertiesRequest input, AsyncSuccess<GetPropertiesRequest, GetPropertiesResponse> onSuccess, AsyncFailure<GetPropertiesRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetProperties, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetPropertiesResponse outputParameter = new GetPropertiesResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetProperties, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetProperties, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetProperties, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetProperties, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetProperties, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class BlogService method getResource.
public Request getResource(GetResourceRequest input, AsyncSuccess<GetResourceRequest, GetResourceResponse> onSuccess, AsyncFailure<GetResourceRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetResource, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetResourceResponse outputParameter = new GetResourceResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetResource, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResource, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResource, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetResource, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetResource, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class BlogService method getTags.
public Request getTags(GetTagsRequest input, AsyncSuccess<GetTagsRequest, GetTagsResponse> onSuccess, AsyncFailure<GetTagsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(BlogMethodGetTags, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetTagsResponse outputParameter = new GetTagsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(BlogService.this, BlogMethodGetTags, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetTags, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetTags, input, exception);
}
});
onCallStart(BlogService.this, BlogMethodGetTags, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(BlogService.this, BlogMethodGetTags, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class NotificationService method updateMetaNotification.
public Request updateMetaNotification(UpdateMetaNotificationRequest input, AsyncSuccess<UpdateMetaNotificationRequest, UpdateMetaNotificationResponse> onSuccess, AsyncFailure<UpdateMetaNotificationRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodUpdateMetaNotification, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
UpdateMetaNotificationResponse outputParameter = new UpdateMetaNotificationResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodUpdateMetaNotification, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateMetaNotification, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateMetaNotification, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodUpdateMetaNotification, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodUpdateMetaNotification, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class NotificationService method getNotifications.
public Request getNotifications(GetNotificationsRequest input, AsyncSuccess<GetNotificationsRequest, GetNotificationsResponse> onSuccess, AsyncFailure<GetNotificationsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(NotificationMethodGetNotifications, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetNotificationsResponse outputParameter = new GetNotificationsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(NotificationService.this, NotificationMethodGetNotifications, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotifications, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotifications, input, exception);
}
});
onCallStart(NotificationService.this, NotificationMethodGetNotifications, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(NotificationService.this, NotificationMethodGetNotifications, input, exception);
}
return handle;
}
Aggregations