class UserService {

	@Cacheable(value = "authorizationCache")
	public User findAccountprofileByAuthtoken(String token) {
		logger.debug("UserService.findAccountprofileByAuthtoken looking for authToken: "
				+ token);
		if (token == null) {
			// TODO: no point in checking database. throw exception here.
			logger.error("UserService.findAccountprofileByAuthtoken(): token is null");
			throw new AuthenticationException("Authorization Token is null");
		}
		User accountProfile = null;
		accountProfile = user.findByAuthtoken(token);
		if (accountProfile == null) {
			logger.error("UserService.findAccountprofileByAuthtoken(): accountProfile is null for token="
					+ token);
			throw new AuthenticationException("Authorization Token not found");
		}

		return accountProfile;
	}

}