org.ovirt.engine.core.common.businessentities.network.Network.getDnsResolverConfiguration()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.1k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中org.ovirt.engine.core.common.businessentities.network.Network.getDnsResolverConfiguration()方法的一些代码示例,展示了Network.getDnsResolverConfiguration()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getDnsResolverConfiguration()方法的具体详情如下:
包路径:org.ovirt.engine.core.common.businessentities.network.Network
类名称:Network
方法名:getDnsResolverConfiguration

Network.getDnsResolverConfiguration介绍

暂无

代码示例

代码示例来源:origin: oVirt/ovirt-engine

private Guid getDnsResolverConfigurationId(Network network) {
  DnsResolverConfiguration dnsResolverConfiguration = network.getDnsResolverConfiguration();
  if (dnsResolverConfiguration == null) {
    return null;
  }
  return dnsResolverConfiguration.getId();
}

代码示例来源:origin: oVirt/ovirt-engine

private List<NameServer> getExpectedNameServers() {
  List<NameServer> nameServersOfNetworkAttachment =
      getNameServers(networkAttachment.getDnsResolverConfiguration());
  List<NameServer> nameServersOfNetwork = getNameServers(network.getDnsResolverConfiguration());
  return nameServersOfNetworkAttachment.isEmpty() ? nameServersOfNetwork : nameServersOfNetworkAttachment;
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void save(Network entity) {
  DnsResolverConfiguration dnsResolverConfiguration = entity.getDnsResolverConfiguration();
  if (dnsResolverConfiguration != null) {
    Validate.isTrue(dnsResolverConfiguration.getId() == null);
    dnsResolverConfigurationDao.save(dnsResolverConfiguration);
  }
  super.save(entity);
}

代码示例来源:origin: oVirt/ovirt-engine

@Override
public void update(Network entity) {
  DnsResolverConfiguration dnsResolverConfiguration = entity.getDnsResolverConfiguration();
  if (dnsResolverConfiguration == null) {
    dnsResolverConfigurationDao.removeByNetworkId(entity.getId());
  } else {
    if (dnsResolverConfiguration.getId() == null) {
      dnsResolverConfigurationDao.save(dnsResolverConfiguration);
    } else {
      dnsResolverConfigurationDao.update(dnsResolverConfiguration);
    }
  }
  super.update(entity);
}

代码示例来源:origin: oVirt/ovirt-engine

/**
 * Ensures updating a network works as expected.
 */
@Test
public void testUpdate() {
  Network before = dao.getByNameAndCluster(EXISTING_NETWORK_NAME1, FixturesTool.CLUSTER);
  before.setDescription("This is a completely changed description");
  before.getDnsResolverConfiguration().getNameServers().add(new NameServer("1.1.1.1"));
  dao.update(before);
  Network after = dao.getByNameAndCluster(EXISTING_NETWORK_NAME1, FixturesTool.CLUSTER);
  assertNotNull(after);
  assertEquals(before, after);
}

代码示例来源:origin: oVirt/ovirt-engine

@Test
public void testReportConfigurationsOnHostWhenDnsConfigurationResolverOutOfSync() {
  iface.setIpv4DefaultRoute(true);
  //cannot use initIpv4ConfigurationBootProtocol because of 'randomized tests' technique.
  iface.setIpv4BootProtocol(Ipv4BootProtocol.DHCP);
  IPv4Address address = new IPv4Address();
  address.setBootProtocol(Ipv4BootProtocol.DHCP);
  testedNetworkAttachment.getIpConfiguration().setIPv4Addresses(Collections.singletonList(address));
  network.setDnsResolverConfiguration(sampleDnsResolverConfiguration2);
  ReportedConfigurations reportedConfigurations = createTestedInstanceWithSameNonQosValues(true).reportConfigurationsOnHost();
  assertThat(reportedConfigurations.isNetworkInSync(), is(false));
  List<ReportedConfiguration> reportedConfigurationList = reportedConfigurations.getReportedConfigurationList();
  List<ReportedConfiguration> expectedReportedConfigurations = addReportedConfigurations(
      combineReportedConfigurations(createBasicReportedConfigurations(), reportQos(true)),
      new ReportedConfiguration(ReportedConfigurationType.IPV4_BOOT_PROTOCOL,
          iface.getIpv4BootProtocol().name(),
          /*ipv4Address*/address.getBootProtocol().name(),
          true),
      new ReportedConfiguration(ReportedConfigurationType.DNS_CONFIGURATION,
          addressesAsString(sampleDnsResolverConfiguration.getNameServers()),
          addressesAsString(network.getDnsResolverConfiguration().getNameServers()),
          false),
      new ReportedConfiguration(ReportedConfigurationType.DEFAULT_ROUTE, true, true, true)
  );
  assertThat(reportedConfigurationList.containsAll(expectedReportedConfigurations), is(true));
  assertThat(reportedConfigurationList.size(), is(expectedReportedConfigurations.size()));
}

代码示例来源:origin: oVirt/ovirt-engine

/**
 * Ensures that removing a network works as expected.
 */
@Test
public void testRemove() {
  Network result = dao.getByNameAndDataCenter(EXISTING_NETWORK_NAME2, FixturesTool.DATA_CENTER);
  assertNotNull(result);
  assertEquals(FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE,
      result.getDnsResolverConfiguration().getId());
  dao.remove(result.getId());
  assertNull(dao.getByNameAndDataCenter(EXISTING_NETWORK_NAME2, FixturesTool.DATA_CENTER));
  assertNull(dnsResolverConfigurationDao.get(FixturesTool.EXISTING_DNS_RESOLVER_CONFIGURATION_TO_REMOVE));
}

代码示例来源:origin: oVirt/ovirt-engine

DnsResolverConfigurationMapper.map(entity.getDnsResolverConfiguration(),
    model.getDnsResolverConfiguration()));

代码示例来源:origin: oVirt/ovirt-engine

if (entity.getDnsResolverConfiguration() != null) {
  model.setDnsResolverConfiguration(
      DnsResolverConfigurationMapper.map(entity.getDnsResolverConfiguration()));

代码示例来源:origin: oVirt/ovirt-engine

DnsResolverConfiguration dnsResolverConfiguration = getNetwork().getDnsResolverConfiguration();
if (dnsResolverConfiguration == null) {
  dnsResolverConfiguration = new DnsResolverConfiguration();

相关文章