Package net.stinfoservices.pacifiq.shared.exception

Examples of net.stinfoservices.pacifiq.shared.exception.CustomException


        }

        try {
            return (entityManager.find(SpecificTAA.class, id));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here


                t = result.get(0);
            }

            return (t);
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

    public List<SpecificTAA> findAll() throws Exception {
        try {
            return (Collections.unmodifiableList(entityManager.createQuery(
                    "SELECT o FROM " + IModel.DATABASE_PRE + "SpecificTAA o ORDER BY o.licenseNumber ASC").getResultList()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

            // only last versionNumber of licenseNumber, for Board.
            String having = "having (o.licenseNumber, o.versionNumber) in (t.licenseNumber, max(t.versionNumber) as versionNumber from SpecificTAA t group by t.licenseNumber)";
            return (Collections.unmodifiableList(entityManager.createQuery(
                    "SELECT o FROM " + IModel.DATABASE_PRE + "SpecificTAA o " + having + " ORDER BY o.licenseNumber ASC").getResultList()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

        try {
            return (Collections.unmodifiableList(entityManager
                    .createQuery("SELECT o FROM " + IModel.DATABASE_PRE + "SpecificTAA o ORDER BY o.licenseNumber ASC").setFirstResult(firstResult)
                    .setMaxResults(maxResults).getResultList()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

            LOGGER.info(MessageFormat.format(ResourceBundle.getBundle("system").getString("OBJECT_WLN_SAVED"), this.getClass().getSimpleName(),
                    t.getLicenseNumber() + "-" + t.getVersionNumber()));

            return (t);
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

            entityManager.remove(ntaa);
            LOGGER.info(MessageFormat.format(ResourceBundle.getBundle("system").getString("OBJECT_WLN_DELETED"), this.getClass().getSimpleName(),
                    ntaa.getLicenseNumber() + "-" + ntaa.getVersionNumber()));
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

                c = result.get(0);
            }

            return (c);
        } catch (Exception ex) {
            throw new CustomException(ex);
        }
    }
View Full Code Here

     */
    private UzerDTO internalLogin(boolean encrypted, final String email, final String pwd) throws Exception {
        Uzer user = uzerDAO.findByEmailWithRightsAndProfile(email);

        if (user == null || pwd == null) {
            throw new CustomException(getClass(), LocaleManager.getInstance(getSession()).getMessageResource(getClass())
                    .getString("EXCEPTION_USERNAME_INVALID"), null);
        } else {
            String password = pwd;

            if (!encrypted) {
                password = EncryptionUtils.encrypt(EncryptionUtils.encrypt(password, MessageDigestAlgorithm.MD5), MessageDigestAlgorithm.SHA_512);
            }
            if (user.getPassword().equals(password)) {
                // security context
                final Collection<GrantedAuthority> authorities = getAuthorities(user);
                final User springUser = new User(email, password, authorities);
                final Authentication auth = new UsernamePasswordAuthenticationToken(springUser, password, authorities);
                final SecurityContext sc = new SecurityContextImpl();

                sc.setAuthentication(auth);
                SecurityContextHolder.setContext(sc);

                // http request
                final UzerDTO uzerDTO = new UzerDTO(user, DTOPath.UZER_LOGIN);

                getSession().setAttribute("user", uzerDTO);

                return (uzerDTO);
            } else {
                throw new CustomException(getClass(), LocaleManager.getInstance(getSession()).getMessageResource(getClass())
                        .getString("EXCEPTION_PASSWORD_INVALID"), null);
            }
        }
    }
View Full Code Here

            if (programsId.contains(id)) {
                return;
            }
        }
        throw new CustomException(LocaleManager.getInstance(getSession()).getMessageResource(getClass())
                .getString("EXCEPTION_ACCESS_DENIED_BECAUSE_OF_RIGHTS_PROGRAM_EDITION"));
    }
View Full Code Here

TOP

Related Classes of net.stinfoservices.pacifiq.shared.exception.CustomException

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.