static StoragePool setUpEntityExpectations(StoragePool entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getdescription()).thenReturn(DESCRIPTIONS[index]); when(entity.isLocal()).thenReturn(false); return entity; }
model.setLocal(entity.isLocal()); if (!StringUtils.isEmpty(entity.getdescription())) { model.setDescription(entity.getdescription());
@Override public void updatePartial(StoragePool pool) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", pool.getdescription()) .addValue("free_text_comment", pool.getComment()) .addValue("id", pool.getId()) .addValue("name", pool.getName()) .addValue("is_local", pool.isLocal()) .addValue("storage_pool_format_type", pool.getStoragePoolFormatType()) .addValue("compatibility_version", pool.getCompatibilityVersion()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType().getValue()); getCallsHandler().executeModification("Updatestorage_pool_partial", parameterSource); }
public void edit() { StoragePool dataCenter = getSelectedItem(); final UIConstants constants = ConstantsManager.getInstance().getConstants(); if (getWindow() != null) { return; } final DataCenterModel model = new DataCenterModel(); setWindow(model); model.setEntity(dataCenter); model.setDataCenterId(dataCenter.getId()); model.setTitle(constants.editDataCenterTitle()); model.setHelpTag(HelpTag.edit_data_center); model.setHashName("edit_data_center"); //$NON-NLS-1$ model.getName().setEntity(dataCenter.getName()); model.getDescription().setEntity(dataCenter.getdescription()); model.getComment().setEntity(dataCenter.getComment()); model.setOriginalName(dataCenter.getName()); model.getStoragePoolType().setSelectedItem(dataCenter.isLocal()); model.getQuotaEnforceTypeListModel().setSelectedItem(dataCenter.getQuotaEnforcementType()); UICommand tempVar = UICommand.createDefaultOkUiCommand("OnSave", this); //$NON-NLS-1$ model.getCommands().add(tempVar); UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", this); //$NON-NLS-1$ model.getCommands().add(tempVar2); }
@Override public void save(StoragePool pool) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", pool.getdescription()) .addValue("free_text_comment", pool.getComment()) .addValue("id", pool.getId()) .addValue("name", pool.getName()) .addValue("is_local", pool.isLocal()) .addValue("status", pool.getStatus()) .addValue("master_domain_version", pool.getMasterDomainVersion()) .addValue("spm_vds_id", pool.getSpmVdsId()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType()) .addValue("compatibility_version", pool.getCompatibilityVersion()); getCallsHandler().executeModification("Insertstorage_pool", parameterSource); }
private static StoragePool cloneStoragePool(StoragePool instance) { StoragePool obj = new StoragePool(); obj.setdescription(instance.getdescription()); obj.setComment(instance.getComment()); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setIsLocal(instance.isLocal()); obj.setStatus(instance.getStatus()); obj.setMasterDomainVersion(instance.getMasterDomainVersion()); obj.setLVER(instance.getLVER()); obj.setRecoveryMode(instance.getRecoveryMode()); obj.setSpmVdsId(instance.getSpmVdsId()); obj.setStoragePoolCompatibilityLevelUpgradeNeeded(instance.isStoragePoolCompatibilityLevelUpgradeNeeded()); obj.setCompatibilityVersion(instance.getCompatibilityVersion()); return obj; }
@Override public void update(StoragePool pool) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("description", pool.getdescription()) .addValue("free_text_comment", pool.getComment()) .addValue("id", pool.getId()) .addValue("name", pool.getName()) .addValue("status", pool.getStatus()) .addValue("is_local", pool.isLocal()) .addValue("storage_pool_format_type", pool.getStoragePoolFormatType()) .addValue("master_domain_version", pool.getMasterDomainVersion()) .addValue("spm_vds_id", pool.getSpmVdsId()) .addValue("compatibility_version", pool.getCompatibilityVersion()) .addValue("quota_enforcement_type", pool.getQuotaEnforcementType().getValue()); getCallsHandler().executeModification("Updatestorage_pool", parameterSource); }
getDataCenter().getDescription().setEntity(candidate.getdescription());