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

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


                            // Creating mode
                            LOGGER.debug("Creating user "+modifiedUser);
                            try {
                                modifiedUser = (UserImpl) ServiceFactory.getRegistrationService().register(modifiedUser);
                            } catch (RegistrationException e) {
                                throw new ServiceException("registration failed", e);
                            }
                            request.getSession().setAttribute(Params.REGISTER.SESSION.CURRENT_USER_ID, String.valueOf(modifiedUser.getId()));          
                        } else {
                            // Modifying mode
                            LOGGER.debug("Updating user "+modifiedUser);
View Full Code Here


            l.setHostId(hostId);
           
            addFreeLicense(u, l);
        } catch (DaoException e) {
            LOGGER.warn("failed to add trial license to user " + u.getLogin() + " from host " + hostId, e);
            throw new ServiceException("cannot add trial license to user");
        }
    }
View Full Code Here

        try {
            License l = licenseDao.createPersonal();
           
            addFreeLicense(u, l);
        } catch (DaoException e) {
            throw new ServiceException("failed to add personal license to user " + u.getLogin(), e);
        }
    }
View Full Code Here

            CommunityLicense l = licenseDao.createCommunity();
            l.setProjectHomeUrl(projectHome);
           
            addFreeLicense(u, l);
        } catch (DaoException e) {
            throw new ServiceException("failed to add community license to user " + u.getLogin(), e);
        }
    }
View Full Code Here

        if (licenseToAffect.getOwner() != null || licenseToAffect.getInvitedMail() != null) {
            return;
        }
       
        if (mail==null || !EmailHelper.doEmailSeemsValid(mail)) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.license.error.invite.no.mail", new Object[] {licenseToAffect.getProductCode(), TimeUtil.getDate(licenseToAffect.getValidUntil())}));
        }
       
    User userToAffect = ServiceFactory.getUserService().getUserByEmail(mail);
    String invitedFisrtName = "";
    String invitedLastName = "";   
View Full Code Here

//      licenseToAffect.setOwner(userToAffect);
      licenseToAffect.setInvitedMail(null);
      ServiceFactory.getUserService().update(userToAffect);
//      ServiceFactory.getLicenseService().update(licenseToAffect);
    } catch (DaoException e) {
      throw new ServiceException("Failed to get License for id : " + invitInfo.getLicenseId(), e);
    }
  } 
View Full Code Here

    public void saveLicense(License l) throws ServiceException {
        LicenseDao lDao = DaoFactory.getLicenseDao();
        try {
            lDao.save(l);
        } catch (DaoException e) {
            throw new ServiceException("license could not be saved", e);
        }
    }
View Full Code Here

                    LOGGER.debug("license " + lic+ " was free from user " + u);
                }
            }
            // No need to save licenses, the u.setLicenseUsed do it for us
        } catch (DaoException e) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.license.error.free.failed", null));
        }
    }
View Full Code Here

                   
                    LOGGER.info("swapping license used by user:" + u.getLogin() + " from " + licToFree.getId() + " to " + licToAffect.getId());
                    u.setLicenseUsed(licToAffect);
                    ServiceFactory.getUserService().update(u);
                } else {
                    throw new ServiceException(RessourceBundleApplicationMessage.warning("woj.page.admin.user.license.error.swap.failed.bad.owners", null));
                }
            } else {
                throw new ServiceException(RessourceBundleApplicationMessage.warning("woj.page.admin.user.license.error.swap.failed", null));
            }
        } catch (DaoException e) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.license.error.swap.failed", null));
        }
    }
View Full Code Here

                l.setInvitedMail(null);
                u.setLicenseUsed(l);
                ServiceFactory.getUserService().update(u);
            }
        } catch (DaoException e) {
            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.license.error.use", null));
        }
    }
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.