* @param username User's username
* @throws org.ofbiz.common.authentication.api.AuthenticatorException
* user synchronization fails
*/
public void syncUser(String username) throws AuthenticatorException {
UserWrapper user;
try {
user = callGetUser(username);
} catch (RemoteException e) {
throw new AuthenticatorException(e.getMessage(), e);
}
GenericValue system;
try {
system = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", "system"), true);
} catch (GenericEntityException e) {
throw new AuthenticatorException(e.getMessage(), e);
}
GenericValue userLogin;
try {
userLogin = delegator.findOne("UserLogin", UtilMisc.toMap("userLoginId", user.getName()), false);
} catch (GenericEntityException e) {
throw new AuthenticatorException(e.getMessage(), e);
}
// suspend the current transaction and load the user