Search in sources :

Example 1 with VerifyAccountRequest

use of com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest in project blogwt by billy1380.

the class UserController method verifyAccount.

/**
 * @param actionCode
 */
public void verifyAccount(String actionCode) {
    final VerifyAccountRequest input = ApiHelper.setAccessCode(new VerifyAccountRequest());
    input.session = SessionController.get().sessionForApiCall();
    input.actionCode = actionCode;
    ApiHelper.createUserClient().verifyAccount(input, new AsyncCallback<VerifyAccountResponse>() {

        @Override
        public void onSuccess(VerifyAccountResponse output) {
            if (output.status == StatusType.StatusTypeSuccess) {
            }
            DefaultEventBus.get().fireEventFromSource(new VerifyAccountSuccess(input, output), UserController.this);
        }

        @Override
        public void onFailure(Throwable caught) {
            DefaultEventBus.get().fireEventFromSource(new VerifyAccountFailure(input, caught), UserController.this);
        }
    });
}
Also used : VerifyAccountResponse(com.willshex.blogwt.shared.api.user.call.VerifyAccountResponse) VerifyAccountRequest(com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest) VerifyAccountSuccess(com.willshex.blogwt.client.api.user.event.VerifyAccountEventHandler.VerifyAccountSuccess) VerifyAccountFailure(com.willshex.blogwt.client.api.user.event.VerifyAccountEventHandler.VerifyAccountFailure)

Example 2 with VerifyAccountRequest

use of com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest in project blogwt by billy1380.

the class UserJsonServlet method processAction.

