Search in sources :

Example 41 with StorageDomain

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);
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) StorageDomainsAndStoragePoolIdQueryParameters(org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ArrayList(java.util.ArrayList)

Example 42 with StorageDomain

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);
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain)

Example 43 with StorageDomain

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;
}
Also used : DiskModel(org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) ArrayList(java.util.ArrayList) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Example 44 with StorageDomain

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);
    }
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain)

Example 45 with StorageDomain

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());
}
Also used : StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters)

Aggregations

StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)345 ArrayList (java.util.ArrayList)108 Guid (org.ovirt.engine.core.compat.Guid)103 Test (org.junit.Test)91 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)75 List (java.util.List)58 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)58 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)49 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)47 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)46 QueryType (org.ovirt.engine.core.common.queries.QueryType)43 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)42 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)41 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)41 ConfirmationModel (org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel)40 VDS (org.ovirt.engine.core.common.businessentities.VDS)39 Frontend (org.ovirt.engine.ui.frontend.Frontend)39 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)36 EntityModel (org.ovirt.engine.ui.uicommonweb.models.EntityModel)36 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)35