Search in sources :

Example 1 with GetUserDetailsFailure

use of com.willshex.blogwt.client.api.user.event.GetUserDetailsEventHandler.GetUserDetailsFailure 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);
        }
    });
}
Also used : GetUserDetailsRequest(com.willshex.blogwt.shared.api.user.call.GetUserDetailsRequest) AsyncCallback(com.google.gwt.user.client.rpc.AsyncCallback) GetUserDetailsResponse(com.willshex.blogwt.shared.api.user.call.GetUserDetailsResponse) GetUserDetailsSuccess(com.willshex.blogwt.client.api.user.event.GetUserDetailsEventHandler.GetUserDetailsSuccess) GetUserDetailsFailure(com.willshex.blogwt.client.api.user.event.GetUserDetailsEventHandler.GetUserDetailsFailure)

Aggregations

AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)1 GetUserDetailsFailure (com.willshex.blogwt.client.api.user.event.GetUserDetailsEventHandler.GetUserDetailsFailure)1 GetUserDetailsSuccess (com.willshex.blogwt.client.api.user.event.GetUserDetailsEventHandler.GetUserDetailsSuccess)1 GetUserDetailsRequest (com.willshex.blogwt.shared.api.user.call.GetUserDetailsRequest)1 GetUserDetailsResponse (com.willshex.blogwt.shared.api.user.call.GetUserDetailsResponse)1