use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class UserProfileDaoTest method testGetByUserId.
/**
* Ensures that retrieving an user profile by user id works as expected.
*/
@Test
public void testGetByUserId() {
UserProfile result = dao.getByUserId(existingProfile.getUserId());
assertNotNull(result);
assertEquals(existingProfile, result);
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class UserProfileDaoTest method testRemove.
/**
* Ensures that removing user profiles works as expected.
*/
@Test
public void testRemove() {
dao.remove(deletableProfile.getId());
UserProfile result = dao.get(deletableProfile.getId());
assertNull(result);
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class UpdateUserProfileCommand method executeCommand.
@Override
protected void executeCommand() {
UserProfile profile = getUserProfile();
executeCommandUpdateSSHPublicKey(profile);
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class UserProfilesOperationCommandBase method executeCommandUpdateSSHPublicKey.
protected void executeCommandUpdateSSHPublicKey(UserProfile existingProfile) {
UserProfile newProfile = getParameters().getUserProfile();
existingProfile.setSshPublicKey(newProfile.getSshPublicKey());
/* backend must make sure that the ID changes each time the key content changes */
existingProfile.setSshPublicKeyId(Guid.newGuid());
userProfileDao.update(existingProfile);
setSucceeded(true);
}
use of org.ovirt.engine.core.common.businessentities.UserProfile in project ovirt-engine by oVirt.
the class AddUserProfileCommand method setActionMessageParameters.
@Override
protected void setActionMessageParameters() {
UserProfile existingProfile = getUserProfile();
if (existingProfile != null && isSSHPublicKeyUpdate(existingProfile)) {
addValidationMessage(EngineMessage.VAR__ACTION__UPDATE);
} else {
addValidationMessage(EngineMessage.VAR__ACTION__ADD);
}
addValidationMessage(EngineMessage.VAR__TYPE__USER_PROFILE);
}
Aggregations