use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class BackendExternalProviderCertificatesResource method list.
@Override
public Certificates list() {
Provider provider = BackendExternalProviderHelper.getProvider(this, providerId);
ProviderQueryParameters parameters = new ProviderQueryParameters();
parameters.setProvider(provider);
return mapCollection(getBackendCollection(QueryType.GetProviderCertificateChain, parameters));
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class ExternalHostProviderMapper method map.
@Mapping(from = ExternalHostProvider.class, to = Provider.class)
public static Provider map(ExternalHostProvider model, Provider template) {
Provider entity = template != null ? template : new Provider();
entity.setType(ProviderType.FOREMAN);
if (model.isSetId()) {
entity.setId(GuidUtils.asGuid(model.getId()));
}
if (model.isSetName()) {
entity.setName(model.getName());
}
if (model.isSetDescription()) {
entity.setDescription(model.getDescription());
}
if (model.isSetUrl()) {
entity.setUrl(model.getUrl());
}
if (model.isSetRequiresAuthentication()) {
entity.setRequiringAuthentication(model.isRequiresAuthentication());
}
if (model.isSetUsername()) {
entity.setUsername(model.getUsername());
}
if (model.isSetPassword()) {
entity.setPassword(model.getPassword());
}
return entity;
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class GetAllExternalNetworksOnProviderQueryTest method testExecuteQueryCommand.
@Test
@SuppressWarnings("unchecked")
public void testExecuteQueryCommand() {
when(params.getId()).thenReturn(mock(Guid.class));
when((Provider<AdditionalProperties>) providerDao.get(any())).thenReturn(networkProvider);
when(providerProxyFactory.create(networkProvider)).thenReturn(client);
Network network = mock(Network.class);
ProviderNetwork providerNetwork = mock(ProviderNetwork.class);
when(client.getAll()).thenReturn(Collections.singletonList(network));
when(network.getProvidedBy()).thenReturn(providerNetwork);
when(providerNetwork.getExternalId()).thenReturn("");
Guid id = mock(Guid.class);
when(dcDao.getDcIdByExternalNetworkId(any())).thenReturn(Collections.singletonList(id));
Map<Network, Set<Guid>> expected = new HashMap<>();
expected.put(network, Collections.singleton(id));
query = getQuery();
query.executeQueryCommand();
assertEquals("Wrong result returned", expected, getQuery().getQueryReturnValue().getReturnValue());
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class GetHostGroupsFromExternalProviderQuery method executeQueryCommand.
@Override
protected void executeQueryCommand() {
Provider hostProvider = getParameters().getProvider();
List<ExternalHostGroup> providerHostGroups = getProviderHostGroups(hostProvider);
getQueryReturnValue().setReturnValue(providerHostGroups);
}
use of org.ovirt.engine.core.common.businessentities.Provider in project ovirt-engine by oVirt.
the class ProviderDaoTest method generateNewEntity.
@Override
protected Provider<?> generateNewEntity() {
Provider<AdditionalProperties> provider = new Provider<>();
provider.setId(generateNonExistingId());
provider.setName("brovider");
provider.setUrl("http://brovider.com/");
provider.setType(ProviderType.OPENSTACK_NETWORK);
OpenstackNetworkProviderProperties additionalProperties = new OpenstackNetworkProviderProperties();
additionalProperties.setReadOnly(Boolean.FALSE);
additionalProperties.setTenantName("10ant");
additionalProperties.setPluginType(OpenstackNetworkPluginType.OPEN_VSWITCH.name());
provider.setAdditionalProperties(additionalProperties);
provider.setAuthUrl("http://keystone-server:35357/v2.0/");
return provider;
}
Aggregations