Search in sources :

Example 6 with DnsResolverConfiguration

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

the class ReportedConfigurationsFillerTest method setUp.

@Before
public void setUp() {
    hostId = Guid.newGuid();
    clusterId = Guid.newGuid();
    VdsStatic vdsStatic = new VdsStatic();
    vdsStatic.setId(hostId);
    vdsStatic.setClusterId(clusterId);
    reportedDnsResolverConfiguration = new DnsResolverConfiguration();
    VdsDynamic vdsDynamic = new VdsDynamic();
    vdsDynamic.setId(hostId);
    vdsDynamic.setReportedDnsResolverConfiguration(reportedDnsResolverConfiguration);
    baseNic = createNic("eth0");
    vlanNic = createNic("eth0.1");
    vlanNic.setBaseInterface(baseNic.getName());
    baseNicNetwork = createNetwork("baseNicNetwork");
    vlanNetwork = createNetwork("vlanNicNetwork");
    vlanNetwork.setVlanId(1);
    baseNicNetworkQos = new HostNetworkQos();
    baseNicNetworkQos.setId(baseNicNetwork.getQosId());
    vlanNetworkQos = new HostNetworkQos();
    vlanNetworkQos.setId(vlanNetwork.getQosId());
    when(vdsStaticDao.get(hostId)).thenReturn(vdsStatic);
    when(vdsDynamicDao.get(hostId)).thenReturn(vdsDynamic);
    cluster = new Cluster();
    cluster.setCompatibilityVersion(Version.v4_1);
    when(clusterDao.get(any())).thenReturn(cluster);
}
Also used : HostNetworkQos(org.ovirt.engine.core.common.businessentities.network.HostNetworkQos) EffectiveHostNetworkQos(org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos) VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) Cluster(org.ovirt.engine.core.common.businessentities.Cluster) DnsResolverConfiguration(org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration) Before(org.junit.Before)

Example 7 with DnsResolverConfiguration

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

the class NetworkAttachmentDaoImpl method save.

@Override
public void save(NetworkAttachment entity) {
    verifyRelationWithHostNetworkQos(entity);
    hostNetworkQosDao.persistQosChanges(entity.getId(), asHostNetworkQos(entity.getHostNetworkQos()));
    DnsResolverConfiguration dnsResolverConfiguration = entity.getDnsResolverConfiguration();
    if (dnsResolverConfiguration != null) {
        dnsResolverConfigurationDao.save(dnsResolverConfiguration);
    }
    super.save(entity);
}
Also used : DnsResolverConfiguration(org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)

Example 8 with DnsResolverConfiguration

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

the class NetworkDaoImpl method save.

@Override
public void save(Network entity) {
    DnsResolverConfiguration dnsResolverConfiguration = entity.getDnsResolverConfiguration();
    if (dnsResolverConfiguration != null) {
        dnsResolverConfigurationDao.save(dnsResolverConfiguration);
    }
    super.save(entity);
}
Also used : DnsResolverConfiguration(org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)

Example 9 with DnsResolverConfiguration

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

the class NetworkAttachmentDaoImplTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    dao = dbFacade.getNetworkAttachmentDao();
    dnsResolverConfigurationDao = dbFacade.getDnsResolverConfigurationDao();
    networkAttachment = new NetworkAttachment();
    networkAttachment.setNicId(FixturesTool.VDS_NETWORK_INTERFACE);
    networkAttachment.setProperties(new HashMap<>());
    networkAttachment.setId(Guid.newGuid());
    networkAttachment.setNetworkId(FixturesTool.NETWORK_ENGINE);
    networkAttachment.setIpConfiguration(createIpConfiguration(Ipv4BootProtocol.DHCP, Ipv6BootProtocol.AUTOCONF));
    networkAttachment.setDnsResolverConfiguration(new DnsResolverConfiguration());
    networkAttachment.getDnsResolverConfiguration().setNameServers(new ArrayList<>(Arrays.asList(new NameServer("1.1.1.1"))));
}
Also used : NameServer(org.ovirt.engine.core.common.businessentities.network.NameServer) DnsResolverConfiguration(org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration) NetworkAttachment(org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)

Example 10 with DnsResolverConfiguration

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

the class DnsResolverConfigurationDaoTest method generateNewEntity.

@Override
protected DnsResolverConfiguration generateNewEntity() {
    DnsResolverConfiguration dnsResolverConfiguration = new DnsResolverConfiguration();
    dnsResolverConfiguration.setNameServers(new ArrayList<>(Arrays.asList(new NameServer("1.1.1.1"))));
    return dnsResolverConfiguration;
}
Also used : NameServer(org.ovirt.engine.core.common.businessentities.network.NameServer) DnsResolverConfiguration(org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)

Aggregations

DnsResolverConfiguration (org.ovirt.engine.core.common.businessentities.network.DnsResolverConfiguration)19 NameServer (org.ovirt.engine.core.common.businessentities.network.NameServer)9 NetworkAttachment (org.ovirt.engine.core.common.businessentities.network.NetworkAttachment)5 HostNetworkQos (org.ovirt.engine.core.common.businessentities.network.HostNetworkQos)4 Network (org.ovirt.engine.core.common.businessentities.network.Network)4 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 Before (org.junit.Before)2 Cluster (org.ovirt.engine.core.common.businessentities.Cluster)2 IpConfiguration (org.ovirt.engine.core.common.businessentities.network.IpConfiguration)2 NetworkCluster (org.ovirt.engine.core.common.businessentities.network.NetworkCluster)2 EffectiveHostNetworkQos (org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos)2 Map (java.util.Map)1 Test (org.junit.Test)1 FindActiveVmsUsingNetwork (org.ovirt.engine.core.bll.network.FindActiveVmsUsingNetwork)1 CreateOrUpdateBond (org.ovirt.engine.core.common.action.CreateOrUpdateBond)1 VdsDynamic (org.ovirt.engine.core.common.businessentities.VdsDynamic)1 VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)1 AnonymousHostNetworkQos (org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos)1