if (username != null) {
// Only if it's an authenticated task should it try and do this
// injection
AccountDAO accountDAO =
ServiceLocator.instance().getInstance(AccountDAO.class);
ZanataJpaIdentityStore idStore =
ServiceLocator.instance().getInstance(
ZanataJpaIdentityStore.class);
AuthenticationEvents authEvts =
ServiceLocator.instance().getInstance(
AuthenticationEvents.class);
HAccount authenticatedAccount = accountDAO.getByUsername(username);
idStore.setAuthenticateUser(authenticatedAccount);
}
}