public User updateUser(User user)
throws UserNotFoundException, NoSuchUserManagerException, InvalidConfigurationException
{
// first update the user
// this is the UserManager that owns the user
UserManager userManager = userManagerFacade.getUserManager(user.getSource());
if (!userManager.supportsWrite()) {
throw new InvalidConfigurationException("UserManager: " + userManager.getSource()
+ " does not support writing.");
}
final User oldUser = userManager.getUser(user.getUserId());
userManager.updateUser(user);
if (oldUser.getStatus() == UserStatus.active && user.getStatus() != oldUser.getStatus()) {
// clear the realm authc caches as user got disabled
eventBus.post(new UserPrincipalsExpired(user.getUserId(), user.getSource()));
}