Package org.focusns.common.exception

Examples of org.focusns.common.exception.ServiceException


        ProjectLink dbLink = linkDao.selectByFromAndToProjectId(link.getFromProjectId(), link.getToProjectId());
        if (dbLink == null) {
            linkDao.insert(link);
            fillProjectLink(link);
        } else {
            throw new ServiceException(ServiceExceptionCode.PROJECT_LINK_ALREADY_EXIST, "The project link already exist!");
        }
    }
View Full Code Here


    public void createProjectUser(ProjectUser projectUser) {
        //
        ProjectUser dbProjectUser = projectUserDao.selectByUsername(projectUser.getEmail());
        if(dbProjectUser!=null) {
            throw new ServiceException(ServiceExceptionCode.PROJECT_USER_ALREADY_EXIST, "用户已经存在!");
        }
        //
        //String md5Password = DigestUtils.md5DigestAsHex(projectUser.getPassword().getBytes());
        //
        String md5Password = DigestUtils.md5DigestAsHex(projectUser.getPassword().getBytes());
View Full Code Here

            //
            if(oldHashedPassword.equals(projectUser.getPassword())) {
                projectUser.setPassword(newHashedPassword);
                projectUserDao.update(projectUser);
            } else {
                throw new ServiceException(ServiceExceptionCode.PASSWORD_MISS_MATCH, "新老密码不匹配!");
            }
        } else {
            projectUserDao.update(projectUser);
        }
    }
View Full Code Here

            MimeMessage message = prepareMessage(mailConfig, context);
            //
            mailSender.send(message);
            //
        } catch (Exception e) {
            throw new ServiceException(ServiceExceptionCode.MAIL_SEND_EXCEPTION, "邮件发送异常...", e);
        }
    }
View Full Code Here

        Assert.hasText(categoryCode);
        String resourceLocation = String.format(RESOURCE_PATTERN, categoryCode);
        Resource resource = resourceLoader.getResource(resourceLocation);
        //
        if(resource.exists()==false) {
            throw new ServiceException(ServiceExceptionCode.PROJECT_CATEGORY_UNSUPPORTED,
                    String.format("Unsupported project category %s", categoryCode));
        }
        //
        return parse(resource);
    }
View Full Code Here

TOP

Related Classes of org.focusns.common.exception.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.