Package org.jayasoft.woj.common.model.registration

Examples of org.jayasoft.woj.common.model.registration.RegistrationException


                    || StringUtils.isBlank(u.getFirstName())
                    || StringUtils.isBlank(u.getLastName())
                    || StringUtils.isBlank(u.getCountry())
                ) {
                r = new RegistrationError();
                ((RegistrationError)r).setCause(new RegistrationException("missing required fields or fields contain only spaces"));
            } else if (!EmailHelper.doEmailSeemsValid(u.getEmail())) {
                r = new RegistrationError();
                ((RegistrationError)r).setCause(new RegistrationException("your email seems to be invalid"));
            } else {
                User registeredUser = ServiceFactory.getRegistrationService().registerTrialUser(u, hostId);
                ServiceFactory.getRegistrationService().sendEmailVerification(registeredUser);
                r = new RegistrationSuccessfull();
            }
View Full Code Here


            upgradeLicenses(user, newLicense);
           
        return newLicense;
      } catch (DaoException e) {
        LOGGER.error("failed to add trial license due to a save error", e);
        throw new RegistrationException("cannot add  license to user", e);
      }
    }
View Full Code Here

            LOGGER.info("adding trial license to user " + u.getLogin());
      ServiceFactory.getLicenseService().addTrialLicense(u, hostId);
            LOGGER.info("trial registration complete for user " + u.getLogin());
    } catch (ServiceException e) {
            LOGGER.warn("error registring trial user", e);
      throw new RegistrationException(e.getFirstErrorMessage());
    }
        return u;
    }
View Full Code Here

            LOGGER.info("adding personal license to user " + u.getLogin());
            ServiceFactory.getLicenseService().addPersonalLicense(u);
            LOGGER.info("personal registration complete for user " + u.getLogin());
        } catch (ServiceException e) {
            LOGGER.warn("error registring personal user", e);
            throw new RegistrationException(e.getFirstErrorMessage());
        }
        return u;
    }
View Full Code Here

            LOGGER.info("adding community license to user " + u.getLogin());
            ServiceFactory.getLicenseService().addCommunityLicense(u, projectHome);
            LOGGER.info("community registration complete for user " + u.getLogin());
        } catch (ServiceException e) {
            LOGGER.warn("error registring community user", e);
            throw new RegistrationException(e.getFirstErrorMessage());
        }
        return u;
    }
View Full Code Here

            throw new LoginExistsException("login :"+ u.getLogin()+ " already exists");
        }
        if (DaoFactory.getUserDao().findUserByEmail(u.getEmail()) != null) {
            // a user already exists with the same email
            LOGGER.debug("cannot register user" + u.getLogin()  + " using email " + u.getEmail() + ", email in use");
            throw new RegistrationException("email :"+ u.getEmail()+ " already in use");
        }
        u.setMailVerified(false);
        ServiceFactory.getUserService().update(u);
        LOGGER.info("user " + u.getLogin() + " registered");
        return u;
View Full Code Here

        try {
            _uDao.save(userToSave);
            NotificationService.addUsers(new User[]{userToSave});
        } catch (DaoException e) {
            LOGGER.debug("cannot save user", e);
            throw new RegistrationException("save error while registring user", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.common.model.registration.RegistrationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.