use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class AddUserProfileCommand method executeCommand.
@Override
protected void executeCommand() {
UserProfile existingProfile = getUserProfile();
if (existingProfile != null) {
/*
* if validate() allowed us to get this far, then we must expect
* isSSHPublicKeyUpdate(existingProfile) == true
*/
executeCommandUpdateSSHPublicKey(existingProfile);
} else {
UserProfile profile = getParameters().getUserProfile();
profile.setId(Guid.newGuid());
profile.setUserId(getUserId());
/* must be overridden */
if (!StringUtils.isEmpty(profile.getSshPublicKey())) {
profile.setSshPublicKeyId(Guid.newGuid());
}
userProfileDao.save(profile);
setSucceeded(true);
}
}
Aggregations