use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class BackendNetworksResourceTest method setUpStoragePool.
protected StoragePool setUpStoragePool(Guid id) {
StoragePool pool = mock(StoragePool.class);
when(pool.getId()).thenReturn(id);
return pool;
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class VdsBrokerObjectsBuilder method buildStoragePool.
public static StoragePool buildStoragePool(Map<String, Object> struct) {
StoragePool sPool = new StoragePool();
if (struct.containsKey("type")) {
sPool.setIsLocal(StorageType.valueOf(struct.get("type").toString()).isLocal());
}
sPool.setName(assignStringValue(struct, "name"));
Integer masterVersion = assignIntValue(struct, "master_ver");
if (masterVersion != null) {
sPool.setMasterDomainVersion(masterVersion);
}
return sPool;
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class Cloner method cloneStoragePool.
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;
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class BaseImportNetworksModel method onProviderChosen.
private void onProviderChosen() {
final Provider<?> provider = providers.getSelectedItem();
if (provider == null) {
return;
}
startProgress();
AsyncQuery<List<StoragePool>> dataCenterQuery = new AsyncQuery<>(returnValue -> {
final List<StoragePool> dataCenters = new LinkedList<>(returnValue);
Collections.sort(dataCenters, new NameableComparator());
AsyncQuery<QueryReturnValue> externalNetworksQuery = new AsyncQuery<>(queryReturnValue -> {
if (queryReturnValue.getSucceeded()) {
Map<Network, Set<Guid>> externalNetworkToDataCenters = queryReturnValue.getReturnValue();
providerNetworks.setItems(getExternalNetworks(externalNetworkToDataCenters, dataCenters));
importedNetworks.setItems(new LinkedList<ExternalNetwork>());
} else {
final ErrorPopupManager popupManager = (ErrorPopupManager) TypeResolver.getInstance().resolve(ErrorPopupManager.class);
popupManager.show(ConstantsManager.getInstance().getMessages().failedToListExternalNetworks(queryReturnValue.getExceptionMessage()));
}
stopProgress();
}, true);
AsyncDataProvider.getInstance().getExternalNetworksByProviderId(externalNetworksQuery, provider.getId());
});
AsyncDataProvider.getInstance().getDataCenterList(dataCenterQuery);
}
use of org.ovirt.engine.core.common.businessentities.StoragePool in project ovirt-engine by oVirt.
the class BaseImportNetworksModel method getExternalNetwork.
private ExternalNetwork getExternalNetwork(Network network, Set<Guid> attachedDataCenters, List<StoragePool> dataCenters) {
ExternalNetwork externalNetwork = new ExternalNetwork();
externalNetwork.setNetwork(network);
externalNetwork.setDisplayName(network.getName());
externalNetwork.setPublicUse(true);
List<StoragePool> availableDataCenters = getAvailableDataCenters(dataCenters, attachedDataCenters);
externalNetwork.getDataCenters().setItems(availableDataCenters);
externalNetwork.getDataCenters().setSelectedItem(dataCenterListModel.getSelectedItem() != null && availableDataCenters.contains(dataCenterListModel.getSelectedItem()) ? dataCenterListModel.getSelectedItem() : Linq.firstOrNull(availableDataCenters));
return externalNetwork;
}
Aggregations