Search in sources :

Example 1 with Provider

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

the class ProviderNetworkListModel method syncSearch.

@Override
protected void syncSearch() {
    Provider provider = getEntity();
    if (provider == null) {
        return;
    }
    super.syncSearch(QueryType.GetAllNetworksForProvider, new IdQueryParameters(provider.getId()));
}
Also used : IdQueryParameters(org.ovirt.engine.core.common.queries.IdQueryParameters) Provider(org.ovirt.engine.core.common.businessentities.Provider)

Example 2 with Provider

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

the class HostNetworkProviderModel method selectProviderById.

public void selectProviderById(Guid providerId) {
    if (getNetworkProviders().getItems() != null) {
        Provider provider = getNetworkProviders().getItems().stream().filter(candidate -> Objects.equals(candidate.getId(), providerId)).findFirst().orElse(getNoExternalNetworkProvider());
        getNetworkProviders().setSelectedItem(provider);
    }
}
Also used : Provider(org.ovirt.engine.core.common.businessentities.Provider) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider)

Example 3 with Provider

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

the class UpdateHostValidatorTest method hostProviderTypeDoesNotMatch.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void hostProviderTypeDoesNotMatch() {
    when(host.getHostProviderId()).thenReturn(Guid.newGuid());
    Provider provider = mock(Provider.class);
    when(provider.getType()).thenReturn(ProviderType.OPENSTACK_IMAGE);
    when(providerDao.get(any())).thenReturn(provider);
    assertThat(validator.hostProviderTypeMatches(), failsWith(EngineMessage.ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH));
}
Also used : Provider(org.ovirt.engine.core.common.businessentities.Provider) Test(org.junit.Test)

Example 4 with Provider

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

the class AbstractBackendExternalProviderResource method importCertificates.

@Override
public Response importCertificates(Action action) {
    Provider provider = BackendExternalProviderHelper.getProvider(this, id);
    validateParameters(action, "certificates.content");
    String content = null;
    Certificates certificates = action.getCertificates();
    if (certificates != null) {
        List<Certificate> list = certificates.getCertificates();
        if (!CollectionUtils.isEmpty(list)) {
            content = list.get(0).getContent();
        }
    }
    return performAction(ActionType.ImportProviderCertificate, new ImportProviderCertificateParameters(provider, content));
}
Also used : Certificates(org.ovirt.engine.api.model.Certificates) ImportProviderCertificateParameters(org.ovirt.engine.core.common.action.ImportProviderCertificateParameters) Provider(org.ovirt.engine.core.common.businessentities.Provider) ExternalProvider(org.ovirt.engine.api.model.ExternalProvider) Certificate(org.ovirt.engine.api.model.Certificate)

Example 5 with Provider

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

the class AbstractBackendExternalProviderResource method testConnectivity.

@Override
public Response testConnectivity(Action action) {
    Provider provider = BackendExternalProviderHelper.getProvider(this, id);
    ProviderParameters parameters = new ProviderParameters(provider);
    return performAction(ActionType.TestProviderConnectivity, parameters);
}
Also used : ProviderParameters(org.ovirt.engine.core.common.action.ProviderParameters) Provider(org.ovirt.engine.core.common.businessentities.Provider) ExternalProvider(org.ovirt.engine.api.model.ExternalProvider)

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