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

Examples of org.jayasoft.woj.portal.data.dao.product.LicenseDao


    /**
     * Free the given licenses from their owner
     * @param licIDs a list of license IDs as Long
     */
    public void freeLicenses(List licIDs) throws ServiceException {
        LicenseDao ldao = DaoFactory.getLicenseDao();
       
        try {
            List licenses = ldao.find(licIDs);
            for (Iterator it = licenses.iterator(); it.hasNext();) {
                License lic = (License)it.next();
                if (lic.getOwner()!=null) {
                    UserImpl u = (UserImpl)lic.getOwner();
                    u.setLicenseUsed(null);
View Full Code Here


            throw new ServiceException(RessourceBundleApplicationMessage.error("woj.page.admin.user.license.error.free.failed", null));
        }
    }

    public void swapLicenses(Long licID1, Long licID2) throws ServiceException {
        LicenseDao ldao = DaoFactory.getLicenseDao();
        try {
            License l1 = (License)ldao.find(licID1);
            License l2 = (License)ldao.find(licID2);
           
            if (l1!=null && l2!=null) {
                if (!(l1.getOwner()==null && l2.getOwner()==null) && !(l1.getOwner()!=null && l2.getOwner()!=null)) {
                    License licToAffect = (l1.getOwner()==null)?l1:l2;
                    License licToFree = (l1.getOwner()==null)?l2:l1;
View Full Code Here

       
    }

    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);
View Full Code Here

        }
    }

  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);
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.data.dao.product.LicenseDao

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.