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");
}