@Override
protected String processAction(String action, JsonObject request) {
    String output = "null";
    if ("GetUsers".equals(action)) {
        GetUsersRequest input = new GetUsersRequest();
        input.fromJson(request);
        output = new GetUsersActionHandler().handle(input).toString();
    } else if ("BlockUsers".equals(action)) {
        BlockUsersRequest input = new BlockUsersRequest();
        input.fromJson(request);
        output = new BlockUsersActionHandler().handle(input).toString();
    } else if ("FollowUsers".equals(action)) {
        FollowUsersRequest input = new FollowUsersRequest();
        input.fromJson(request);
        output = new FollowUsersActionHandler().handle(input).toString();
    } else if ("ChangeUserAccess".equals(action)) {
        ChangeUserAccessRequest input = new ChangeUserAccessRequest();
        input.fromJson(request);
        output = new ChangeUserAccessActionHandler().handle(input).toString();
    } else if ("GetRoles".equals(action)) {
        GetRolesRequest input = new GetRolesRequest();
        input.fromJson(request);
        output = new GetRolesActionHandler().handle(input).toString();
    } else if ("GetPermissions".equals(action)) {
        GetPermissionsRequest input = new GetPermissionsRequest();
        input.fromJson(request);
        output = new GetPermissionsActionHandler().handle(input).toString();
    } else if ("GetRolesAndPermissions".equals(action)) {
        GetRolesAndPermissionsRequest input = new GetRolesAndPermissionsRequest();
        input.fromJson(request);
        output = new GetRolesAndPermissionsActionHandler().handle(input).toString();
    } else if ("VerifyAccount".equals(action)) {
        VerifyAccountRequest input = new VerifyAccountRequest();
        input.fromJson(request);
        output = new VerifyAccountActionHandler().handle(input).toString();
    } else if ("ResetPassword".equals(action)) {
        ResetPasswordRequest input = new ResetPasswordRequest();
        input.fromJson(request);
        output = new ResetPasswordActionHandler().handle(input).toString();
    } else if ("GetEmailAvatar".equals(action)) {
        GetEmailAvatarRequest input = new GetEmailAvatarRequest();
        input.fromJson(request);
        output = new GetEmailAvatarActionHandler().handle(input).toString();
    } else if ("RegisterUser".equals(action)) {
        RegisterUserRequest input = new RegisterUserRequest();
        input.fromJson(request);
        output = new RegisterUserActionHandler().handle(input).toString();
    } else if ("ChangeUserDetails".equals(action)) {
        ChangeUserDetailsRequest input = new ChangeUserDetailsRequest();
        input.fromJson(request);
        output = new ChangeUserDetailsActionHandler().handle(input).toString();
    } else if ("Login".equals(action)) {
        LoginRequest input = new LoginRequest();
        input.fromJson(request);
        output = new LoginActionHandler().handle(input).toString();
    } else if ("Logout".equals(action)) {
        LogoutRequest input = new LogoutRequest();
        input.fromJson(request);
        output = new LogoutActionHandler().handle(input).toString();
    } else if ("ChangePassword".equals(action)) {
        ChangePasswordRequest input = new ChangePasswordRequest();
        input.fromJson(request);
        output = new ChangePasswordActionHandler().handle(input).toString();
    } else if ("CheckUsername".equals(action)) {
        CheckUsernameRequest input = new CheckUsernameRequest();
        input.fromJson(request);
        output = new CheckUsernameActionHandler().handle(input).toString();
    } else if ("IsAuthorised".equals(action)) {
        IsAuthorisedRequest input = new IsAuthorisedRequest();
        input.fromJson(request);
        output = new IsAuthorisedActionHandler().handle(input).toString();
    } else if ("GetUserDetails".equals(action)) {
        GetUserDetailsRequest input = new GetUserDetailsRequest();
        input.fromJson(request);
        output = new GetUserDetailsActionHandler().handle(input).toString();
    } else if ("ForgotPassword".equals(action)) {
        ForgotPasswordRequest input = new ForgotPasswordRequest();
        input.fromJson(request);
        output = new ForgotPasswordActionHandler().handle(input).toString();
    }
    return output;
}
Also used : ForgotPasswordRequest(com.willshex.blogwt.shared.api.user.call.ForgotPasswordRequest) ChangeUserAccessActionHandler(com.willshex.blogwt.server.api.user.action.ChangeUserAccessActionHandler) CheckUsernameActionHandler(com.willshex.blogwt.server.api.user.action.CheckUsernameActionHandler) GetRolesAndPermissionsRequest(com.willshex.blogwt.shared.api.user.call.GetRolesAndPermissionsRequest) BlockUsersActionHandler(com.willshex.blogwt.server.api.user.action.BlockUsersActionHandler) GetUserDetailsRequest(com.willshex.blogwt.shared.api.user.call.GetUserDetailsRequest) FollowUsersRequest(com.willshex.blogwt.shared.api.user.call.FollowUsersRequest) LoginRequest(com.willshex.blogwt.shared.api.user.call.LoginRequest) GetRolesActionHandler(com.willshex.blogwt.server.api.user.action.GetRolesActionHandler) ChangePasswordRequest(com.willshex.blogwt.shared.api.user.call.ChangePasswordRequest) IsAuthorisedRequest(com.willshex.blogwt.shared.api.user.call.IsAuthorisedRequest) GetPermissionsRequest(com.willshex.blogwt.shared.api.user.call.GetPermissionsRequest) ResetPasswordRequest(com.willshex.blogwt.shared.api.user.call.ResetPasswordRequest) VerifyAccountActionHandler(com.willshex.blogwt.server.api.user.action.VerifyAccountActionHandler) GetEmailAvatarRequest(com.willshex.blogwt.shared.api.user.call.GetEmailAvatarRequest) ResetPasswordActionHandler(com.willshex.blogwt.server.api.user.action.ResetPasswordActionHandler) LogoutRequest(com.willshex.blogwt.shared.api.user.call.LogoutRequest) ChangeUserDetailsActionHandler(com.willshex.blogwt.server.api.user.action.ChangeUserDetailsActionHandler) GetRolesRequest(com.willshex.blogwt.shared.api.user.call.GetRolesRequest) ForgotPasswordActionHandler(com.willshex.blogwt.server.api.user.action.ForgotPasswordActionHandler) RegisterUserRequest(com.willshex.blogwt.shared.api.user.call.RegisterUserRequest) GetUsersActionHandler(com.willshex.blogwt.server.api.user.action.GetUsersActionHandler) GetEmailAvatarActionHandler(com.willshex.blogwt.server.api.user.action.GetEmailAvatarActionHandler) ChangeUserAccessRequest(com.willshex.blogwt.shared.api.user.call.ChangeUserAccessRequest) RegisterUserActionHandler(com.willshex.blogwt.server.api.user.action.RegisterUserActionHandler) GetUsersRequest(com.willshex.blogwt.shared.api.user.call.GetUsersRequest) BlockUsersRequest(com.willshex.blogwt.shared.api.user.call.BlockUsersRequest) GetPermissionsActionHandler(com.willshex.blogwt.server.api.user.action.GetPermissionsActionHandler) GetRolesAndPermissionsActionHandler(com.willshex.blogwt.server.api.user.action.GetRolesAndPermissionsActionHandler) LoginActionHandler(com.willshex.blogwt.server.api.user.action.LoginActionHandler) ChangePasswordActionHandler(com.willshex.blogwt.server.api.user.action.ChangePasswordActionHandler) ChangeUserDetailsRequest(com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsRequest) IsAuthorisedActionHandler(com.willshex.blogwt.server.api.user.action.IsAuthorisedActionHandler) FollowUsersActionHandler(com.willshex.blogwt.server.api.user.action.FollowUsersActionHandler) VerifyAccountRequest(com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest) GetUserDetailsActionHandler(com.willshex.blogwt.server.api.user.action.GetUserDetailsActionHandler) LogoutActionHandler(com.willshex.blogwt.server.api.user.action.LogoutActionHandler) CheckUsernameRequest(com.willshex.blogwt.shared.api.user.call.CheckUsernameRequest)

