public void setVmtGuid(Guid value) { this.vmStatic.setVmtGuid(value); }
@Override public VmStatic mapRow(ResultSet rs, int rowNum) throws SQLException { final VmStatic entity = new VmStatic(); map(rs, entity); entity.setId(getGuidDefaultEmpty(rs, "vm_guid")); entity.setClusterId(getGuidDefaultEmpty(rs, "cluster_id")); entity.setName(rs.getString("vm_name")); entity.setVmtGuid(getGuidDefaultEmpty(rs, "vmt_guid")); entity.setInitialized(rs.getBoolean("is_initialized")); entity.setCpuPinning(rs.getString("cpu_pinning")); entity.setUseHostCpuFlags(rs.getBoolean("host_cpu_flags")); entity.setInstanceTypeId(Guid.createGuidFromString(rs.getString("instance_type_id"))); entity.setImageTypeId(Guid.createGuidFromString(rs.getString("image_type_id"))); entity.setOriginalTemplateName(rs.getString("original_template_name")); entity.setOriginalTemplateGuid(getGuid(rs, "original_template_id")); // if template_version_number is null it means use latest version entity.setUseLatestVersion(rs.getObject("template_version_number") == USE_LATEST_VERSION_NUMBER_INDICATOR); entity.setProviderId(getGuid(rs, "provider_id")); return entity; } }
@Override protected void readGeneralData(XmlNode content) { super.readGeneralData(content); consumeReadProperty(content, TEMPLATE_ID, val -> _vm.getStaticData().setVmtGuid(new Guid(val))); consumeReadProperty(content, TEMPLATE_NAME, val -> _vm.setVmtName(val)); consumeReadProperty(content, INSTANCE_TYPE_ID, val -> _vm.setInstanceTypeId(new Guid(val)));
@Override protected VmStatic generateNewEntity() { VmStatic newVmStatic = new VmStatic(); newVmStatic.setId(Guid.newGuid()); newVmStatic.setName("New Virtual Machine"); newVmStatic.setClusterId(FixturesTool.CLUSTER); newVmStatic.setVmtGuid(FixturesTool.VM_TEMPLATE_RHEL5); newVmStatic.setOrigin(OriginType.OVIRT); newVmStatic.setQuotaId(FixturesTool.QUOTA_GENERAL); newVmStatic.setCpuProfileId(FixturesTool.CPU_PROFILE_1); newVmStatic.setSmallIconId(FixturesTool.SMALL_ICON_ID); newVmStatic.setLargeIconId(FixturesTool.LARGE_ICON_ID); newVmStatic.setConsoleDisconnectAction(ConsoleDisconnectAction.REBOOT); return newVmStatic; }
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingVm = dao.get(FixturesTool.VM_RHEL5_POOL_57); existingVm.setStatus(VMStatus.Up); VM newVm = new VM(); newVm.setId(Guid.newGuid()); newVm.setClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI); newVm.setVmtGuid(FixturesTool.VM_TEMPLATE_RHEL5); VmStatic newVmStatic = new VmStatic(); newVmStatic.setName("New Virtual Machine"); newVmStatic.setClusterId(FixturesTool.CLUSTER_RHEL6_ISCSI); newVmStatic.setVmtGuid(FixturesTool.VM_TEMPLATE_RHEL5); }
@Mapping(from = VmPool.class, to = VmStatic.class) public static VmStatic map(VmPool model, VmStatic template) { VmStatic entity = template != null ? template : new VmStatic(); if (model.getVm() != null) { entity = VmMapper.map(model.getVm(), entity); } entity.setName(model.getName()); entity.setDescription(model.getDescription()); if (model.isSetTemplate() && model.getTemplate().isSetId()) { entity.setVmtGuid(GuidUtils.asGuid(model.getTemplate().getId())); } if (model.isSetCluster() && model.getCluster().isSetId()) { entity.setClusterId(GuidUtils.asGuid(model.getCluster().getId())); } if (model.isSetUseLatestTemplateVersion()) { entity.setUseLatestVersion(model.isUseLatestTemplateVersion()); } return entity; }
staticVm.setVmtGuid(GuidUtils.asGuid(vm.getTemplate().getId()));
staticVm.setVmtGuid(entity.getId()); staticVm.setClusterId(entity.getClusterId()); staticVm.setOsId(entity.getOsId());
obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setVmtGuid(instance.getVmtGuid()); obj.setUseLatestVersion(instance.isUseLatestVersion()); obj.setSerialNumberPolicy(instance.getSerialNumberPolicy());