Package org.jayasoft.woj.portal.business.services

Examples of org.jayasoft.woj.portal.business.services.ServiceException


    }
    try {
      Long longId = Long.valueOf(userId);
      UserImpl userImpl = (UserImpl) DaoFactory.getUserDao().find(longId);
            if (userImpl==null) {
                throw new ServiceException("cannot confirm email, userid" + longId + " is unknown");
            }
      if(!userImpl.isMailVerified()) {
        userImpl.setMailVerified(true);
        update(userImpl);
        ServiceFactory.getRegistrationService().sendRegistrationConfirmationMail(userImpl);
View Full Code Here


    public InvitationInfo getInvitationInfo(String mail, String licenseId, String adminId) throws ServiceException {
        try {
            License l = (License)DaoFactory.getLicenseDao().find(new Long(licenseId));
            if (l==null) {
                throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.not.found", null));
            }
            if (l.getInvitedMail() == null || !l.getInvitedMail().equals(mail)) {
                throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.email.not.same", null));
            }
            if (l.getBuyer().getId() != new Long(adminId).longValue()) {
                throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.admin.different", null));
            }
        } catch (NumberFormatException e) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.id.invalid", null));
        } catch (DaoException e) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.db.error", null));
        }
       
        return new InvitationInfo(mail, licenseId, adminId);
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.business.services.ServiceException

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.