Example 3 with VerifyAccountRequest

use of com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest in project blogwt by billy1380.

the class UserService method verifyAccount.

public Request verifyAccount(VerifyAccountRequest input, AsyncSuccess<VerifyAccountRequest, VerifyAccountResponse> onSuccess, AsyncFailure<VerifyAccountRequest> onFailure) {
    Request handle = null;
    try {
        handle = sendRequest(UserMethodVerifyAccount, input, new RequestCallback() {

            @Override
            public void onResponseReceived(Request request, Response response) {
                try {
                    VerifyAccountResponse outputParameter = new VerifyAccountResponse();
                    parseResponse(response, outputParameter);
                    if (onSuccess != null) {
                        onSuccess.call(input, outputParameter);
                    }
                    onCallSuccess(UserService.this, UserMethodVerifyAccount, input, outputParameter);
                } catch (JSONException | HttpException exception) {
                    if (onFailure != null) {
                        onFailure.call(input, exception);
                    }
                    onCallFailure(UserService.this, UserMethodVerifyAccount, input, exception);
                }
            }

            @Override
            public void onError(Request request, Throwable exception) {
                if (onFailure != null) {
                    onFailure.call(input, exception);
                }
                onCallFailure(UserService.this, UserMethodVerifyAccount, input, exception);
            }
        });
        onCallStart(UserService.this, UserMethodVerifyAccount, input, handle);
    } catch (RequestException exception) {
        if (onFailure != null) {
            onFailure.call(input, exception);
        }
        onCallFailure(UserService.this, UserMethodVerifyAccount, input, exception);
    }
    return handle;
}
Also used : GetPermissionsResponse(com.willshex.blogwt.shared.api.user.call.GetPermissionsResponse) GetUsersResponse(com.willshex.blogwt.shared.api.user.call.GetUsersResponse) Response(com.google.gwt.http.client.Response) ChangeUserAccessResponse(com.willshex.blogwt.shared.api.user.call.ChangeUserAccessResponse) ResetPasswordResponse(com.willshex.blogwt.shared.api.user.call.ResetPasswordResponse) LogoutResponse(com.willshex.blogwt.shared.api.user.call.LogoutResponse) GetUserDetailsResponse(com.willshex.blogwt.shared.api.user.call.GetUserDetailsResponse) RegisterUserResponse(com.willshex.blogwt.shared.api.user.call.RegisterUserResponse) VerifyAccountResponse(com.willshex.blogwt.shared.api.user.call.VerifyAccountResponse) FollowUsersResponse(com.willshex.blogwt.shared.api.user.call.FollowUsersResponse) GetRolesResponse(com.willshex.blogwt.shared.api.user.call.GetRolesResponse) GetEmailAvatarResponse(com.willshex.blogwt.shared.api.user.call.GetEmailAvatarResponse) GetRolesAndPermissionsResponse(com.willshex.blogwt.shared.api.user.call.GetRolesAndPermissionsResponse) ChangeUserDetailsResponse(com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsResponse) IsAuthorisedResponse(com.willshex.blogwt.shared.api.user.call.IsAuthorisedResponse) ChangePasswordResponse(com.willshex.blogwt.shared.api.user.call.ChangePasswordResponse) CheckUsernameResponse(com.willshex.blogwt.shared.api.user.call.CheckUsernameResponse) LoginResponse(com.willshex.blogwt.shared.api.user.call.LoginResponse) BlockUsersResponse(com.willshex.blogwt.shared.api.user.call.BlockUsersResponse) ForgotPasswordResponse(com.willshex.blogwt.shared.api.user.call.ForgotPasswordResponse) VerifyAccountResponse(com.willshex.blogwt.shared.api.user.call.VerifyAccountResponse) RequestCallback(com.google.gwt.http.client.RequestCallback) ForgotPasswordRequest(com.willshex.blogwt.shared.api.user.call.ForgotPasswordRequest) ChangeUserAccessRequest(com.willshex.blogwt.shared.api.user.call.ChangeUserAccessRequest) GetUserDetailsRequest(com.willshex.blogwt.shared.api.user.call.GetUserDetailsRequest) ChangePasswordRequest(com.willshex.blogwt.shared.api.user.call.ChangePasswordRequest) GetEmailAvatarRequest(com.willshex.blogwt.shared.api.user.call.GetEmailAvatarRequest) IsAuthorisedRequest(com.willshex.blogwt.shared.api.user.call.IsAuthorisedRequest) RegisterUserRequest(com.willshex.blogwt.shared.api.user.call.RegisterUserRequest) GetRolesRequest(com.willshex.blogwt.shared.api.user.call.GetRolesRequest) LogoutRequest(com.willshex.blogwt.shared.api.user.call.LogoutRequest) ChangeUserDetailsRequest(com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsRequest) GetRolesAndPermissionsRequest(com.willshex.blogwt.shared.api.user.call.GetRolesAndPermissionsRequest) VerifyAccountRequest(com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest) ResetPasswordRequest(com.willshex.blogwt.shared.api.user.call.ResetPasswordRequest) GetUsersRequest(com.willshex.blogwt.shared.api.user.call.GetUsersRequest) FollowUsersRequest(com.willshex.blogwt.shared.api.user.call.FollowUsersRequest) BlockUsersRequest(com.willshex.blogwt.shared.api.user.call.BlockUsersRequest) CheckUsernameRequest(com.willshex.blogwt.shared.api.user.call.CheckUsernameRequest) LoginRequest(com.willshex.blogwt.shared.api.user.call.LoginRequest) GetPermissionsRequest(com.willshex.blogwt.shared.api.user.call.GetPermissionsRequest) Request(com.google.gwt.http.client.Request) JSONException(com.google.gwt.json.client.JSONException) HttpException(com.willshex.gson.web.service.client.HttpException) RequestException(com.google.gwt.http.client.RequestException)

