Arik Hadas has uploaded a new change for review. Change subject: core: cleanup rename vmPoolName to name ......................................................................
core: cleanup rename vmPoolName to name Change-Id: Ieadda7ee1401989f7b047586b4492f528abc15e3 Signed-off-by: Arik Hadas <aha...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmPoolWithVmsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolToAdGroupBaseCommand.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmPoolDAODbFacadeImpl.java M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DbFacadeDAOTest.java M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmPoolDAOTest.java M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResourceTest.java M backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmPoolMapper.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Linq.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolGeneralModel.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/pools/PoolVmListModel.java M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/PoolItemBehavior.java M frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabPoolView.java 18 files changed, 31 insertions(+), 30 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/84/11984/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmPoolWithVmsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmPoolWithVmsCommand.java index 02671e0..b283b0e 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmPoolWithVmsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmPoolWithVmsCommand.java @@ -84,7 +84,7 @@ if (jobProperties == null) { jobProperties = new HashMap<String, String>(); VmPool vmPool = getParameters().getVmPool(); - String vmPoolName = vmPool != null ? vmPool.getVmPoolName() : StringUtils.EMPTY; + String vmPoolName = vmPool != null ? vmPool.getName() : StringUtils.EMPTY; jobProperties.put(VdcObjectType.VmPool.name().toLowerCase(), vmPoolName); Guid vmTemplateId = getVmTemplateId(); String templateName = getVmTemplateName(); diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java index 7cdac79..a5345d3 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java @@ -166,7 +166,7 @@ } catch (RuntimeException e) { log.errorFormat("Failed to create command context of adding VM {0} to Pool {1}", currentVmName, - getParameters().getVmPool().getVmPoolName(), + getParameters().getVmPool().getName(), e); } return commandCtx; @@ -189,7 +189,7 @@ return false; } - VmPool pool = getVmPoolDAO().getByName(getParameters().getVmPool().getVmPoolName()); + VmPool pool = getVmPoolDAO().getByName(getParameters().getVmPool().getName()); if (pool != null && (getActionType() == VdcActionType.AddVmPoolWithVms || !pool.getVmPoolId().equals( getParameters().getVmPoolId()))) { diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java index 85d8c92..491411f 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolCommandBase.java @@ -53,7 +53,7 @@ } public String getVmPoolName() { - return getVmPool() != null ? getVmPool().getVmPoolName() : null; + return getVmPool() != null ? getVmPool().getName() : null; } @Override diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolToAdGroupBaseCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolToAdGroupBaseCommand.java index cc9357e..e233379 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolToAdGroupBaseCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmPoolToAdGroupBaseCommand.java @@ -21,7 +21,7 @@ if (mVmPoolName == null && mVmPool == null) { mVmPool = DbFacade.getInstance().getVmPoolDao().get(getVmPoolId()); if (mVmPool != null) { - mVmPoolName = mVmPool.getVmPoolName(); + mVmPoolName = mVmPool.getName(); } } return mVmPoolName; diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java index 886db6a..34a9ab8 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommandTestAbstract.java @@ -328,7 +328,7 @@ */ private VmPool mockVmPools() { VmPool pool = new VmPool(); - pool.setVmPoolName("simplePoolName"); + pool.setName("simplePoolName"); pool.setVdsGroupId(vdsGroupId); pool.setVmPoolId(vmPoolId); return pool; diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java index c378424..dbd97b3 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmPool.java @@ -13,7 +13,7 @@ import org.ovirt.engine.core.compat.StringFormat; import org.ovirt.engine.core.compat.TimeSpan; -public class VmPool extends IVdcQueryable implements Serializable { +public class VmPool extends IVdcQueryable implements Serializable, Nameable { private static final long serialVersionUID = 4517650877696849024L; @@ -219,11 +219,12 @@ this.id = value; } - public String getVmPoolName() { + @Override + public String getName() { return this.name; } - public void setVmPoolName(String value) { + public void setName(String value) { this.name = value; } diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmPoolDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmPoolDAODbFacadeImpl.java index 75279de..e678ec8 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmPoolDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmPoolDAODbFacadeImpl.java @@ -80,7 +80,7 @@ MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("vm_pool_description", pool.getVmPoolDescription()) .addValue("vm_pool_id", pool.getVmPoolId()) - .addValue("vm_pool_name", pool.getVmPoolName()) + .addValue("vm_pool_name", pool.getName()) .addValue("vm_pool_type", pool.getVmPoolType()) .addValue("parameters", pool.getParameters()) .addValue("prestarted_vms", pool.getPrestartedVms()) @@ -94,7 +94,7 @@ MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("vm_pool_description", pool.getVmPoolDescription()) .addValue("vm_pool_id", pool.getVmPoolId()) - .addValue("vm_pool_name", pool.getVmPoolName()) + .addValue("vm_pool_name", pool.getName()) .addValue("vm_pool_type", pool.getVmPoolType()) .addValue("parameters", pool.getParameters()) .addValue("prestarted_vms", pool.getPrestartedVms()) @@ -183,7 +183,7 @@ .getString("vm_pool_description")); entity.setVmPoolId(Guid.createGuidFromString(rs .getString("vm_pool_id"))); - entity.setVmPoolName(rs.getString("vm_pool_name")); + entity.setName(rs.getString("vm_pool_name")); entity.setVmPoolType(VmPoolType.forValue(rs .getInt("vm_pool_type"))); entity.setParameters(rs.getString("parameters")); @@ -207,7 +207,7 @@ .getString("vm_pool_description")); entity.setVmPoolId(Guid.createGuidFromString(rs .getString("vm_pool_id"))); - entity.setVmPoolName(rs.getString("vm_pool_name")); + entity.setName(rs.getString("vm_pool_name")); entity.setVmPoolType(VmPoolType.forValue(rs .getInt("vm_pool_type"))); entity.setParameters(rs.getString("parameters")); diff --git a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DbFacadeDAOTest.java b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DbFacadeDAOTest.java index ec707408..ef70146 100644 --- a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DbFacadeDAOTest.java +++ b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DbFacadeDAOTest.java @@ -419,7 +419,7 @@ public void testGetEntityNameByIdAndTypeForVmPool() { VmPool vmPool = dbFacade.getVmPoolDao().get(VM_POOL_ID); assertNotNull(vmPool); - String name = vmPool.getVmPoolName(); + String name = vmPool.getName(); assertTrue(name.equals(dbFacade.getEntityNameByIdAndType(VM_POOL_ID, VdcObjectType.VmPool))); } diff --git a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmPoolDAOTest.java b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmPoolDAOTest.java index 9b2cdb1..2f0c11c 100644 --- a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmPoolDAOTest.java +++ b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmPoolDAOTest.java @@ -40,7 +40,7 @@ deletableVmPool = dao.get(DELETABLE_VM_POOL_ID); newVmPool = new VmPool(); - newVmPool.setVmPoolName("New VM Pool"); + newVmPool.setName("New VM Pool"); newVmPool.setVmPoolDescription("This is a new VM pool."); newVmPool.setVdsGroupId(VDS_GROUP_ID); @@ -125,7 +125,7 @@ */ @Test public void testGetByName() { - VmPool result = dao.getByName(existingVmPool.getVmPoolName()); + VmPool result = dao.getByName(existingVmPool.getName()); assertNotNull(result); assertEquals(existingVmPool, result); @@ -172,7 +172,7 @@ public void testSaveVmPool() { dao.save(newVmPool); - VmPool result = dao.getByName(newVmPool.getVmPoolName()); + VmPool result = dao.getByName(newVmPool.getName()); assertNotNull(result); assertEquals(newVmPool, result); diff --git a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResourceTest.java b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResourceTest.java index d7d61d0..18fd399 100644 --- a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResourceTest.java +++ b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendVmPoolResourceTest.java @@ -186,7 +186,7 @@ int index) { expect(entity.getVmPoolId()).andReturn(GUIDS[index]).anyTimes(); expect(entity.getVdsGroupId()).andReturn(GUIDS[2]).anyTimes(); - expect(entity.getVmPoolName()).andReturn(NAMES[index]).anyTimes(); + expect(entity.getName()).andReturn(NAMES[index]).anyTimes(); expect(entity.getVmPoolType()).andReturn(VmPoolType.Automatic).anyTimes(); expect(entity.getVmPoolDescription()).andReturn(DESCRIPTIONS[index]).anyTimes(); diff --git a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmPoolMapper.java b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmPoolMapper.java index bed00f2..43d19e1 100644 --- a/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmPoolMapper.java +++ b/backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/VmPoolMapper.java @@ -16,7 +16,7 @@ entity.setVmPoolId(new Guid(model.getId())); } if (model.isSetName()) { - entity.setVmPoolName(model.getName()); + entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setVmPoolDescription(model.getDescription()); @@ -57,7 +57,7 @@ public static VmPool map(org.ovirt.engine.core.common.businessentities.VmPool entity, VmPool template) { VmPool model = template != null ? template : new VmPool(); model.setId(entity.getVmPoolId().toString()); - model.setName(entity.getVmPoolName()); + model.setName(entity.getName()); model.setDescription(entity.getVmPoolDescription()); model.setSize(entity.getAssignedVmsCount()); model.setPrestartedVms(entity.getPrestartedVms()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java index 41ce2a6..29762c4 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Cloner.java @@ -313,7 +313,7 @@ obj.setVmPoolDescription(instance.getVmPoolDescription()); obj.setVmPoolId(instance.getVmPoolId()); - obj.setVmPoolName(instance.getVmPoolName()); + obj.setName(instance.getName()); obj.setVmPoolType(instance.getVmPoolType()); obj.setVdsGroupId(instance.getVdsGroupId()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Linq.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Linq.java index 59f6f6c..ef2f4c5 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Linq.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/Linq.java @@ -78,7 +78,7 @@ } if (obj instanceof VmPool) { - return ((VmPool) obj).getVmPoolName(); + return ((VmPool) obj).getName(); } throw new NotImplementedException(); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolGeneralModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolGeneralModel.java index 31cee59..0a4e3f3 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolGeneralModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolGeneralModel.java @@ -433,7 +433,7 @@ { VmPool pool = (VmPool) getEntity(); - setName(pool.getVmPoolName()); + setName(pool.getName()); setDescription(pool.getVmPoolDescription()); AsyncQuery _asyncQuery = new AsyncQuery(); 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 722cba3..ccd8485 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 @@ -322,7 +322,7 @@ model.setHashName("edit_pool"); //$NON-NLS-1$ model.setVmType(VmType.Desktop); model.Initialize(null); - model.getName().setEntity(pool.getVmPoolName()); + model.getName().setEntity(pool.getName()); model.getDescription().setEntity(pool.getVmPoolDescription()); model.getAssignedVms().setEntity(pool.getAssignedVmsCount()); model.getPrestartedVms().setEntity(pool.getPrestartedVms()); @@ -361,7 +361,7 @@ ArrayList<String> list = new ArrayList<String>(); for (VmPool item : Linq.<VmPool> Cast(getSelectedItems())) { - list.add(item.getVmPoolName()); + list.add(item.getName()); } model.setItems(list); @@ -438,7 +438,7 @@ Boolean isUnique = (Boolean) returnValue; if ((model.getIsNew() && !isUnique) - || (!model.getIsNew() && !isUnique && name.compareToIgnoreCase(pool.getVmPoolName()) != 0)) { + || (!model.getIsNew() && !isUnique && name.compareToIgnoreCase(pool.getName()) != 0)) { model.getName() .getInvalidityReasons() .add(ConstantsManager.getInstance().getConstants().nameMustBeUniqueInvalidReason()); @@ -448,7 +448,7 @@ } // Save changes. - pool.setVmPoolName((String) model.getName().getEntity()); + pool.setName((String) model.getName().getEntity()); pool.setVmPoolDescription((String) model.getDescription().getEntity()); pool.setVdsGroupId(((VDSGroup) model.getCluster().getSelectedItem()).getId()); pool.setPrestartedVms(model.getPrestartedVms().AsConvertible().Integer()); diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java index 0f9a6ea..90af56d 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/pools/PoolVmListModel.java @@ -68,7 +68,7 @@ { if (getEntity() != null) { - setSearchString("Vms: pool=" + getEntity().getVmPoolName()); //$NON-NLS-1$ + setSearchString("Vms: pool=" + getEntity().getName()); //$NON-NLS-1$ super.Search(); } } diff --git a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/PoolItemBehavior.java b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/PoolItemBehavior.java index d708f32..72b725f 100644 --- a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/PoolItemBehavior.java +++ b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/PoolItemBehavior.java @@ -106,7 +106,7 @@ { VmPool entity = (VmPool) getItem().getEntity(); - getItem().setName(entity.getVmPoolName()); + getItem().setName(entity.getName()); getItem().setDescription(entity.getVmPoolDescription()); getItem().setIsPool(true); getItem().setIsServer(false); diff --git a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabPoolView.java b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabPoolView.java index 6b58d54..2428bb4 100644 --- a/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabPoolView.java +++ b/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabPoolView.java @@ -36,7 +36,7 @@ TextColumnWithTooltip<VmPool> nameColumn = new TextColumnWithTooltip<VmPool>() { @Override public String getValue(VmPool object) { - return object.getVmPoolName(); + return object.getName(); } }; getTable().addColumn(nameColumn, constants.namePool(), "150px"); //$NON-NLS-1$ -- To view, visit http://gerrit.ovirt.org/11984 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieadda7ee1401989f7b047586b4492f528abc15e3 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches