Search in sources :

Example 56 with IdQueryParameters

use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getNextAvailableDiskAliasNameByVMId.

public void getNextAvailableDiskAliasNameByVMId(AsyncQuery<String> aQuery, Guid vmId) {
    aQuery.converterCallback = new CastingConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetNextAvailableDiskAliasNameByVMId, new IdQueryParameters(vmId), aQuery);
}
Also used : StorageDomainsAndStoragePoolIdQueryParameters(org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters)

Example 57 with IdQueryParameters

use of org.ovirt.engine.core.common.queries.IdQueryParameters 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 58 with IdQueryParameters

use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getVmNicList.

public void getVmNicList(AsyncQuery<List<VmNetworkInterface>> aQuery, Guid id) {
    aQuery.converterCallback = new ListConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetVmInterfacesByVmId, new IdQueryParameters(id), aQuery);
}
Also used : StorageDomainsAndStoragePoolIdQueryParameters(org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters)

Example 59 with IdQueryParameters

use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getLabelListByEntityId.

public void getLabelListByEntityId(AsyncQuery<List<Label>> aQuery, Guid entityId) {
    aQuery.converterCallback = new SortListByNameConverter<>();
    Frontend.getInstance().runQuery(QueryType.GetLabelByEntityId, new IdQueryParameters(entityId), aQuery);
}
Also used : StorageDomainsAndStoragePoolIdQueryParameters(org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters)

Example 60 with IdQueryParameters

use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.

the class AsyncDataProvider method getClusterByServiceList.

public void getClusterByServiceList(AsyncQuery<List<Cluster>> aQuery, Guid dataCenterId, final boolean supportsVirtService, final boolean supportsGlusterService) {
    aQuery.converterCallback = source -> {
        if (source == null) {
            return new ArrayList<>();
        }
        final ArrayList<Cluster> list = (ArrayList<Cluster>) source;
        return getClusterByServiceList(list, supportsVirtService, supportsGlusterService);
    };
    Frontend.getInstance().runQuery(QueryType.GetClustersByStoragePoolId, new IdQueryParameters(dataCenterId), aQuery);
}
Also used : StorageDomainsAndStoragePoolIdQueryParameters(org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters) IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) ArrayList(java.util.ArrayList) Cluster(org.ovirt.engine.core.common.businessentities.Cluster)

Aggregations

IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)268 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)89 Guid (org.ovirt.engine.core.compat.Guid)80 ArrayList (java.util.ArrayList)68 StorageDomainsAndStoragePoolIdQueryParameters (org.ovirt.engine.core.common.queries.StorageDomainsAndStoragePoolIdQueryParameters)62 QueryType (org.ovirt.engine.core.common.queries.QueryType)59 List (java.util.List)47 Frontend (org.ovirt.engine.ui.frontend.Frontend)45 VM (org.ovirt.engine.core.common.businessentities.VM)42 ConstantsManager (org.ovirt.engine.ui.uicompat.ConstantsManager)36 HelpTag (org.ovirt.engine.ui.uicommonweb.help.HelpTag)35 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)26 Collection (java.util.Collection)25 UICommand (org.ovirt.engine.ui.uicommonweb.UICommand)25 SearchableListModel (org.ovirt.engine.ui.uicommonweb.models.SearchableListModel)25 Test (org.junit.Test)24 VDS (org.ovirt.engine.core.common.businessentities.VDS)24 HashMap (java.util.HashMap)22 ActionType (org.ovirt.engine.core.common.action.ActionType)21 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)19