public InvitationInfo getInvitationInfo(String mail, String licenseId, String adminId) throws ServiceException {
try {
License l = (License)DaoFactory.getLicenseDao().find(new Long(licenseId));
if (l==null) {
throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.not.found", null));
}
if (l.getInvitedMail() == null || !l.getInvitedMail().equals(mail)) {
throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.email.not.same", null));
}
if (l.getBuyer().getId() != new Long(adminId).longValue()) {
throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.admin.different", null));
}
} catch (NumberFormatException e) {
throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.id.invalid", null));
} catch (DaoException e) {
throw new ServiceException(RessourceBundleApplicationMessage.error("woj.invite.user.error.license.db.error", null));
}
return new InvitationInfo(mail, licenseId, adminId);
}