use of com.willshex.blogwt.shared.api.user.call.GetUserDetailsResponse 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.willshex.blogwt.shared.api.user.call.GetUserDetailsResponse in project blogwt by billy1380.
the class UserController method getUser.
/**
* @param user
*/
public void getUser(User user) {
final GetUserDetailsRequest input = ApiHelper.setAccessCode(new GetUserDetailsRequest());
input.session = SessionController.get().sessionForApiCall();
input.user = user;
if (getUserRequest != null) {
getUserRequest.cancel();
}
getUserRequest = ApiHelper.createUserClient().getUserDetails(input, new AsyncCallback<GetUserDetailsResponse>() {
@Override
public void onSuccess(GetUserDetailsResponse output) {
getUserRequest = null;
if (output.status == StatusType.StatusTypeSuccess) {
}
DefaultEventBus.get().fireEventFromSource(new GetUserDetailsSuccess(input, output), UserController.this);
}
@Override
public void onFailure(Throwable caught) {
DefaultEventBus.get().fireEventFromSource(new GetUserDetailsFailure(input, caught), UserController.this);
}
});
}
Aggregations