use of com.google.gwt.http.client.RequestException in project blogwt by billy1380.
the class UserService method getUserDetails.
public Request getUserDetails(GetUserDetailsRequest input, AsyncSuccess<GetUserDetailsRequest, GetUserDetailsResponse> onSuccess, AsyncFailure<GetUserDetailsRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodGetUserDetails, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
GetUserDetailsResponse outputParameter = new GetUserDetailsResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodGetUserDetails, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetUserDetails, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetUserDetails, input, exception);
}
});
onCallStart(UserService.this, UserMethodGetUserDetails, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodGetUserDetails, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestException in project blogwt by billy1380.
the class UserService method checkUsername.
public Request checkUsername(CheckUsernameRequest input, AsyncSuccess<CheckUsernameRequest, CheckUsernameResponse> onSuccess, AsyncFailure<CheckUsernameRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(UserMethodCheckUsername, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
CheckUsernameResponse outputParameter = new CheckUsernameResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(UserService.this, UserMethodCheckUsername, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodCheckUsername, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodCheckUsername, input, exception);
}
});
onCallStart(UserService.this, UserMethodCheckUsername, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(UserService.this, UserMethodCheckUsername, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestException in project blogwt by billy1380.
the class PageService method createPage.
public Request createPage(CreatePageRequest input, AsyncSuccess<CreatePageRequest, CreatePageResponse> onSuccess, AsyncFailure<CreatePageRequest> onFailure) {
Request handle = null;
try {
handle = sendRequest(PageMethodCreatePage, input, new RequestCallback() {
@Override
public void onResponseReceived(Request request, Response response) {
try {
CreatePageResponse outputParameter = new CreatePageResponse();
parseResponse(response, outputParameter);
if (onSuccess != null) {
onSuccess.call(input, outputParameter);
}
onCallSuccess(PageService.this, PageMethodCreatePage, input, outputParameter);
} catch (JSONException | HttpException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodCreatePage, input, exception);
}
}
@Override
public void onError(Request request, Throwable exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodCreatePage, input, exception);
}
});
onCallStart(PageService.this, PageMethodCreatePage, input, handle);
} catch (RequestException exception) {
if (onFailure != null) {
onFailure.call(input, exception);
}
onCallFailure(PageService.this, PageMethodCreatePage, input, exception);
}
return handle;
}
use of com.google.gwt.http.client.RequestException 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.google.gwt.http.client.RequestException 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;
}
Aggregations