Aggregations

VerifyAccountRequest (com.willshex.blogwt.shared.api.user.call.VerifyAccountRequest)3 BlockUsersRequest (com.willshex.blogwt.shared.api.user.call.BlockUsersRequest)2 ChangePasswordRequest (com.willshex.blogwt.shared.api.user.call.ChangePasswordRequest)2 ChangeUserAccessRequest (com.willshex.blogwt.shared.api.user.call.ChangeUserAccessRequest)2 ChangeUserDetailsRequest (com.willshex.blogwt.shared.api.user.call.ChangeUserDetailsRequest)2 CheckUsernameRequest (com.willshex.blogwt.shared.api.user.call.CheckUsernameRequest)2 FollowUsersRequest (com.willshex.blogwt.shared.api.user.call.FollowUsersRequest)2 ForgotPasswordRequest (com.willshex.blogwt.shared.api.user.call.ForgotPasswordRequest)2 GetEmailAvatarRequest (com.willshex.blogwt.shared.api.user.call.GetEmailAvatarRequest)2 GetPermissionsRequest (com.willshex.blogwt.shared.api.user.call.GetPermissionsRequest)2 GetRolesAndPermissionsRequest (com.willshex.blogwt.shared.api.user.call.GetRolesAndPermissionsRequest)2 GetRolesRequest (com.willshex.blogwt.shared.api.user.call.GetRolesRequest)2 GetUserDetailsRequest (com.willshex.blogwt.shared.api.user.call.GetUserDetailsRequest)2 GetUsersRequest (com.willshex.blogwt.shared.api.user.call.GetUsersRequest)2 IsAuthorisedRequest (com.willshex.blogwt.shared.api.user.call.IsAuthorisedRequest)2 LoginRequest (com.willshex.blogwt.shared.api.user.call.LoginRequest)2 LogoutRequest (com.willshex.blogwt.shared.api.user.call.LogoutRequest)2 RegisterUserRequest (com.willshex.blogwt.shared.api.user.call.RegisterUserRequest)2 ResetPasswordRequest (com.willshex.blogwt.shared.api.user.call.ResetPasswordRequest)2 Request (com.google.gwt.http.client.Request)1