class UserOrgServiceImpl implements UserOrgService {

    @Override
    @Transactional
    public ProfileDTO saveUserOrgInfo(ProfileDTO profile, Authentication authentication)
    {
        String userId = authentication.getName();
        UserOrg userOrg = getUserOrgForUserId(userId);
        boolean userOrgCreated = false;
        if (userOrg == null)
        {
            log.debug("Creating userOrg for [{}]", userId);
            userOrg = createUserOrgForUser(userId);
            userOrgCreated = true;
        }
        log.info("Updating userOrg for [{}]", userId);
        userOrg = updateUserOrg(profile, userOrg);
        boolean userOrgTransactionSuccess = true;
        try
        {
            userOrg = saveUserOrgTransaction(userOrg, authentication);
        }
        catch (MuleException e)
        {
            log.error("UserOrg for user [{}] was not saved. {}", userId, e);
            userOrgTransactionSuccess = false;
        }
        getEventPublisher().publishProfileEvent(userOrg, authentication, userOrgCreated, userOrgTransactionSuccess);
        return profile;
    }

}