src/main/java/edu/kit/informatik/pcc/webinterface/datamanagement/AccountDataManager.java
/**
     * This method creates an account by sending the order to the ServerProxy.
     * Then handles the answer.
     *
     * @param mail mail address
     * @param password password
     * @return true on success false else
     */
This method creates an account by sending the order to the ServerProxy.
Then handles the answer.

@param mail mail address
@param password password
@return true on success false else
This method creates an account by sending the order to the ServerProxy . Then handles the answer . @param mail mail address @param password password @return true on success false else
public static boolean createAccount(String mail, String password, VaadinSession session) {
        UUID id = UUID.randomUUID();
        if (!MailService.isValidEmailAddress(mail)) {
            MessageBox.createInfo()
                    .withMessage(errors.getString("noLegitMail"))
                    .open();
            return false;
        }
        if (password.length() < PASSWORDMIN) {
            MessageBox.createInfo()
                    .withMessage(errors.getString("toShortPassword"))
                    .open();
            return false;
        }
        Account account = new Account(mail, password);
        String ret = ServerProxy.createAccount(account, id);
        switch (ret) {
            case SUCCESS:
                session.setAttribute("account", account);
                sendVerificationMail(id, session);
                return true;
            case FAILURE:
                MessageBox.createInfo()
                        .withMessage(errors.getString("createFail"))
                        .open();
                return false;
            case ACCOUNTEXISTS:
                MessageBox.createInfo()
                        .withMessage(errors.getString("existingAccount"))
                        .open();
                return false;
            default:
                System.out.println(ret);
                MessageBox.createInfo()
                        .withMessage(errors.getString("createFail"))
                        .open();
                return false;
        }
    }
public static boolean createAccount ( String mail , String password , VaadinSession session ) { UUID id = UUID . randomUUID ( ) ; if ( ! MailService . isValidEmailAddress ( mail ) ) { MessageBox . createInfo ( ) . withMessage ( errors . getString ( "noLegitMail" ) ) . open ( ) ; return false ; } if ( password . length ( ) < PASSWORDMIN ) { MessageBox . createInfo ( ) . withMessage ( errors . getString ( "toShortPassword" ) ) . open ( ) ; return false ; } Account account = new Account ( mail , password ) ; String ret = ServerProxy . createAccount ( account , id ) ; switch ( ret ) { case SUCCESS : session . setAttribute ( "account" , account ) ; sendVerificationMail ( id , session ) ; return true ; case FAILURE : MessageBox . createInfo ( ) . withMessage ( errors . getString ( "createFail" ) ) . open ( ) ; return false ; case ACCOUNTEXISTS : MessageBox . createInfo ( ) . withMessage ( errors . getString ( "existingAccount" ) ) . open ( ) ; return false ; default : System . out . println ( ret ) ; MessageBox . createInfo ( ) . withMessage ( errors . getString ( "createFail" ) ) . open ( ) ; return false ; } }
This method creates an account by sending the order to the ServerProxy.
This method creates an account by sending the order to the ServerProxy .