use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class AsyncDataProvider method getIsoDomainByDataCenterId.
public void getIsoDomainByDataCenterId(AsyncQuery<StorageDomain> aQuery, Guid dataCenterId) {
aQuery.converterCallback = source -> {
if (source != null) {
ArrayList<StorageDomain> storageDomains = (ArrayList<StorageDomain>) source;
for (StorageDomain domain : storageDomains) {
if (domain.getStorageDomainType() == StorageDomainType.ISO) {
return domain;
}
}
}
return null;
};
IdQueryParameters getIsoParams = new IdQueryParameters(dataCenterId);
Frontend.getInstance().runQuery(QueryType.GetStorageDomainsByStoragePoolId, getIsoParams, aQuery);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class CommonUnitToVmBaseBuilder method postBuild.
@Override
protected void postBuild(UnitVmModel model, VmBase vm) {
vm.setAutoStartup(model.getIsHighlyAvailable().getEntity());
vm.setComment(model.getComment().getEntity());
vm.setDescription(model.getDescription().getEntity());
vm.setPriority(model.getPriority().getSelectedItem().getEntity());
vm.setRunAndPause(model.getIsRunAndPause().getEntity());
vm.setStateless(model.getIsStateless().getEntity());
StorageDomain leaseSd = model.getLease().getSelectedItem();
vm.setLeaseStorageDomainId(leaseSd != null ? leaseSd.getId() : null);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class StorageDomainModel method getDisksModels.
public ArrayList<DiskModel> getDisksModels() {
ArrayList<DiskModel> diskModels = new ArrayList<>();
for (DiskImage diskImage : getDisks()) {
DiskModel diskModel = new DiskModel();
diskModel.setDisk(diskImage);
ListModel<StorageDomain> storageDomain = new ListModel<>();
storageDomain.setSelectedItem(getStorageDomain());
diskModel.setStorageDomain(storageDomain);
diskModels.add(diskModel);
}
return diskModels;
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class StorageIsoListModel method updateActionAvailability.
private void updateActionAvailability() {
StorageDomain storageDomain = getEntity();
if (storageDomain != null && storageDomain.getStorageType() == StorageType.GLANCE) {
getImportImagesCommand().setIsAvailable(true);
getImportImagesCommand().setIsExecutionAllowed(getSelectedItems() != null && getSelectedItems().size() > 0);
} else {
getImportImagesCommand().setIsAvailable(false);
}
}
use of org.ovirt.engine.core.common.businessentities.StorageDomain in project ovirt-engine by oVirt.
the class StorageLeaseListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
setItems(null);
return;
}
super.syncSearch();
StorageDomain storageDomain = getEntity();
Frontend.getInstance().runQuery(QueryType.GetEntitiesWithLeaseByStorageId, new IdQueryParameters(storageDomain.getId()), new SetItemsAsyncQuery());
}
Aggregations