static StorageServerConnections setUpEntityExpectations(StorageServerConnections entity, int index) { when(entity.getId()).thenReturn(GUIDS[index].toString()); when(entity.getStorageType()).thenReturn(STORAGE_TYPES_MAPPED[index]); if (STORAGE_TYPES_MAPPED[index].equals(StorageType.ISCSI)) { when(entity.getPort()).thenReturn("3260"); when(entity.getConnection()).thenReturn("1.122.10.125"); } if (STORAGE_TYPES_MAPPED[index].equals(StorageType.NFS)) { when(entity.getConnection()).thenReturn("1.122.10.125:/data1"); } return entity; }
static StorageServerConnections setUpEntityExpectations(StorageServerConnections entity, int index) { when(entity.getId()).thenReturn(GUIDS[index].toString()); when(entity.getStorageType()).thenReturn(STORAGE_TYPES_MAPPED[index]); when(entity.getConnection()).thenReturn("1.1.1.255"); if (STORAGE_TYPES_MAPPED[index].equals(StorageType.ISCSI)) { when(entity.getPort()).thenReturn("3260"); } return entity; } }
static StorageServerConnections setUpEntityExpectations(StorageServerConnections entity, int index) { when(entity.getId()).thenReturn(GUIDS[index].toString()); when(entity.getStorageType()).thenReturn(STORAGE_TYPES_MAPPED[index]); when(entity.getConnection()).thenReturn("/data1"); if (STORAGE_TYPES_MAPPED[index].equals(StorageType.ISCSI)) { when(entity.getPort()).thenReturn("3260"); } return entity; }
private void updatePosixProperties(IStorageModel storageModel) { PosixStorageModel posixModel = (PosixStorageModel) storageModel; connection.setVfsType(posixModel.getVfsType().getEntity().toString()); if (posixModel.getMountOptions().getEntity() != null) { connection.setMountOptions(posixModel.getMountOptions().getEntity().toString()); } if (posixModel.getType().equals(StorageType.GLUSTERFS)) { //TBD: set gluster vol id only if managed glustervol selected connection.setGlusterVolumeId(null); } }
setPath(entity, model); if (entity.getStorageType().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.NFS)) { if (entity.getNfsVersion() != null) { model.setNfsVersion(map(entity.getNfsVersion(), null)); model.setMountOptions(entity.getMountOptions()); } else if (entity.getStorageType().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.POSIXFS) || entity.getStorageType().equals(org.ovirt.engine.core.common.businessentities.storage.StorageType.GLUSTERFS)) { model.setMountOptions(entity.getMountOptions()); model.setVfsType(entity.getVfsType());
if (getCurrentStorageItem().getRole().isDataDomain() && !getCurrentStorageItem().getType().equals(StorageType.MANAGED_BLOCK_STORAGE)) { formats.add(dataCenter.getStoragePoolFormatType()); selectItem = dataCenter.getStoragePoolFormatType();
private void updateShareableDiskEnabled() { StorageDomain storageDomain = getStorageDomain().getSelectedItem(); if (storageDomain != null && (StorageType.GLUSTERFS == storageDomain.getStorageType() || storageDomain.getStorageType().equals(StorageType.MANAGED_BLOCK_STORAGE))) { getIsShareable().setEntity(false); getIsShareable().setIsChangeable(false, constants.shareableDiskNotSupported()); } else if (getVolumeType().getSelectedItem() == VolumeType.Sparse && storageDomain != null && storageDomain.getStorageType().isBlockDomain()) { getIsShareable().setEntity(false); getIsShareable().setIsChangeable(false, constants.shareableDiskNotSupportedByConfiguration()); } else { getIsShareable().setIsChangeable(isEditEnabled(), constants.shareableDiskNotSupportedOnRunningVM()); } }
private void updatePath() { StorageModel model = (StorageModel) getWindow(); VDS host = model.getHost().getSelectedItem(); Guid hostId = Guid.Empty; if (host != null) { hostId = host.getId(); } IStorageModel storageModel = model.getCurrentStorageItem(); connection = new StorageServerConnections(); connection.setId(storageDomain.getStorage()); connection.setConnection(path); connection.setStorageType(storageModel.getType()); if (storageModel.getType().equals(StorageType.NFS)) { updateNFSProperties(storageModel); } else if (storageModel instanceof PosixStorageModel) { updatePosixProperties(storageModel); } StorageServerConnectionParametersBase parameters = new StorageServerConnectionParametersBase(connection, hostId, false); Frontend.getInstance().runAction(ActionType.UpdateStorageServerConnection, parameters, result -> { StorageListModel storageListModel = (StorageListModel) result.getState(); storageListModel.onFinish(storageListModel.context, true, storageListModel.storageModel); }, this); }