public void setStorageName(String storageName) { getStorageStaticData().setStorageName(storageName); }
private void saveCommonStorageProperties(StorageModel model) { storageDomain.setStorageName(model.getName().getEntity()); saveDefaultedStorageProperties(model, storageDomain); }
protected org.ovirt.engine.core.common.businessentities.StorageDomainStatic getStorageDomainStatic(int idx) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic dom = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic(); dom.setId(GUIDS[idx]); dom.setStorageName(NAMES[idx]); return dom; }
protected org.ovirt.engine.core.common.businessentities.StorageDomainStatic getStorageDomainStatic(int idx) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic dom = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic(); dom.setId(GUIDS[idx]); dom.setStorageName(NAMES[idx]); return dom; }
@Override protected void updateExistingEntity() { existingEntity.setStorageName("UpdatedName"); existingEntity.setWipeAfterDelete(true); existingEntity.setWarningLowSpaceIndicator(4); existingEntity.setCriticalSpaceActionBlocker(8); existingEntity.setWarningLowConfirmedSpaceIndicator(5); existingEntity.setFirstMetadataDevice(FixturesTool.LUN_ID1); existingEntity.setVgMetadataDevice(FixturesTool.LUN_ID1); existingEntity.setBackup(true); }
private void saveSanStorage(final TaskContext context) { this.context = context; StorageModel model = (StorageModel) getWindow(); SanStorageModelBase sanModel = (SanStorageModelBase) model.getCurrentStorageItem(); storageDomain = new StorageDomainStatic(); storageDomain.setStorageType(sanModel.getType()); storageDomain.setStorageDomainType(sanModel.getRole()); storageDomain.setStorageFormat(sanModel.getContainer().getFormat().getSelectedItem()); storageDomain.setStorageName(model.getName().getEntity()); AsyncDataProvider.getInstance().getStorageDomainsByConnection(new AsyncQuery<>( storages -> { if (storages != null && storages.size() > 0) { String storageName = storages.get(0).getStorageName(); onFinish(context, false, storageModel, ConstantsManager.getInstance() .getMessages() .createOperationFailedDcGuideMsg(storageName)); } else { saveNewSanStorage(); } getWindow().stopProgress(); }), null, path); }
private void saveNfsStorage(final TaskContext context) { this.context = context; StorageModel model = (StorageModel) getWindow(); boolean isNew = model.getStorage() == null; storageModel = model.getCurrentStorageItem(); NfsStorageModel nfsModel = (NfsStorageModel) storageModel; path = nfsModel.getPath().getEntity(); storageDomain = new StorageDomainStatic(); storageDomain.setStorageType(isNew ? storageModel.getType() : storageDomain.getStorageType()); storageDomain.setStorageDomainType(isNew ? storageModel.getRole() : storageDomain.getStorageDomainType()); storageDomain.setStorageName(model.getName().getEntity()); storageDomain.setStorageFormat(model.getFormat().getSelectedItem()); AsyncDataProvider.getInstance().getStorageDomainsByConnection(new AsyncQuery<>( storages -> { if (storages != null && storages.size() > 0) { String storageName = storages.get(0).getStorageName(); onFinish(context, false, storageModel, ConstantsManager.getInstance() .getMessages() .createOperationFailedDcGuideMsg(storageName)); } else { saveNewNfsStorage(); } }), null, path); }
private void savePosixStorage(final TaskContext context) { this.context = context; StorageModel model = (StorageModel) getWindow(); boolean isNew = model.getStorage() == null; storageModel = model.getCurrentStorageItem(); PosixStorageModel posixModel = (PosixStorageModel) storageModel; path = posixModel.getPath().getEntity(); storageDomain = new StorageDomainStatic(); storageDomain.setStorageType(isNew ? storageModel.getType() : storageDomain.getStorageType()); storageDomain.setStorageDomainType(isNew ? storageModel.getRole() : storageDomain.getStorageDomainType()); storageDomain.setStorageName(model.getName().getEntity()); storageDomain.setStorageFormat(model.getFormat().getSelectedItem()); AsyncDataProvider.getInstance().getStorageDomainsByConnection(new AsyncQuery<>( storages -> { if (storages != null && storages.size() > 0) { String storageName = storages.get(0).getStorageName(); onFinish(context, false, storageModel, ConstantsManager.getInstance() .getMessages() .createOperationFailedDcGuideMsg(storageName)); } else { saveNewPosixStorage(); } }), null, path); }
private void saveLocalStorage(final TaskContext context) { this.context = context; StorageModel model = (StorageModel) getWindow(); VDS host = model.getHost().getSelectedItem(); boolean isNew = model.getStorage() == null; storageModel = model.getCurrentStorageItem(); LocalStorageModel localModel = (LocalStorageModel) storageModel; path = localModel.getPath().getEntity(); storageDomain = new StorageDomainStatic(); storageDomain.setStorageType(isNew ? storageModel.getType() : storageDomain.getStorageType()); storageDomain.setStorageDomainType(isNew ? storageModel.getRole() : storageDomain.getStorageDomainType()); storageDomain.setStorageName(model.getName().getEntity()); AsyncDataProvider.getInstance().getStorageDomainsByConnection(new AsyncQuery<>( storages -> { if (storages != null && storages.size() > 0) { String storageName = storages.get(0).getStorageName(); onFinish(context, false, storageModel, ConstantsManager.getInstance() .getMessages() .createOperationFailedDcGuideMsg(storageName)); } else { saveNewLocalStorage(); } }), host.getStoragePoolId(), path); }
@Override protected StorageDomainStatic generateNewEntity() { StorageDomainStatic newStaticDomain = new StorageDomainStatic(); newStaticDomain.setStorageName("NewStorageDomain"); newStaticDomain.setStorage("fDMzhE-wx3s-zo3q-Qcxd-T0li-yoYU-QvVePl"); newStaticDomain.setStorageFormat(StorageFormatType.V1); newStaticDomain.setWipeAfterDelete(true); newStaticDomain.setDiscardAfterDelete(false); newStaticDomain.setWarningLowSpaceIndicator(3); newStaticDomain.setCriticalSpaceActionBlocker(9); newStaticDomain.setWarningLowConfirmedSpaceIndicator(6); newStaticDomain.setFirstMetadataDevice(FixturesTool.LUN_ID2); newStaticDomain.setVgMetadataDevice(FixturesTool.LUN_ID2); newStaticDomain.setBackup(false); return newStaticDomain; }
private static StorageDomainStatic randomStorageDomainStatic() { RandomUtils random = RandomUtils.instance(); StorageDomainStatic sds = new StorageDomainStatic(); sds.setId(Guid.newGuid()); sds.setStorage(random.nextString(10)); sds.setStorageType(random.nextEnum(StorageType.class)); sds.setStorageName(random.nextString(10)); sds.setDescription(random.nextString(10)); sds.setWarningLowSpaceIndicator(5); sds.setCriticalSpaceActionBlocker(10); return sds; }
private void prepare5() { PreparingEnlistment enlistment = (PreparingEnlistment) context.enlistment; EnlistmentContext enlistmentContext = (EnlistmentContext) enlistment.getContext(); HostListModel<?> model = enlistmentContext.getModel(); ConfigureLocalStorageModel configureModel = (ConfigureLocalStorageModel) model.getWindow(); ActionReturnValue returnValue = context.addStorageServerConnectionReturnValue; if (returnValue == null || !returnValue.getSucceeded()) { // Don't rollback. context.enlistment = null; enlistment.done(); } else { StorageDomainStatic storage = new StorageDomainStatic(); storage.setStorageType(StorageType.LOCALFS); storage.setStorageDomainType(StorageDomainType.Data); storage.setStorageName(configureModel.getFormattedStorageName().getEntity()); storage.setStorage((String) returnValue.getActionReturnValue()); StorageDomainManagementParameter parameters = new StorageDomainManagementParameter(storage); parameters.setVdsId(context.host.getId()); parameters.setCorrelationId(getCorrelationId()); Frontend.getInstance().runAction(ActionType.AddLocalStorageDomain, parameters, result -> { ActionReturnValue returnValue1 = result.getReturnValue(); context.addLocalStorageDomainReturnValue = returnValue1; prepare6(); }); } }
private static StorageDomainStatic cloneStorageDomainStatic(StorageDomainStatic instance) { StorageDomainStatic obj = new StorageDomainStatic(); obj.setConnection(instance.getConnection()); obj.setId(instance.getId()); obj.setStorage(instance.getStorage()); obj.setStorageDomainType(instance.getStorageDomainType()); obj.setStorageType(instance.getStorageType()); obj.setStorageName(instance.getStorageName()); obj.setFirstMetadataDevice(instance.getFirstMetadataDevice()); obj.setVgMetadataDevice(instance.getVgMetadataDevice()); obj.setDescription(instance.getDescription()); obj.setComment(instance.getComment()); obj.setStorageFormat(instance.getStorageFormat()); obj.setWipeAfterDelete(instance.getWipeAfterDelete()); obj.setDiscardAfterDelete(instance.getDiscardAfterDelete()); obj.setWarningLowSpaceIndicator(instance.getWarningLowSpaceIndicator()); obj.setCriticalSpaceActionBlocker(instance.getCriticalSpaceActionBlocker()); obj.setWarningLowConfirmedSpaceIndicator(instance.getWarningLowConfirmedSpaceIndicator()); obj.setBackup(instance.isBackup()); return obj; }
entity.setStorageName(model.getName());