Package org.jayasoft.woj.portal.data.dao.security

Examples of org.jayasoft.woj.portal.data.dao.security.GroupDao


    }

    public License createTrialLicenseForGroup(User userLogged, Long groupId) throws ServiceException {
        UserDao userDao = DaoFactory.getUserDao();
        LicenseDao licenseDao = DaoFactory.getLicenseDao();
        GroupDao groupDao = DaoFactory.getGroupDao();
        LOGGER.info("adding trial to user " + userLogged.getLogin() + " registring for a group: " + groupId);

        try {
            ClufImpl cluf = ServiceFactory.getLicenseService().getActiveCluf();
            License l = licenseDao.createTrial();
           
            Group group = (Group) groupDao.find(groupId);
//            l.setHostId(hostId); No Host
            UserImpl user = (UserImpl)userDao.findUser(userLogged.getLogin());
            userDao.fetch(user);
            if ((user.getLastAcceptedCluf() == null) ||
                cluf.getVersion().equals(user.getLastAcceptedCluf().getVersion())) {
View Full Code Here


            throw new ServiceException("cannot add trial license to user");
        }
    }

  public boolean remove(User userLogged, Long grpId) throws ServiceException {
    GroupDao grpDao = DaoFactory.getGroupDao();
    LicenseDao licDao = DaoFactory.getLicenseDao();
    Group grp;
    try {
      List lics = licDao.findLicenseInGroup(grpId.longValue());
      for (Iterator iter = lics.iterator(); iter.hasNext();) {
        License lic = (License) iter.next();
        lic.setGroup(null);
      }
      grp = (Group) grpDao.find(grpId);
      grpDao.remove(grp);
            NotificationService.removeGroups(new Group[] {grp});
    } catch (DaoException e) {
            LOGGER.warn("failed to remove group for Id: " + grpId, e);
            throw new ServiceException("Cannot remove group");
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.data.dao.security.GroupDao

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.