Gilad Chaplik has uploaded a new change for review. Change subject: core: removing destVds public setter (9/15) ......................................................................
core: removing destVds public setter (9/15) This member is initialized in the constructor; Also changed its type from NGuid to Guid (NGuid should be deprecated). Change-Id: I0cd497bc1bf1a8b44f6fe0c3de8765a11316c583 Signed-off-by: Gilad Chaplik <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java M backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java 11 files changed, 26 insertions(+), 28 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/11/13211/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java index 723b51d..ffe64e0 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java @@ -10,8 +10,14 @@ public class MigrateVmToServerCommand<T extends MigrateVmToServerParameters> extends MigrateVmCommand<T> { public MigrateVmToServerCommand(T parameters) { super(parameters); - setVdsDestinationId(parameters.getVdsId()); - getVdsSelector().setDestinationVdsId(getVdsDestinationId()); + } + + @Override + protected Guid getVdsDestinationId() { + if (super.getVdsDestinationId() == null) { + setVdsDestinationId(getParameters().getVdsId()); + } + return super.getVdsDestinationId(); } @Override diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java index 02aac34..61022e9 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java @@ -52,7 +52,6 @@ import org.ovirt.engine.core.common.vdscommands.VDSReturnValue; import org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.core.compat.NGuid; import org.ovirt.engine.core.compat.Version; import org.ovirt.engine.core.dal.VdcBllMessages; import org.ovirt.engine.core.dao.DiskDao; @@ -368,7 +367,7 @@ vm.setStatus(VMStatus.Up); vm.setStoragePoolId(Guid.NewGuid()); - doReturn(new VdsSelector(vm, new NGuid(), new VdsFreeMemoryChecker(command))).when(command) + doReturn(new VdsSelector(vm, new Guid(), new VdsFreeMemoryChecker(command))).when(command) .getVdsSelector(); assertFalse(command.canDoAction()); diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java index e769c5b..8ef1932 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VM.java @@ -260,11 +260,11 @@ vmStatic.setAutoStartup(value); } - public NGuid getDedicatedVmForVds() { + public Guid getDedicatedVmForVds() { return vmStatic.getDedicatedVmForVds(); } - public void setDedicatedVmForVds(NGuid value) { + public void setDedicatedVmForVds(Guid value) { vmStatic.setDedicatedVmForVds(value); } diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java index 265b5b2..d224d65 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmBase.java @@ -21,7 +21,6 @@ import org.ovirt.engine.core.common.validation.group.DesktopVM; import org.ovirt.engine.core.common.validation.group.UpdateEntity; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.core.compat.NGuid; public class VmBase extends IVdcQueryable implements BusinessEntity<Guid>, Nameable { private static final long serialVersionUID = 1078548170257965614L; @@ -182,7 +181,7 @@ private MigrationSupport migrationSupport = MigrationSupport.MIGRATABLE; @EditableField - private NGuid dedicatedVmForVds; + private Guid dedicatedVmForVds; @EditableOnVmStatusField protected DisplayType defaultDisplayType = DisplayType.qxl; @@ -678,11 +677,11 @@ this.migrationSupport = migrationSupport; } - public NGuid getDedicatedVmForVds() { + public Guid getDedicatedVmForVds() { return dedicatedVmForVds; } - public void setDedicatedVmForVds(NGuid value) { + public void setDedicatedVmForVds(Guid value) { dedicatedVmForVds = value; } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java index ba29bcc..31c0015 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java @@ -342,7 +342,7 @@ entity.setStateless(rs.getBoolean("is_stateless")); entity.setSmartcardEnabled(rs.getBoolean("is_smartcard_enabled")); entity.setDeleteProtected(rs.getBoolean("is_delete_protected")); - entity.setDedicatedVmForVds(NGuid.createGuidFromString(rs.getString("dedicated_vm_for_vds"))); + entity.setDedicatedVmForVds(Guid.createGuidFromString(rs.getString("dedicated_vm_for_vds"))); entity.setFailBack(rs.getBoolean("fail_back")); entity.setLastVdsRunOn(NGuid.createGuidFromString(rs.getString("last_vds_run_on"))); entity.setClientIp(rs.getString("client_ip")); diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java index de3c511..e4abd7f 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmStaticDAODbFacadeImpl.java @@ -9,7 +9,6 @@ import org.ovirt.engine.core.common.businessentities.MigrationSupport; import org.ovirt.engine.core.common.businessentities.VmStatic; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.core.compat.NGuid; import org.ovirt.engine.core.dal.dbbroker.AbstractVmRowMapper; import org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; @@ -188,7 +187,7 @@ entity.setDomain(rs.getString("domain")); entity.setNumOfMonitors(rs.getInt("num_of_monitors")); entity.setInitialized(rs.getBoolean("is_initialized")); - entity.setDedicatedVmForVds(NGuid.createGuidFromString(rs.getString("dedicated_vm_for_vds"))); + entity.setDedicatedVmForVds(Guid.createGuidFromString(rs.getString("dedicated_vm_for_vds"))); entity.setDefaultDisplayType(DisplayType.forValue(rs.getInt("default_display_type"))); entity.setMigrationSupport(MigrationSupport.forValue(rs.getInt("migration_support"))); String predefinedProperties = rs.getString("predefined_properties"); diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java index 7be0ba6..4645fc0 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java @@ -230,7 +230,7 @@ entity.setQuotaName(rs.getString("quota_name")); entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type"))); entity.setMigrationSupport(MigrationSupport.forValue(rs.getInt("migration_support"))); - entity.setDedicatedVmForVds(NGuid.createGuidFromString(rs.getString("dedicated_vm_for_vds"))); + entity.setDedicatedVmForVds(Guid.createGuidFromString(rs.getString("dedicated_vm_for_vds"))); entity.setDisabled(rs.getBoolean("is_disabled")); entity.setTunnelMigration((Boolean) rs.getObject("tunnel_migration")); entity.setVncKeyboardLayout(rs.getString("vnc_keyboard_layout")); diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java index 859609e..80d17a4 100644 --- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java +++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmMapper.java @@ -1,6 +1,6 @@ package org.ovirt.engine.api.restapi.types; -import static org.ovirt.engine.core.compat.NGuid.createGuidFromString; +import static org.ovirt.engine.core.compat.Guid.createGuidFromString; import java.util.ArrayList; import java.util.LinkedHashSet; diff --git a/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java b/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java index 57dd23e..92b76dc 100644 --- a/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java +++ b/backend/manager/modules/sla/src/main/java/org/ovirt/engine/core/sla/VdsSelector.java @@ -20,7 +20,6 @@ import org.ovirt.engine.core.common.config.Config; import org.ovirt.engine.core.common.config.ConfigValues; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.core.compat.NGuid; import org.ovirt.engine.core.compat.RpmVersion; import org.ovirt.engine.core.dal.VdcBllMessages; import org.ovirt.engine.core.dal.dbbroker.DbFacade; @@ -35,14 +34,10 @@ return privateRunVdssList; } - private NGuid privateDestinationVdsId; + private Guid destinationVdsId; - public NGuid getDestinationVdsId() { - return privateDestinationVdsId; - } - - public void setDestinationVdsId(NGuid value) { - privateDestinationVdsId = value; + private Guid getDestinationVdsId() { + return destinationVdsId; } private VM privateVm; @@ -56,9 +51,9 @@ privateVm = value; } - public VdsSelector(VM vm, NGuid destinationVdsId, VdsFreeMemoryChecker memoryChecker) { + public VdsSelector(VM vm, Guid destinationVdsId, VdsFreeMemoryChecker memoryChecker) { setVm(vm); - setDestinationVdsId(destinationVdsId); + this.destinationVdsId = destinationVdsId; this.memoryChecker = memoryChecker; } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java index c348672..d8993d0 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolListModel.java @@ -31,7 +31,6 @@ import org.ovirt.engine.core.common.queries.VdcQueryReturnValue; import org.ovirt.engine.core.common.queries.VdcQueryType; import org.ovirt.engine.core.compat.Guid; -import org.ovirt.engine.core.compat.NGuid; import org.ovirt.engine.core.compat.StringHelper; import org.ovirt.engine.core.compat.Version; import org.ovirt.engine.core.searchbackend.SearchObjects; @@ -74,6 +73,7 @@ private UICommand privateEditCommand; + @Override public UICommand getEditCommand() { return privateEditCommand; @@ -456,7 +456,7 @@ EntityModel poolTypeSelectedItem = (EntityModel) model.getPoolType().getSelectedItem(); pool.setVmPoolType((VmPoolType) poolTypeSelectedItem.getEntity()); - NGuid default_host; + Guid default_host; VDS defaultHost = (VDS) model.getDefaultHost().getSelectedItem(); if ((Boolean) model.getIsAutoAssign().getEntity()) { diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java index 0cf56da..5653345 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java @@ -1612,7 +1612,7 @@ { VDS a = (VDS) item; if (a.getId().equals(((vm.getDedicatedVmForVds() != null) ? vm.getDedicatedVmForVds() - : NGuid.Empty))) + : Guid.Empty))) { host = a; break; -- To view, visit http://gerrit.ovirt.org/13211 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cd497bc1bf1a8b44f6fe0c3de8765a11316c583 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
