use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class PageService method getPages.
public Request getPages(GetPagesRequest input, AsyncSuccess<GetPagesRequest, GetPagesResponse> onSuccess, AsyncFailure<GetPagesRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodGetPages, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetPagesResponse outputParameter = new GetPagesResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodGetPages, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodGetPages, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodGetPages, input, exception);
}
});
onCallStart(PageService.this, PageMethodGetPages, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodGetPages, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class PageService method submitForm.
public Request submitForm(SubmitFormRequest input, AsyncSuccess<SubmitFormRequest, SubmitFormResponse> onSuccess, AsyncFailure<SubmitFormRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodSubmitForm, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
SubmitFormResponse outputParameter = new SubmitFormResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodSubmitForm, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodSubmitForm, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodSubmitForm, input, exception);
}
});
onCallStart(PageService.this, PageMethodSubmitForm, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodSubmitForm, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class SearchService method searchAll.
public Request searchAll(SearchAllRequest input, AsyncSuccess<SearchAllRequest, SearchAllResponse> onSuccess, AsyncFailure<SearchAllRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(SearchMethodSearchAll, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
SearchAllResponse outputParameter = new SearchAllResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(SearchService.this, SearchMethodSearchAll, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(SearchService.this, SearchMethodSearchAll, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(SearchService.this, SearchMethodSearchAll, input, exception);
}
});
onCallStart(SearchService.this, SearchMethodSearchAll, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(SearchService.this, SearchMethodSearchAll, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class UserService method getEmailAvatar.
public Request getEmailAvatar(GetEmailAvatarRequest input, AsyncSuccess<GetEmailAvatarRequest, GetEmailAvatarResponse> onSuccess, AsyncFailure<GetEmailAvatarRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodGetEmailAvatar, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetEmailAvatarResponse outputParameter = new GetEmailAvatarResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodGetEmailAvatar, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetEmailAvatar, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetEmailAvatar, input, exception);
}
});
onCallStart(UserService.this, UserMethodGetEmailAvatar, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetEmailAvatar, input, exception);
}
return handle;
}
use of com.willshex.gson.web.service.client.HttpException in project blogwt by billy1380.
the class UserService method blockUsers.
public Request blockUsers(BlockUsersRequest input, AsyncSuccess<BlockUsersRequest, BlockUsersResponse> onSuccess, AsyncFailure<BlockUsersRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodBlockUsers, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
BlockUsersResponse outputParameter = new BlockUsersResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodBlockUsers, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodBlockUsers, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodBlockUsers, input, exception);
}
});
onCallStart(UserService.this, UserMethodBlockUsers, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodBlockUsers, input, exception);
}
return handle;
}
Aggregations