this.userCache = userCache;
}
public UserDetails loadUserByUsername(String username)
throws UsernameNotFoundException, DataAccessException {
Users users = null;
try {
users = this.usersDao.findByName(username);
} catch (Exception e) {
e.printStackTrace();
}
if (users == null) {
throw new UsernameNotFoundException(username);
}
Collection<GrantedAuthority> grantedAuthorities = null;
try {
grantedAuthorities = obtionGrantedAuthorities(users);
} catch (Exception e) {
e.printStackTrace();
}
boolean enables = true;
boolean accountNonExpried = true;
boolean credentialsNonExpried = true;
boolean accountNonLocked = true;
User userdetail = new User(users.getUser_account(), users.getUser_password(),
enables, accountNonExpried, credentialsNonExpried,
accountNonLocked, grantedAuthorities);
return userdetail;
}