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