protected void setObjectName(ImportTemplateData templateData, String name) { templateData.getTemplate().setName(name); }
protected void setObjectName(ImportTemplateData templateData, String name) { templateData.getTemplate().setName(name); }
@Override public VmTemplate mapRow(ResultSet rs, int rowNum) throws SQLException { final VmTemplate entity = new VmTemplate(); map(rs, entity); entity.setId(getGuidDefaultEmpty(rs, "vmt_guid")); entity.setChildCount(rs.getInt("child_count")); entity.setName(rs.getString("name")); entity.setClusterId(getGuid(rs, "cluster_id")); entity.setStatus(VmTemplateStatus.forValue(rs.getInt("status"))); entity.setClusterName(rs.getString("cluster_name")); entity.setClusterCompatibilityVersion(new VersionRowMapper("cluster_compatibility_version").mapRow(rs, rowNum)); entity.setStoragePoolId(getGuid(rs, "storage_pool_id")); entity.setStoragePoolName(rs.getString("storage_pool_name")); entity.setQuotaName(rs.getString("quota_name")); entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type"))); entity.setDisabled(rs.getBoolean("is_disabled")); entity.setTrustedService(rs.getBoolean("trusted_service")); entity.setTemplateType(VmEntityType.valueOf(rs.getString("entity_type"))); entity.setClusterArch(ArchitectureType.forValue(rs.getInt("architecture"))); entity.setBaseTemplateId(getGuidDefaultEmpty(rs, "base_template_id")); entity.setTemplateVersionNumber(rs.getInt("template_version_number")); entity.setTemplateVersionName(rs.getString("template_version_name")); return entity; } }
t.setName(NAME); when(vmTemplateDao.get(Guid.Empty)).thenReturn(t); when(vmTemplateDao.get(GUID)).thenReturn(new VmTemplate());
@Override protected VmTemplate generateNewEntity() { VmTemplate newVmTemplate = new VmTemplate(); newVmTemplate.setId(Guid.newGuid()); newVmTemplate.setName("NewVmTemplate"); newVmTemplate.setClusterId(FixturesTool.CLUSTER); newVmTemplate.setClusterArch(ArchitectureType.x86_64); newVmTemplate.setCpuProfileId(FixturesTool.CPU_PROFILE_2); newVmTemplate.setSmallIconId(FixturesTool.SMALL_ICON_ID); newVmTemplate.setLargeIconId(FixturesTool.LARGE_ICON_ID); return newVmTemplate; }
static org.ovirt.engine.core.common.businessentities.VmTemplate setUpEntityExpectations( org.ovirt.engine.core.common.businessentities.VmTemplate entity, int index) { entity.setId(GUIDS[index]); entity.setClusterId(GUIDS[2]); entity.setName(NAMES[index]); entity.setDescription(DESCRIPTIONS[index]); entity.setCpuPerSocket(4); entity.setNumOfSockets(2); entity.setDefaultDisplayType(DisplayType.qxl); entity.setNumOfMonitors(2); entity.setVmType(VmType.Server); return entity; }
prm.getVmTemplate().setName(clonedTemplateData.getTemplate().getName());
.setName(((ImportTemplateData) cloneObjectMap.get(template.getId())).getTemplate().getName());
@Override public Response doImport(Action action) { validateParameters(action, "storageDomain.id|name"); Guid destStorageDomainId = getDestStorageDomainId(action); Guid clusterId = null; if (action.isSetCluster()) { clusterId = getClusterId(action); } ImportVmTemplateParameters params = new ImportVmTemplateParameters(parent.getDataCenterId(destStorageDomainId), parent.getStorageDomainId(), destStorageDomainId, clusterId, getEntity()); params.setImageToDestinationDomainMap(getDiskToDestinationMap(action)); params.setForceOverride(action.isSetExclusive() ? action.isExclusive() : false); if (action.isSetClone()){ params.setImportAsNewEntity(action.isClone()); if(action.isSetTemplate() && action.getTemplate().isSetName()) { params.getVmTemplate().setName(action.getTemplate().getName()); } } return doAction(ActionType.ImportVmTemplate, params, action); }
params.setImportAsNewEntity(action.isClone()); if (action.isSetVm() && action.getTemplate().isSetName()) { params.getVmTemplate().setName(action.getTemplate().getName());
obj.setMemSizeMb(instance.getMemSizeMb()); obj.setMaxMemorySizeMb(instance.getMaxMemorySizeMb()); obj.setName(instance.getName()); obj.setNiceLevel(instance.getNiceLevel()); obj.setNumOfMonitors(instance.getNumOfMonitors());