Package org.zeroexchange.model.user

Examples of org.zeroexchange.model.user.LocalCredential


     */
    @Override
    @Transactional(readOnly = true)
    public UserDetails loadUserByUsername(String username)
            throws UsernameNotFoundException, DataAccessException {
        LocalCredential credential = localCredentialDAO.findCredential(username);
        User user = credential == null ? null : credential.getUser();
        if(user == null) {
            throw new UsernameNotFoundException("Username by nickname '" + username + "' not found");
        }

        final Collection<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
View Full Code Here


   
    @Override
    public LocalCredential findCredential(String userName) {
        Criteria crit = getSession().createCriteria(LocalCredential.class);
        crit = crit.add(Restrictions.eq(LocalCredential.FIELD_NAME, userName));
        LocalCredential credential = (LocalCredential) crit.uniqueResult();
        return credential;
    }
View Full Code Here

                new IValidator<String>() {
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void validate(IValidatable<String> validatable) {
                        LocalCredential credentialKey = new LocalCredential();
                        credentialKey.setName(validatable.getValue());
                        if (credentialReader.credentialExists(credentialKey)) {
                            validatable.error(new ValidationError()
                                    .addMessageKey(MKEY_ALREADY_REGISTERED));
                        }
                    }
View Full Code Here

            throws BusinessLogicException {
        final User user = userFactory.createNewUser();
        user.setDisplayName(userData.getDisplayName());
        user.setEmail(userData.getEmail());
        user.setLocation(userData.getLocation());
        LocalCredential localCredential = new LocalCredential();
        localCredential.setName(((RegistrationData)userData).getName());
        localCredential.setPassword(userData.getPassword());
        User savedUser = userWriter.createUser(user);
        credentialWriter.addCredential(savedUser, localCredential);
    }
View Full Code Here

TOP

Related Classes of org.zeroexchange.model.user.LocalCredential

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.