Search in sources :

Example 11 with Provider

use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.

the class BackendExternalHostGroupsResource method list.

@Override
public ExternalHostGroups list() {
    Provider provider = BackendExternalProviderHelper.getProvider(this, providerId);
    ProviderQueryParameters parameters = new ProviderQueryParameters();
    parameters.setProvider(provider);
    return mapCollection(getBackendCollection(QueryType.GetHostGroupsFromExternalProvider, parameters));
}
Also used : ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) ExternalHostProvider(org.ovirt.engine.api.model.ExternalHostProvider) Provider(org.ovirt.engine.core.common.businessentities.Provider)

Example 12 with Provider

use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.

the class NewHostModel method providers_SelectedItemChanged.

private void providers_SelectedItemChanged() {
    cleanHostParametersFields();
    Provider provider = getProviders().getSelectedItem();
    setEnableSearchHost(provider != null);
}
Also used : Provider(org.ovirt.engine.core.common.businessentities.Provider) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)

Example 13 with Provider

use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.

the class NewHostModel method updateHostList.

private void updateHostList() {
    Provider provider = getProviders().getSelectedItem();
    if (provider == null) {
        return;
    }
    AsyncDataProvider.getInstance().getExternalProviderHostList(new AsyncQuery<>(hosts -> {
        ListModel<VDS> hostNameListModel = getExternalHostName();
        hostNameListModel.setItems(hosts);
        hostNameListModel.setIsChangeable(true);
        setEnableSearchHost(true);
        getProviders().setIsChangeable(true);
    }), provider.getId(), true, getProviderSearchFilter().getEntity());
    AsyncDataProvider.getInstance().getExternalProviderHostGroupList(new AsyncQuery<>(hostGroups -> {
        ListModel externalHostGroupsListModel = getExternalHostGroups();
        externalHostGroupsListModel.setItems(hostGroups);
        externalHostGroupsListModel.setIsChangeable(true);
        AsyncDataProvider.getInstance().getExternalProviderDiscoveredHostList(new AsyncQuery<>(hosts -> {
            ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts();
            externalDiscoveredHostsListModel.setItems(hosts);
            externalDiscoveredHostsListModel.setIsChangeable(true);
        }), getProviders().getSelectedItem());
    }), provider);
    AsyncDataProvider.getInstance().getExternalProviderComputeResourceList(new AsyncQuery<>(computeResources -> {
        ListModel externalComputeResourceListModel = getExternalComputeResource();
        externalComputeResourceListModel.setItems(computeResources);
        externalComputeResourceListModel.setIsChangeable(true);
    }), provider);
}
Also used : ApplicationModeHelper(org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) List(java.util.List) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) ExternalHostGroup(org.ovirt.engine.core.common.businessentities.ExternalHostGroup) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) ExternalDiscoveredHost(org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost) Provider(org.ovirt.engine.core.common.businessentities.Provider) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) VDS(org.ovirt.engine.core.common.businessentities.VDS) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) ArrayList(java.util.ArrayList) ListModel(org.ovirt.engine.ui.uicommonweb.models.ListModel) Provider(org.ovirt.engine.core.common.businessentities.Provider) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)

Example 14 with Provider

use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.

the class GetComputeResourceFromExternalProviderQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    Provider hostProvider = getParameters().getProvider();
    List<ExternalComputeResource> providerComputeResources = getProviderComputeResource(hostProvider);
    getQueryReturnValue().setReturnValue(providerComputeResources);
}
Also used : ExternalComputeResource(org.ovirt.engine.core.common.businessentities.ExternalComputeResource) Provider(org.ovirt.engine.core.common.businessentities.Provider)

Example 15 with Provider

use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.

the class BackendExternalProviderCertificateResource method get.

@Override
public Certificate get() {
    // The resource identifier is actually the index of the certificate in the chain:
    int i;
    try {
        i = Integer.parseInt(id);
    } catch (NumberFormatException exception) {
        return notFound();
    }
    // The backend doesn't have a mechanism to retrieve just one of the certificates of the chain, so we have to
    // retrieve them all and find the one that matches the identifier:
    Provider provider = BackendExternalProviderHelper.getProvider(this, providerId);
    ProviderQueryParameters parameters = new ProviderQueryParameters();
    parameters.setProvider(provider);
    List<CertificateInfo> entities = getBackendCollection(CertificateInfo.class, QueryType.GetProviderCertificateChain, parameters);
    if (entities != null && i >= 0 && i < entities.size()) {
        CertificateInfo entity = entities.get(i);
        Certificate model = populate(map(entity), entity);
        model.setId(id);
        return model;
    }
    // No luck:
    return notFound();
}
Also used : ProviderQueryParameters(org.ovirt.engine.core.common.queries.ProviderQueryParameters) CertificateInfo(org.ovirt.engine.core.common.businessentities.CertificateInfo) Provider(org.ovirt.engine.core.common.businessentities.Provider) Certificate(org.ovirt.engine.api.model.Certificate)

Aggregations

Provider (org.ovirt.engine.core.common.businessentities.Provider)63 ExternalHostProvider (org.ovirt.engine.api.model.ExternalHostProvider)10 ArrayList (java.util.ArrayList)7 ProviderQueryParameters (org.ovirt.engine.core.common.queries.ProviderQueryParameters)7 AsyncDataProvider (org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)7 ProviderParameters (org.ovirt.engine.core.common.action.ProviderParameters)6 Test (org.junit.Test)5 VDS (org.ovirt.engine.core.common.businessentities.VDS)5 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)5 Guid (org.ovirt.engine.core.compat.Guid)5 List (java.util.List)4 OpenStackNetworkProvider (org.ovirt.engine.api.model.OpenStackNetworkProvider)4 OpenStackVolumeProvider (org.ovirt.engine.api.model.OpenStackVolumeProvider)4 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)4 ExternalDiscoveredHost (org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost)4 ExternalHostGroup (org.ovirt.engine.core.common.businessentities.ExternalHostGroup)4 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)4 ExternalProvider (org.ovirt.engine.api.model.ExternalProvider)3 OpenstackNetworkProviderProperties (org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties)3 ApplicationMode (org.ovirt.engine.core.common.mode.ApplicationMode)3